Installing PHP 5 on Windows

This page provides instructions for a Drupal developer who'd like to install PHP 5 on their desktop computer. The instructions assume that you're running a recent version of Windows (NT, 2000, XP, or 2003). Older version like Windows 95, 98 and Me will not be addressed.

Download

The first step is to download the "PHP 5.2.2 installer" binaries from the PHP website at http://www.php.net/downloads.php. At the time this was written, 5.2.2 was the latest, stable release. The file was named: php-5.2.2-win32-installer.msi. Make sure you save the file to a location on your hard drive where you locate it.

Run the Installer

PHP5 comes packaged as an .msi file that uses Microsoft's Installer to automate the installation process. Simply double-clicking on the file will begin the installation.

You'll be presented with several screens that guide you through the installation process:

  1. Welcome - Allows you verify the name and version of the program you're installing.
  2. License Agreement - Presents you with a license you'll need to accept before you can continue.
  3. Destination Folder - Lets you choose where you'd like to install PHP. Change the path to C:\PHP5 .
  4. Web Server Setup - Allows you to choose which web server you'll be using. If you've followed these instructions for installing Apache 2 you should select "Apache 2.2.x Module".
  5. Apache Configuration Directory - Requires you to specify where your Apache configuration file is stored. If you used the Apache installer's default settings, this should be C:\Program Files\Apache Software Foundation\Apache2.2\conf\.
  6. Choose Items to Install - Presents you with a tree of the possible components that can be installed. In addition to the default selection, I'd recommend selecting all Extras and the following Extensions: Curl, GD2, MySQLi.
  7. Ready to Install the Program - This is your final chance to confirm the installation. After clicking Install, you can sit back and watch the blue bar.
  8. Competed - Informs you that everything has completed successfully.

Test PHP

To verify that PHP is in the system path and installed correctly, open a command prompt and run the following command:

C:\>php -v
PHP 5.2.2 (cli) (built: May  2 2007 19:18:26)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies

Restart Apache

The PHP installer has made a change to Apache's configuration so you will need to restart Apache. Review my Apache installation instructions to see how to do this using the Apache Service Monitor.

Test Apache and PHP

To verify that the Apache is correctly configured to use the PHP module we'll create a simple test page. Create a text file name test.php in the Apache's document root, C:\Program Files\Apache Software Foundation\Apache2.2\htdocs. Insert the following code:

<?php
     phpinfo
();
?>

With the browser of your choice, open http://localhost/test.php. You should see a web page displaying PHP's configuration information.

for you, a photo

g & l hankook tyres

ads

User login