php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #48949 max_execution_time from php.ini ignored
Submitted: 2009-07-16 22:17 UTC Modified: 2009-07-21 12:56 UTC
From: giunta dot gaetano at gmail dot com Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 5.3.0 OS: vista sp2
Private report: No CVE-ID: None
 [2009-07-16 22:17 UTC] giunta dot gaetano at gmail dot com
Description:
------------
On windows vista, with apache 2.2.11, php 5.3.0 vc9 threadsafe, the max_execution_time ini parameter is read correctly (as shown by ini_get() and phpinfo()) but never used.
After 60 secs, the script times out with the message
"Fatal error: Maximum execution time of 60 seconds exceeded".

Adding a set_time_limit() or ini_set() call solves the problem.




Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-07-16 22:24 UTC] pajoye@php.net
And what's the value set in php.ini?
 [2009-07-17 07:32 UTC] giunta dot gaetano at gmail dot com
max_execution_time=300 in php.ini (using apache sapi btw)
 [2009-07-17 12:41 UTC] jani@php.net
Your php.ini isn't loaded. Use phpinfo() output to figure out which one is actually used. No bug here.
 [2009-07-17 12:52 UTC] giunta dot gaetano at gmail dot com
Thanks for the tip, but I would not have opened the issue without checking first phpinfo().
As stated in the initial report, even ini_get('max_execution_time') reports the value of 300
 [2009-07-17 12:56 UTC] giunta dot gaetano at gmail dot com
here's the script to reproduce the test:
<pre>
<?php

echo 'timeout: '.ini_get('max_execution_time')."\n";
for ($i = 0; $i < 100; $i++)
{
  echo $i.'. ';
  sleep(1);
  flush();
  ob_flush();
}
?>
and here follows the output:

timeout: 300
0. 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. 41. 42. 43. 44. 45. 46. 47. 48. 49. 50. 51. 52. 53. 54. 55. 56. 57. 58. 59. 

Fatal error:  Maximum execution time of 60 seconds exceeded in D:\htdocs\y.php on line 9
 [2009-07-21 12:56 UTC] giunta dot gaetano at gmail dot com
ps: tested with the vc6 executable instead of the vc9 and it still stops at 60 secs...)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 23:01:29 2024 UTC