Re: [INTERNALS-WIN] bug with max_execution_time as set in php.ini with php 5.3.0
[email protected] (Gaetano Giunta)
| Newsgroups | php.internals.win |
|---|---|
| Message-ID | <[email protected]> |
Richard Quadling wrote: > 2009/7/22 Gaetano Giunta <[email protected]>: > >> Richard Quadling wrote: >> >> 2009/7/22 Gaetano Giunta <[email protected]>: >> >> >> Pierre Joye wrote: >> >> >> hi, >> >> You did not answer all questions there. I was not able to reproduce >> your problem either, the max exec time works and is based on what is >> set in php.ini. >> >> What does show phpinfo()? (Not what you set in php.ini but what it is >> actually displayed in php.ini). >> >> >> >> here's the relevant part of phpinfo(). shall i post the complete page as >> comment to the bug? >> >> mail.log /no value/ /no value/ >> max_execution_time 300 300 >> max_input_nesting_level 64 64 >> >> >> >> >> Cheers, >> >> On Wed, Jul 22, 2009 at 11:08 AM, Gaetano Giunta<[email protected]> wrote: >> >> >> >> I filed bug http://bugs.php.net/bug.php?id=48949, but it was closed as >> bogus. >> >> Since I find it strange that nobody else but me hit this problem, I >> thought >> I might ask the list of php-on-win devs... >> >> ...did anybody else find out that the max_execution_time as set in >> php.ini >> is not taken into account with php 5.3.0? >> >> thanks >> Gaetano >> >> -- >> Windows Internals Mailing List (http://www.php.net/) >> To unsubscribe, visit: http://www.php.net/unsub.ph >> >> Try removing the server from the issue. Type this at the command line ... >> >> php -d max_execution_time=10 >> <?php >> >> echo 'timeout: '.ini_get('max_execution_time')."\n"; >> for ($i = 0; $i < 100; $i++) >> { >> echo $i.'. '; >> sleep(1); >> flush(); >> ob_flush(); >> } >> ?> >> ^Z >> >> (Or how ever you want to execute a PHP script at the command line). >> >> >> >> Does not compute: running from CLI disables max_execution time anyway - >> http://www.php.net/manual/en/features.commandline.php >> Did you want me to run the cgi exec on cli? >> > > And that's why I added the -d max_execution_time=10 > > timeout: 10 > 0. 1. 2. 3. 4. 5. 6. > Fatal error: Maximum execution time of 10 seconds exceeded. > Ah right - doh! This way, it works. But if I add in my code an ini_set('max_execution_time', 10), it works in both cli and sapi mode. d:\php5\php <?php echo 'timeout: '.ini_get('max_execution_time')."\n"; // => 0 ini_set('max_execution_time', 10); echo 'timeout: '.ini_get('max_execution_time')."\n"; // => 10 flush(); @ob_flush(); for ($i = 0; $i < 100; $i++) { echo $i.'. '; sleep(1); flush(); @ob_flush(); } ?> Maybe the code paths used by ini_set and -d on the command line are the same, while the one used by the apache sapi is different?