php max_execution_time 30 seconds, but ran a script for 2 hours
I ran a script for 2 hours via the command line. The script ran on Mac OS X and queries the database for 开发者_如何学JAVAa list of job and generates a pdf and sends an e-mail over and over again. It keep going and didn't fail. The script ran from the command line. I thought it only had 30 seconds.
PHP CLI vs. PHP CGI
max_execution_time: CLI default is 0 (unlimited)
(for the record: CLI - command line interface)
You can also set ,ax time execution in your script.
void set_time_limit (int $seconds)
Note that this work only when safe mode off.
This function has no effect when PHP is running in safe mode. There is no workaround other than turning off safe mode or changing the time limit in the php.ini.
精彩评论