Knowledge Base / Manual Installation
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.
Using this installation gude you can:
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 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.
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.
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:
extension=php_mbstring.dll
extension=php_pdo.dll
extension=php_pdo_mysql.dll
extension=php_pdo_sqlite.dll
extension=php_mysql.dll
extension=php_mysqli.dll
extension=php_sqlite.dll
extension=php_mcrypt.dll
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
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:
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"
AddType directive for the PHP file extension:
AddType application/x-httpd-php-5.2 .php
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>
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.
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)
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:
[Types]
...
php=PHP-5.2
...
[PHP-5.2]
ExePath=C:WITSuiteLanguagesPHP-5.2php-cgi.exe
Arguments=-c C:WITSuiteConfigurationIISPHP-5.2php.ini
QueueLength=999
MaxInstances=20
InstanceMaxRequests=500
ActivityTimeout=500
Open IIS Management Console and register application mapping for the php extension:
C:WINDOWSsystem32inetsrvfcgiext.dll executable, set Extension to ".php", set Limit to "GET,HEAD,POST", check Script engine, and then click Ok.Restart the IIS Admin service.
Continue with Testing your configuration
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:
%SystemRoot%system32inetsrvappcmd set config /section:system.webServer/fastCGI "/+[fullPath='C:WITSuiteLanguagesPHP-5.2php-cgi.exe',arguments='-c C:WITSuiteConfigurationIISPHP-5.2php.ini',maxInstances='4']"%SystemRoot%system32inetsrvappcmd set config /section:system.webServer/handlers "/+[name='FastGCI-PHP-5.2',path='*.php',verb='*',modules='FastCgiModule',scriptProcessor='C:WITSuiteLanguagesPHP-5.2php-cgi.exe|-c C:WITSuiteConfigurationIISPHP-5.2php.ini',responseBufferLimit='0',resourceType='Either']"Optionaly, add index.php to the list of default documents by executing the following command:
Continue with 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.
If you have question/feedback or see an error feel free to send it to us through the email address contact@witsuite.com.
(This page content is available under a Creative Commons Attribution-Noncommercial-No Derivative Works license.)