3. Configure PHP on your Assessment Delivery Web Server (QPLA) server
Once you have installed the software prerequisites that the Assessment Delivery Web Server (QPLA) requires, you'll need to configure PHP so that it works with Perception and at peak performance. You'll need to:
- Which version of PHP do I need?
- Enable the relevant PHP extensions
- Configure PHP settings
- Configure the FastCGI instances
Note: In some instances, if FastCGI hasn't been enabled, you won't be able to enable or disable extensions. For instructions on how to enable FastCGI, see Enable FastCGI Support in IIS 7 on Windows Server 2008, Windows Server 2008 R2, Windows Vista, or Windows 7.
Which version of PHP do I need?
Which version of PHP and the corresponding Visual C++ Redistributable for Visual Studio are required depends on the version of Perception 5.7 you've installed.
Perception 5.7 with Service Pack 2 or Service Pack 3
PHP 5.6.4 is supported for Perception 5.7 with Service Pack 1, Service Pack 2, and Service Pack 3.
Visual C++ Redistributable for Visual Studio 2012 is required for PHP 5.6.4.
Download the Non-Thread Safe version of PHP 5.6.4 (php-5.6.4-nts-win32-vc11-x64.zip) here.
Download PHP Manager for IIS here.
Service Pack 4
PHP 7.1.19 is supported for Service Pack 4.
Visual C++ Redistributable for Visual Studio 2017 is required for PHP 7.3.15.
Download the Non-Thread Safe version of PHP 7.1.19 (php-7.1.19-nts-Win32-VC14-x64.zip) here.
Download PHP Manager for IIS here.
Note: PHP 7.1.19 doesn't include cacert.pem, which is required when using HTTPS. If you're using HTTPS and PHP 7.1.19 with Service Pack 4, download cacert.pem here. Place the cacert.pem file at the appropriate place in the PHP file structure and make sure the variables in the php.ini file are pointing to the location of this cacert.pem file.
Service Pack 5
PHP 7.3.20 is supported for Service Pack 5.
Visual C++ Redistributable for Visual Studio 2017 is required for PHP 7.3.20.
Download the Non-Thread Safe version of PHP 7.3.20 (php-7.3.20-nts-Win32-VC15-x64.zip) here.
Download PHP Manager for IIS here.
Note: PHP 7.3.20 doesn't include cacert.pem, which is required when using HTTPS. If you're using HTTPS and PHP 7.3.20 with Service Pack 5, download cacert.pem here. Place the cacert.pem file at the appropriate place in the PHP file structure and make sure the variables in the php.ini file are pointing to the location of this cacert.pem file.
Enable the relevant PHP extensions
After installing PHP and the corresponding Visual C++ Redistributable for Visual Studio:
- Launch Internet Information Services (IIS) Manager (not Internet Information Services (IIS) 6.0 Manager).
- Select your server from the Connections list on the left.
- In the Features View pane, locate and double-click PHP Manager.
- Under PHP Extensions, click Enable or disable an extension.
- Ensure that the following extensions are enabled:
- CURL (php_curl.dll)
- SOAP (php_soap.dll)
- XSL (php_xsl.dll)
- php_mbstring.dll
- php_gd2.dll
- OpenSSL if planning to run Perception using SSL via HTTPS (php_openssl.dll)
- To enable an extension:
Configure PHP settings
- Launch IIS Manager.
- Select your server from the Connections list on the left.
- In the Features View pane, locate and double-click PHP Settings.
- Under PHP Settings, click Manage all settings.
- Ensure the following settings are configured:
- To edit a setting, select the setting, and click Edit... from the Actions pane.
- To add a setting, click Add... from the Actions pane.
Setting Value Section cgi.fix_pathinfo 1 PHP cgi.force_redirect 0 PHP error_log C:\Windows\Temp\php.log PHP expose_php 0 PHP extension_dir This is the location of the PHP extension directory, e.g.,. C:\Program Files (x86)\PHP\v7.1\ext\. PHP fastcgi.impersonate 1 PHP fastcgi.logging 0 PHP max_execution_time 300 PHP max_input_vars 2000 PHP memory_limit 256M PHP post_max_size 20M PHP realpath_cache_size 5M PHP realpath_cache_ttl 1800 PHP session.save_path C:\Windows\Temp PHP upload_max_filesize 20M PHP upload_tmp_dir C:\Windows\Temp PHP zend_extension php_opcache.dll PHP sendmail_from [user@yourdomain.xyz] Mail function smtp_port 25 Mail function SMTP [Your SMTP server IP address] Mail function opcache.cli_enable 1 opcache opcache.enable 1 opcache opcache.enable.cli 1 opcache opcache.file_cache This is the location of the OPcache directory, e.g., C:\Questionmark\PHP\caches\opcache. opcache opcache.file_cache_only 0 opcache opcache.interned_strings_buffer 16 opcache opcache.max_accelerated_files 25000 opcache opcache.memory_consumption 256 opcache opcache.revalidate_freq 4 opcache opcache.validate_timestamps 1 opcache
Configure the FastCGI instances
Note: If FastCGI has not been enabled on your server, see Enable FastCGI Support in IIS 7 on Windows Server 2008, Windows Server 2008 R2, Windows Vista, or Windows 7 for instructions on how to enable it.
Now, you will need to carry out some configuration changes to ensure that PHP is tuned for use with Perception. To do this:
- Launch IIS Manager.
- Select your server from the Connections list on the left.
- In the Features View pane, locate and double-click FastCGI Settings.
- Select the PHP entry, and click Edit... from the Actions pane.
- Ensure that the Instance MaxRequests setting is set to 10000.
- The Max Instances setting needs to be set to 10 times the number of processors you have on the server. For example, if your server has 2 processors, the Max Instances would be 20. If you server has 4 processors, the Max Instances should be 40.
- The Activity Timeout setting should be set to 120.
- The Idle Timeout setting should be set to 300.
- The Request Timeout setting should be set to 140.
- Click OK.
PHP has now been configured and is ready to use.
After you have enabled the relevant extensions and configured the FastCGI instances, continue on to step 4 using the link below.