|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-06-15 11:46 UTC] derick@php.net
[2008-06-15 16:05 UTC] jdm at visi dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Dec 29 03:00:01 2025 UTC |
Description: ------------ Calling set_time_limit appears to not function as it is documented. Per the documentation: When called, set_time_limit() restarts the timeout counter from zero. In other words, if the timeout is the default 30 seconds, and 25 seconds into script execution a call such as set_time_limit(20) is made, the script will run for a total of 45 seconds before timing out. According to my test code, it is actually affecting the ini value of max_execution_time. As a result if the time limit is a smaller value, max_execution_time is altered to a smaller value, and script execution time can be cut short. I tracked this result down through drupal with the gallery2 integration module included where it makes calls to set_time_limit(30), which causes the module administration page to be cut short, even though my max_execution_time is defined to be 300 seconds. In my environment, the included code produces the following output: 300 30 Reproduce code: --------------- print '<p>'.ini_get('max_execution_time').'</p>'; set_time_limit(30); print '<p>'.ini_get('max_execution_time').'</p>'; Expected result: ---------------- I would expect the max_execution_time to either not change or be extended by the amount set in set_time_limit, according to the documented operation of it. i.e., the resulting code should produce either: 300 300 or: 300 330 Actual result: -------------- The resulting code produces this output: 300 30