$wp_cache_cron_check = 1; //Added by WP-Cache Manager $wp_cache_cron_check = 1; //Added by WP-Cache Manager Tag » home « @ A Genius Blog
Windows tips, Registry Hacks, Network security and Linux tips
RSS icon Email icon Home icon
  • Setting up localhost – The fun way.

    Posted on March 19th, 2010 Thomas No comments

    About two days ago, I thought “Hmmm.. lets learn PHP”. Because PHP is a server-side language you have to upload pages to your server before you can test them, this process is annoying and uses a sh1tload of bandwidth if you are working with major code. Alternatively you can set up your localhost to run as a webserver and test the code from there. Sounds cool huh?

    Well I had done it once, way-back-when and couldn’t remember all the commands etc. So I had a look on the internet, it was as dry as an 80-year old granny. Nothing. Nada, well nothing that helped me much anyway.

    BUT, I did it. This morning, after not sleeping for 2 nights to get this up (yes, I am that dedicated/sad).

    Now, there are programs out there which are a sort of one-click done type of thing, if you want that, google it. I only do things the fun way, by manual installation and learning the basics behind the subject.

    First of all; lets talk about what software we are going to use:

    Windows XP,

    Apache 2.2.14 (the HTTP project one, none of their other software)

    PHP5.3.1 (binaries not one-click install)

    PHPMyAdmin 3.2.5 (english).

    LINKS

    Apache: http://httpd.apache.org/download.cgi#apache22 (Win32 Binary including OpenSSL)

    PHP: http://windows.php.net/download/    (Thread safe x86 VC6 – look for it on the page)

    phpMyAdmin: http://www.phpmyadmin.net/home_page/downloads.php (english vers.)

    TUTORIAL!

    Download all of the files to your desktop, we will start by doing the easiest first – Apache.

    APACHE

    This is the only one-click install package we will use, extract and open the .msi file, double click and open.

    When you hit the Server Information box enter ‘localhost’, do the same for the Domain Network box and enter what ever e-mail you want in the Administrators E-mail box. “Leave the  All Users, on Port 80, as a Service” check button checked. When it asks if you want to make a bin as well, say yes and continue.

    Setup Type = “Typical” and spam next all the way through until the end.

    The .msi file assumes that it installs to “C:\Program Files\Apache Group\” so that is where all the files are sitting nicely for you.

    You will need to know how to Start/Stop/Restart your server won’t you?:

    Go Start>All Programs>Apache HTTP Server 2.2>Control Apache Server then you have Stop, Start, and Restart> Choose restart.

    PHP

    Extract the binaries to “C:\php”

    Inside the extracted folder find a file called “php.ini-recommended” and rename it to php.ini and put it in the “C:\WINDOWS\”

    Find libmysql.dll and put it into “C:\WINDOWS\System 32″ <- this means PHP will load the MySQL module.

    Right, thats done. Now for phpMyAdmin

    PHPMYADMIN

    Extract the files and put them into “C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\phpmyadmin”

    STRING EDITING:

    Open php.ini and find the words “extension=php_mysql.dll” and remove the ; from the front of it.

    And that is phpMyAdmin done :D .

    Now you should be able to load up LocalHost on a web browser and it should work.

    Now: How do you get files/pages to display? Well, put any file into: “C:\Program Files\Apache Software Foundation\Apache2.2\htdocs” and they will display through LocalHost. Oh no! You need a MySQL database? That’s what phpMyAdmin is there for; you can use that to mess around with the MySQL databases.

    So, there you go :)

    Now this Tutorial was written over the space of 2 months, so there may be glaring errors, PLEASE correct me and I’ll update this post. Also, if you want any help with the technologies I will gladly help to the best of my ability :)

    Thomas – AGeniusBlog.com

    Now this Tutorial was written over the space of 2 months, so there may be glaring errors, PLEASE correct me and I’ll update this post. Also, if you want any help with the technologies I will gladly help to the best of my ability :)
    Thomas – AGeniusBlog.com

    If you liked this post, please buy me a coffee! Donations will be VERY much appreciated!