You are currently viewing Zend Server 5.x documentation. Click here to view the latest Zend Server online documentation.
You are here: Zend Server Best Practices > IIS Best Practices > Configuring IIS Timeouts

Configuring IIS Timeouts

 

The following instructions are intended for running Zend Server with PHP FastCGI on Windows.

Issue:

The default timeout settings for FastCGI, may cause runtime failures for scripts that run longer than 30 seconds.

Resolution:

If you know that you have scripts that run more than 30 seconds set your FastCGI and PHP to a longer script timeout duration.

Notes:

- Before editing default values, backup the specified file for easy revert in case PHP functionality fails.
- Edit the specified configuration file using a simple text editor. Rich editors may break the formatting and render a non-operational server.

FastCGI Settings:

This procedure describes how to change your FastCGI timeout settings according to webserver type and version.

        <fastCgi>

            <application fullPath="C:\Program Files (x86)\Zend\ZendServer\bin\php-cgi.exe" maxInstances="10" instanceMaxRequests="10000" >

                <environmentVariables>

                    <environmentVariable name="PHPRC" value="C:\Program Files (x86)\Zend\ZendServer\etc" />

                    <environmentVariable name="PHP_FCGI_MAX_REQUESTS" value="10000" />

                </environmentVariables>

            </application>

        </fastCgi>

PHP Settings

This procedure describes how to configure your PHP's execution time.

 

 

Instructions on how to complete a procedure

To configure your PHP's execution time:

  1. In Zend Server go to Server Setup | Directives
  2. Edit the value of the following directives:
  • Change max_execution_time to <Number of Seconds>
  • Change max_input_time to<Number of Seconds>
  1. Restart PHP

Scripts that run more than 30 seconds but less than <Number of Seconds> should now run. See below for instructions on how to test this.

Testing the Changes

The following procedure shows how to run a short script that checks if the settings have been properly applied.

 

 

Instructions on how to complete a procedure

To test your settings:

  1. Open a text editor and insert the following code:

<?php

sleep(40);

echo "If you see this text the script completed and the defaults were changed";.

?>

  1. Run the script from your docroot, if the script suceeded to run you will see the following message in your browser "If you see this text the script completed and the defaults were changed"

If the test failed you will not see a message in your browser. In that case try restarting your webserver and running the script again.

 

© 1999-2013 Zend Technologies, Ltd. All rights reserved.