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 > Apache Best Practices > Configuring PHP Timeouts under Windows Apache

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, go to Server Setup | Directives.
  2. In the search box, enter 'max' and click Search.
  3. Select Resource Limits, 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 Save Changes, and then Restart PHP.

 

 

 

Related Links

Related Links:

Apache Configuration Optimization

 

 

 

 

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