Navigation:    Home arrow Installing Apache, PHP & MySQL
Installing Apache, PHP, MySQL on a Windows 98/2000/XP Computer PDF  
Digg Reddit Ma.gnolia Stumble Upon Facebook Twitter Google Yahoo! MyWeb Furl" BlinkList Technorati Mixx Bookmark
Article Index
Installing Apache, PHP, MySQL on a Windows 98/2000/XP Computer
Page 2
Page 3
Page 4


Step 5. Configuring Apache to work with PHP

Even if Apache Web Server is installed it is not configured to work with PHP files (apache knows only to respond to requests from static html files). In order for Apache to work with PHP we must edit the httpd.conf file which is the Apache configuration file. To do that find and edit httpd.conf file, located in C:\Program Files\Apache Group\Apache\conf\httpd.conf:

Find lines that contain DocumentRoot and Directory and change those lines like in the following example:

"C:/phpwebsite"

and:

<Directory "C:/phpwebsite">

After that, find line that contains: application/x-tar .tgz and after that add the following lines:

ScriptAlias /php4/ "c:/php4win/"
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3
AddType application/x-httpd-php .php4
Action application/x-httpd-php "/php4/php.exe"


Carefuly make all modifications. Save the file and restart Apache.

Atention! Apache uses unix style slashes, so you must use "/", instead of "\". This is true only for Apache httpd.conf file, not for php.ini file. So please be carefuly with that.


Step 6. Verify working of Apache with PHP

Create a test.php file with the following content and save it in c:\phpwebsite:

<?php
phpinfo();
?>


Open your browser and type: http://localhost/test.php. You shoud see a webpage with all informations about PHP functions and options available.


Step 7. Download MySQL from the Internet

Go to http://dev.mysql.com/downloads/mysql/5.0.html and download Windows version. Depending on the version you've downloaded you must unzip into C: drive then double click on setup.exe.

After you have installed MySQL, start MySQL service (server). When developing PHP application that uses MySQL, this service must be always started.

To start mysql service go to C:\mysql\bin and launch mysqld.exe (you could create a shortcut on the desktop for that).
If you want to be sure that the MySQL service is starting properly, first time, for debuging purposes is good to launch mysqld.exe from command line:

Press Start / Run, type cmd, in cmd prompt type:
cd c:\mysql\bin
mysqld.exe