The phrase "maximum execution time" is ambiguous: it could mean (a) the elapsed time since the script started, or (b) the total cputime taken by the script (including or excluding the cputime taken by operating system calls).
The very interesting post by kuba here Real max_execution_time for PHP on linux , finds that this depends upon whether PHP is running on Unix or Windows. In essence he finds that on Unix it is (b) and on Windows or Cygwin it is (a).
But, my server is Linux 2.6.32-358.18.1.el6.x86_64 #1 SMP x86_64 x86_64 x86_64 GNU/Linux, and I have a cron job that gets zapped after exactly 30 seconds elapsed time, despite its cpu time being less than 16 seconds:
[Tuesday, 10-Dec-2013 10:22:33 GMT] Begin, cputime=0 secs.
[Tuesday, 10-Dec-2013 10:22:58 GMT] starting zip_close, cputime=10.12946 secs.
[10-Dec-2013 10:23:03 UTC] PHP Fatal error: Maximum execution time of 30 seconds exceeded in xxx.php on line 149
This contradicts kuba's finding. Mine is PHP 5.3.26 and IU'm measuring cpu time with:
function cputime() {
$data = getrusage();
return $data['ru_utime.tv_sec'] + $data['ru_utime.tv_usec'] / 1000000;
Can anyone clarify further?