Jump to content

How to setup the execution time in Apache


TFT2012

Recommended Posts

I have a part of php code (in Apache) which uses file_get_contents() to get data through a service url (in IIS7). The IIS 7 will need about 30 minutes to give the data back. Then I need to keep this execution in my Apache server for about 30 minutes. I have set the max_execution_time to 3600 in PHP, how can I do it in Apache? I added TimeOut 3600 to httpd.conf, but it seems dosen't work. Because after about 30 seconds running, the web page will ask me to download the php file instead of keep running the script.

 

Thanks!

  • 3 months later...

I hate to ask, but did you restart apache after changing the php.ini and the httpd.conf file?

 

service httpd reload

 

Also, edit this line:

 

KeepAliveTimeout 30

 

So that it says:

KeepAliveTimeout 3600

 

With that said, it would be best to CLI this, so you don't have to worry about the Apache timeout:

 

/usr/bin/php -q /path/to/php_file.php

  • 4 weeks later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.