Web Installation Tool Suite

Install PHP

Knowledge Base / Manual Installation

AddThis Social Bookmark Button

This article will help you install PHP and configure Apache HTTP server and IIS to support it. The installation is compatible with WITSuite family of products.

Save Your Time with EasyInstaller
Install Apache, MySQL, PHP in just a few clicks.
witsuite.com/products/installer/
Manage Your Web Environment
Install many Apache, MySQL, PHP versions and other packages with EasyManager.
witsuite.com/products/manager/

Overview

Using this installation gude you can:

Pre-installation notices

The directory layout is described in the Create Directory Layout article. Apache installation is described in Install Apache HTTP server.

You can change the name of the folder with PHP installed to something like PHP, PHP5, PHP-5.2.8, etc. Just use it instead of PHP-5.2 in the commands below.

Continue with Download and unpack.

Download and unpack

Download PHP ZIP package from download page  into the C:WITSuitePackages folder. The path of the downloaded file may be the following (for PHP 5.2.8):

C:WITSuitePackagesphp-5.2.8-Win32.zip

Unpack it to the C:WITSuiteLanguagesPHP-5.2 folder.

Continue with PHP configuration and integration.

PHP configuration and integration

The following sections show how to integrate PHP with Web servers (PHP CGI) and command prompt (PHP CLI).

Continue with Configure PHP to use in command prompt, Configure Apache Service, or Configure IIS FastCGI.

Configure PHP to use in command prompt

Create folders:

Copy the C:WITSuiteLanguagesPHP-5.2php.ini-recommended to C:WITSuiteConfigurationPHP-5.2php.ini.

Change the following settings in the C:WITSuiteConfigurationPHP-5.2php.ini file:

Create the C:WITSuiteShortcutsPHP-5.2.bat file with the following content:

@echo off
set PATH=%PATH%;C:WITSuiteLanguagesPHP-5.2
set PHPRC=C:WITSuiteConfigurationPHP-5.2
C:WITSuiteLanguagesPHP-5.2php.exe %*

Execute in the command prompt the following command to test the PHP command line interface:

C:WITSuiteShortcutsPHP-5.2.bat -i | more

Configure Apache Service

Create folders:

Copy the C:WITSuiteConfigurationPHP-5.2php.ini file to C:WITSuiteConfigurationApache-2.2PHP-5.2php.ini.

Change the following settings in the C:WITSuiteConfigurationApache-2.2PHP-5.2php.ini file:

Modify the C:WITSuiteConfigurationApache-2.2httpd.conf file as follows:

  1. Add ScriptAlias and Action directives:

    ScriptAlias /php-5.2/ "C:/WITSuite/Languages/PHP-5.2/"
    Action application/x-httpd-php-5.2 "/php-5.2/php-cgi.exe"

  2. Add AddType directive for the PHP file extension:

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

  3. Add Directory that specifies options and environment variables for PHP CGI process:

    <Directory "C:WITSuiteLanguagesPHP-5.2">
        SetEnv PHPRC "C:WITSuiteConfigurationApache-2.2PHP-5.2"
        SetEnv PATH "C:WINDOWS;C:WINDOWSSystem32;C:WITSuiteLanguagesPHP-5.2"
        AllowOverride None
        Options None
        Order allow,deny
        Allow from all
    </Directory>

  4. Optionally add index.php to the DirectoryIndex directive to open index.php files if no file specified.

    DirectoryIndex index.html index.php

Restart the Apache-2.2 service.

To test whether the PHP engine is installed successfully, create in the Apache HTTP server document root the "phpinfo.php" file with the following content:

<?php
phpinfo();

Opening the "http://localhost:8081/phpinfo.php" URL in the browser should display the information about PHP configuration. Here 8081 is the port on which Apache HTTP sever listens for incoming requests. Replace it in case when the particular Apache service listens for the requests on different port.

Configure IIS FastCGI

Following this instruction requires IIS FastCGI being installed on your computer.

Create folders:

Copy the C:WITSuiteLanguagesPHP-5.2php.ini-recommended to C:WITSuiteConfigurationIISPHP-5.2php.ini.

Change the following settings in the C:WITSuiteConfigurationIISPHP-5.2php.ini file:

Continue with Configure IIS 5.1 (Windows XP) or 6.0 (Windows Server 2003) or Configure IIS 7 (Windows Vista SP1 and Windows Server 2008)

Configure IIS 5.1 (Windows XP) or 6.0 (Windows Server 2003)

Grant read permissions on the "C:WITSuiteConfigurationIIS" folder and the "C:WITSuiteLanguagesPHP-5.2" folder and modification permissions on the "C:WITSuiteTemporaryFilesIIS" folder to the "IWAM_[COMPUTERNAME]" user and the "IUSR_[COMPUTERNAME]" user.

Change the C:WindowsSystem32inetsrvfcgiext.ini as follows:

Open IIS Management Console and register application mapping for the php extension:

  1. Open properties of Default Web Site.
  2. Select the Home Directory and click the Configuration... button.
  3. Click Add on the Mappings tab, browse for C:WINDOWSsystem32inetsrvfcgiext.dll executable, set Extension to ".php", set Limit to "GET,HEAD,POST", check Script engine, and then click Ok.
  4. Click Ok in the Default Web Site Properties dialog.

Restart the IIS Admin service.

Continue with Testing your configuration

Configure IIS 7 (Windows Vista SP1 and Windows Server 2008)

Grant read permissions on the "C:WITSuiteConfigurationIIS" folder and the "C:WITSuiteLanguagesPHP-5.2" and modification permissions on the "C:WITSuiteTemporaryFilesIIS" folder to the "IUSR" user and the "IIS_IUSR" user.

You can create PHP handler with IIS Manager or with the appcmd command.

Configure with IIS Manager

Continue with Testing your configuration

Configure using the appcmd command

Open the command prompt and execute the following commands:

Optionaly, add index.php to the list of default documents by executing the following command:

Continue with Testing your configuration

Testing your configuration

To test whether the PHP engine is installed successfully, create in the "C:inetpubwwwroot" folder the "phpinfo.php" file with the following content:

<?php
phpinfo();

Opening the "http://localhost/phpinfo.php" URL in the browser should display the information about PHP configuration.

Questions/Feedback

If you have question/feedback or see an error feel free to send it to us through the email address contact@witsuite.com.

AddThis Social Bookmark Button

Creative Commons License

(This page content is available under a Creative Commons Attribution-Noncommercial-No Derivative Works license.)

© 2007, WITSuite.com. Terms of Service, Privacy Policy, Refund Policy.