PHP script timeout problem
Here's a short back story for context: - Had a site hosted on a solaris machine, had a script that generated a report (pulled data from mysql, generally took ~60 seconds). Everything worked fine. - Migrated that site and db to Ubuntu machines. Now, the script times out after 30 seconds.
Steps I've already taken:
- Increased the max_execution_time to 3600 (I know it's high as hell, but that's what it was set to on the old solaris box)
- Set max_input_time = -1
- set memory_limit = 64MB
I've checked through phpinfo() that these changes are being accepted and show as the current configuration.
As hard as I pray, as crossed as I can get my fingers, or a开发者_如何学运维s many times as I can run the script over and over again...I still get the same result - 30 seconds, it seemingly times out, and tosses a 500 error back at me.
Thoughts? Thanks!
Double check your configuration. If this is being run as a CLI script then some distros have taken to seperating config files in separate directories to have different configuration values for CLI vs web/mod_php. You can run php -i from the command line to see what the CLI environment is configured to do.
First you need to be sure if mysql or php is restricting the time. If it's PHP set_time_limit(0)
does it well.
A mysql abortion would propably lead into an unexpected result. For your 500 PHP should be responsible.
精彩评论