Chris Muench
Chris Muench

Reputation: 18318

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.

Upvotes: 3

Views: 2579

Answers (2)

SIFE
SIFE

Reputation: 5695

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.

Upvotes: 1

Czechnology
Czechnology

Reputation: 14992

PHP CLI vs. PHP CGI

max_execution_time: CLI default is 0 (unlimited)

(for the record: CLI - command line interface)

Upvotes: 7

Related Questions