Installing PHP on Windows requires nothing more than downloading the distribution file. To download the PHP distribution files, go to the home of PHP, http://www.php.net/, and follow the link to the Downloads section. Grab the latest version of the zip package (not the installer!) from the Windows Binaries sectionfor this example, we are using 5.1.4. Your distribution will be named something similar to php-VERSION.zip, where VERSION is the most recent release number. After the file is downloaded to your system, double-click it to launch your unzipping software. The distribution is packed up with relative pathnames already in place, so extract the files to a new directory called C:\php\, where it will place all the files and subdirectories under that new directory. Unlike previous versions of PHP, there is no need to move files into various system directories. Only two basic steps need to be performed:
Integrating PHP with Apache on WindowsTo ensure that PHP and Apache get along with one another, you need to add a few items to the httpd.conf configuration file. First, find a section that looks like this: # Example: # LoadModule foo_module modules/mod_foo.so # LoadModule access_module modules/mod_access.so ... #LoadModule ssl_module modules/mod_ssl.so At the end of this section, add the following: LoadModule php5_module C:/php/php5apache2.dll Next, look for this section: # # AddType allows you to add to or override the MIME configuration # file mime.types for specific file types. # Add the following line: AddType application/x-httpd-php .php .html This statement ensures that the PHP engine will parse files that end with the .php and .html extensions. Your selection of filenames might differ. Additionally, add the following to ensure Apache knows where php.ini resides: PHPIniDir "C:/php/" Save the httpd.conf file and then restart Apache. The server should start without warning; PHP is now part of the Apache web server. By the Way If you have trouble getting Apache to read the correct php.ini file, look at the "Runtime Configuration" entry in the PHP Manual, which provides the list of locations searched for php.ini, at http://www.php.net/manual/en/configuration.php. |