Tuesday, December 28, 2004

[Tech] Installing PHP on Apache

Tonight, it costs me more than an hour to install PHP on Apache system.
So, I'd like to make a conclusion about the process.

1. Unzip the php zip package to C:\php_4.3.10

2. Copy all stuff in "C:\php_4.3.10\dlls" and "C:\php_4.3.10\sapi" to its root, C:\php_4.3.10 The step 2 is very important, I really wonder why php guys put the files in there.

3. Modify php.ini to include folder that will contain php project files (the file that web server will executes) . The php.ini comes from renaming "php.ini-recommended" to php.ini. The location of the command is in the line beginning with doc_root = c:\apache\htdocs.

4. Modify httpd.conf in Apache directory. There are 3 lines for this step.
PHPIniDir "C:/php_4.3.10"
LoadModule php4_module "C:/php_4.3.10/php4apache2.dll"
AddType application/x-httpd-php .php

Note that in LoadModule the location of file is different in the manual and that costs me an hour to find out the fact.

Good Luck.

No comments: