Helping ordinary people create extraordinary websites!
GET OUR NEWSLETTER
Your Email:
 

Installing PHP on Windows

By Michael J. Ross
2008-03-05


Downloading PHP

We will be using the latest stable version of PHP, which at this time is version 5.2.5. You should download it from the appropriate section on the PHP download page.

You have the option of downloading the full source code for PHP, in case you would like to compile yourself or examine the code. But for Windows development environments, the Windows binaries is the recommended option, to avoid wasting time compiling PHP from source and possibly avoid problems that might arise during that process. For the Windows binaries, you have the option of downloading either a Zip archive file or a larger file with a built-in installer. Anyone experienced with setting up PHP would likely have no problems using the archive file. But for anyone new to installing PHP, it would be best to use the installer version, which is what we will do here. The download section also lists the MD5 value for those who wish to confirm the integrity of the file they download to their computer.

When you click on the "PHP 5.2.5 installer" link, you will be taken to a page where you can choose a mirror site in your country or one that is close to you. Clicking on the mirror link will start the download process. Save the file, php-5.2.5-win32-installer.msi, to a place on your PC where you can easily find it. Then open the file, which will start the PHP Setup Wizard.

At the welcome dialog box, click the "Next" button.

At the license dialog box, check the radio button indicating that you accept the license, and then click the "Next" button.

By default, Apache will be installed in "C:\Program Files\PHP". But in this tutorial we will be using "C:\_a\PHP". The reasons and advantages for this directory naming scheme are presented in my earlier tutorial, "Installing MySQL on Windows"

. To change the destination folder, click the "Browse" button. When you're finished, click the "Next" button.

In order to be able to serve Web pages, PHP, like any Web scripting language, needs to work in conjunction with a Web server. If you have followed the instructions in the aforementioned Apache tutorial, you will have already installed Apache version 2.2 on your PC. At the "Web Server Setup" dialog box, click the "Apache 2.2.X Module" radio button, and then the "Next" button.

The PHP Installation Wizard needs to be told where to find your Apache configuration files, of which httpd.conf is the primary one. After you have specified the correct directory, click the "Next" button.

In addition to the core PHP files, you can also install any of a large number of available extensions, ranging from extensions for ActiveScript to zlib_filter. In this example, we will install extensions for the following: cURL, a client URL library (incorrectly listed under "Curl"); the GD image library ("GD2"); mbstring, for multibyte character sets; MySQL and MySQLi, for accessing MySQL databases. Note that the disk space usage numbers are incorrect. For instance, it claims that cURL will consume "1504KB" of space, but in reality the cURL extension DLL file, php_curl.dll, is only 233 KB.

You can also install the PHP Extension and Application Repository (PEAR) and the PHP manual — both listed under the "Extras" node. We will not be installing either one in this tutorial. After you have made all of your selections, click the "Next" button

You are now ready to install PHP's files to your disk. Click the "Install" button, which begins the process.

When the Setup Wizard has completed, it will display a final dialog box.

Click the "Finish" button. You are now ready to verify that the installation was successful.



Tutorial Pages:
» Introduction
» PHP Already Installed?
» Downloading PHP
» Testing PHP
» Adding MySQL
» MySQL Versions of DLLs
» XAMPP


Related Tutorials:
» Port Scanning and Service Status Checking in PHP
» Web Database Access from Desktop Applications
» CubeCart 3.0 Installation and Configuration
» PHP Site Search Made Easy
» Installing and Configuring Drupal 6.1
» Desktop Application Development with PHP-GTK

Advertise with Us!


Tutorials Scripts Web Hosting Developer Manuals
Resources