Configuring PHP Timeouts under Windows Apache

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

Issue:

The default timeout settings for Zend Enabler, may cause runtime failures for scripts that run longer than 60 seconds.

Long scripts occupy the PHP pool, and may render the PHP process unavailable for new requests.

Resolution:

If you know that you have scripts that run more than 60 seconds, set your Zend Enabler and PHP to a longer script timeout duration.

 

Timeout configuration is illustrated in the following diagram:

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.

Zend Enabler Settings

This procedure describes how to change the Zend Enabler timeout settings for Apache.

 

 

Instructions on how to complete a procedure

To configure Zend Enabler timeout settings:

  1. Open C:\Program Files(x86)\Zend\ZendServer\etc and in ZendEnablerConf.xml.
  2. Locate the following text:

<Timeouts connectionTimeout="60" requestTimeout="120" />

  1. Change the default settings as follows:
  • connectionTimeoutThis variable defines the time limit for requests waiting to be handled by a free PHP process. Should the PHP execution time exceed the set value, the Zend Enabler will return an internal server error (HTTP 500) and the PHP process is interrupted.="<Number of Seconds>"
  • requestTimeoutThis variable defines the processing time limit for requests handled by the Apache server. Should the FastCGI pool fail to deliver the content in the set time, the request is denied. ="<Number of Seconds>"

 

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 for IBMi, go to Configurations | PHP.
  2. In the Search box, enter 'resource', and press Enter.
  3. From the Extensions List, select Resource Limits and Tuning, and modify the value for the following directives:
  • max_execution_timeThis sets the maximum time in seconds a script is allowed to run before it is terminated by the parser. to <30 seconds by default>
  • max_input_timeThis sets the maximum time in seconds a script is allowed to parse input data, like POST and GET. It is measured from the moment of receiving all data on the server to the start of script execution. to <60 seconds by default>
  1. Click .
  2. In the toolbar, the restart icon lights up , indicating a restart is needed to apply changes. Click to restart server and apply changes.
    For information on restarting in Zend Server, see Server Restart.

 

 

 

Related Links

Related Links:

Apache Configuration Optimization

 

 

 

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