In order to use the toolkit, you must ensure that your PHP installation is properly configured. If you will be hosting PHP pages, you will also need to configure your web server appropriately.

Contents

PHP Installation

If you don't have PHP installed, you can get the current distribution from the download section of the PHP site. You should select the ZIP package rather than the pre-packaged installer to be sure that you get the necessary library files.

PHP Configuration

PHP 5 includes two .ini files to be used as templates for configuration. Rename php.ini-recommended to php.ini.

Set extension_dir

Search for the string "extension_dir" in php.ini. Uncomment it and set it equal to "c:/dev/php5/ext/". If you have installed into another directory adjust accordingly. PHP requires an explicit path to find your extensions under Windows.

Turn on the required extensions

In order to use the HTTPS protocol you need to enable some of the PHP extensions. Search for "extension=php_curl.dll". There should be a semi-colon in front of that line - remove it to enable the extension. Scroll down and find "extension=php_openssl.dll" and do the same. Now scroll down a bit further and find "extension=php_soap.dll" and do the same. That's all you need to do for now. Save the file and exit.

Install SSL Library files

Now you need to copy the SSL library files from the PHP installation directory to your Windows system directory. The two files are libeay32.dll and ssleay32.dll. They need to be copied into the system directory, usually c:\windows\system32 on an XP system. If you happen to have OpenSSL already installed on your computer you may find that these files are already installed. If they are, you should only replace them if the ones from the PHP directory are more recent. Change the extensions on the existing ones by adding '.bak' just to be safe.

  • Note: these files must be readable by the Apache process, which may not run with the same permissions that you have when you copy the file into system32, please check that these are read and executable by world/all users

Update the System Path

You'll need to add the PHP installation directory to your system path. Right-click on My Computer on your desktop (or in the Start menu) and select 'Properties'. Click on the Advanced tab and then the 'Environment Variables' button. Scroll down in the System variables list until you find 'Path'. Select it and click the 'Edit' button. Click at the end of the string and make sure that the rest of the string is not highlighted. Type ";c:\php" at the end of the existing string and click OK until all of the windows are closed.

Apache Installation

You can get the current distribution from the download section of the Apache site.

This document will assume C:\Apache Group\Apache2 as your Apache base directory. It will assume C:\dev\php5 as your PHP base directory.

Apache Configuration

Apache's configuration is captured in the C:\Apache Group\Apache2\conf\httpd.conf file.

Turning on PHP 5 Support Edit the configuration file and add the following entries in the appropriate sections:

# Dynamic Shared Object (DSO) Support
  LoadModule php5_module "c:/dev/php5/php5apache2_2.dll"

  # AddType
  AddType application/x-httpd-php .php

  # Anywhere
  PHPIniDir "c:/dev/php5"
  • Note: the file php.ini located in c:/dev/php5 must be readable by Apache, so should be read and execute by world/all users or Apache will not be able to load your complete PHP configuration.

Document Root

Search for "DocumentRoot" to locate the directory for your document root. If you decide to change this, please also change the value of <Directory to match the document root.

Restart Apache server to have the changes take effect.

Tips / Troubleshooting

To test whether PHP is properly configured for you web server, create a file, call it phpinfo.php and paste the following in:

<?php phpinfo(); ?>

Copy the file to your document root and access it in your browser by navigating to http://localhost:[port]/phpinfo.php where port is your http port. You should be presented with a page of PHP information about the current stage of PHP.

This is a short sample of the phpinfo output, two things to note:

  • Apache found and loaded the php.ini file
  • Apache found the SSL files as shown by the Streams and Stream Transport entries


Php config info.jpg