简体   繁体   中英

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 a 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM