RSS

Set up Apache, PHP and MySQL

15 Jan

Below are instructions to set up your machine for PHP environment. I’m using Windows XP Professional SP2.

(1) Apache Web Server

Download the Win32 Binary (MSI installer). Double click on the downloaded installer and install. The version I’m using is Apache 2.0.59 and I installed into C:\Program Files

Apache installation wizard

(2) PHP Run-time

Download PHP. I’m using PHP 5.0.2 . Install it to C:\php.

PHP setup wizard

(3) The next step will require you to copy these 3 files from C:\php to C:\Program Files\Apache Group\Apache2

(a) php5ts.dll

(b) php5apache2.dll

(c) php.ini

(4) Open php.ini in C:\Program Files\Apache Group\Apache2 using any text editor. Find “doc_root” and edit it to

doc_root = C:\Program Files\Apache Group\Apache2\htdocs

(5) Go to the directory: C:\Program Files\Apache Group\Apache2\conf\ and open httpd.conf file for editing. Add those lines at the end of the file.

LoadModule php5_module php5apache2.dll

AddType application/x-httpd-php .php

(6) In the same file, look for “DirectoryIndex” and edit it to

DirectoryIndex index.html index.html.var index.php

(7) START THE SERVICES

Start the service and the service icon will appear.

(8) TEST APACHE WEB SERVER

After all the installations are done, all you haev to do is to test them out. Open your browser and type http://localhost/ or http://127.0.0.1/ The page will display test page for Apache.

(9) TEST PHP

Go to C:\Program Files\Apache Group\Apache2\htdocs, create a new PHP file using notepad.

Save the file as “test.php”

Write the following codes in the PHP file and save it:

<?php

echo “testing for PHP”;

?>

Open a new browser and type http://localhost/test.php

If your browser display the same, it means that you have succesfully set up the Apache and PHP.

 AN EASIER WAY TO SET UP

If you find that installing Apache web server, PHP and MySql seperately give you lotsa headache, you can always try to install EasyPHP. It consists all the installation with just a click.

EasyPHP setup wizard

Install it to C:\

 Then try to create a test php page (just like the one I created earlier. Place it at www folder.

Start the service.

Open a new browser and type http://localhost/test.php

If your browser display correct page, thus, you’ve successfully installed EasyPHP.

Advertisements
 
6 Comments

Posted by on January 15, 2007 in Tech

 

6 responses to “Set up Apache, PHP and MySQL

  1. Nicr

    January 15, 2007 at 8:25 am

    Bravo, your first technical post

     
  2. Nicr

    January 15, 2007 at 8:28 am

    Bravo!! Your first technical post

     
  3. themamakcorner

    January 15, 2007 at 8:29 am

    the RSS feed not technical ? /slap

     
  4. ahfung

    January 15, 2007 at 8:47 am

    Nice tutorial. SP now can publish the book “SP teach yourself PHP in 1 minute.”

     
  5. themamakcorner

    January 15, 2007 at 10:18 am

    Thanks, I’ll take tat as compliment

     
  6. Tse Min

    January 16, 2007 at 6:19 am

    OH MY LORD!!!!!!!!!! What were you talking about….

     

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: