|
|
|
|
PHP Scripting
Can I install a local PHP development environment?
Yes you can! This section shows you how to install PHP4 and Apache on your Windows system for local PHP development. This example installs PHP4 as an Apache module.
Step 1 - Installing PHP
- Download the latest PHP4 windows zip file from here.
- Extract the zip file contents to the c:\php directory using winzip.
- Open the c:\php directory and copy the php4ts.dll file to c:\winnt\system32 directory (or c:\windows\system)
- Go back to the c:\php directory and rename the file called php.ini-dist to php.ini
- Finally, you need to copy the php.ini to the c:\winnt directory (or c:\windows\system)
Step 2 - Installing Apache
- Download the Apache windows installer from here
- Double click the executable, click the ok button, accept the terms and conditions and hit next
- Enter localhost for the Network Domain and for the Server Name
- Enter your own email address for the Administrator's Email Address
- Accept the defaults for everything else to complete the Apache installation
Step 3 - Configuring Apache
- Open up c:\Program Files\Apache Group\Apache\conf\httpd.conf in an editor
- Search for this line: #LoadModule unique_id_module modules/mod_unique_id.so, it should be on line 192
- Add this line underneath it: LoadModule php4_module c:/php/sapi/php4apache.dll. Make sure you DON'T add an '#' sign to the front of it.
- Search for this line: AddModule mod_setenvif.c it should be on line 239
- Add this line underneath it: AddModule mod_php4.c
- Then add the following lines underneath the: AddType application/x-tar .tgz line
- AddType application/x-httpd-php .php
- AddType application/x-httpd-php .php3
- AddType application/x-httpd-php .php4
- AddType application/x-httpd-php .htm
- AddType application/x-httpd-php .html
- Now save httpd.conf
- Now restart Apache: START->Programs->Apache HTTP Server->Control Apache Server->Restart
For more information about installing PHP with Apache on Windows please visit the Installing on Windows Systems section on the PHP website.
<< Back
|
|
|
|