Re: A question about max_execution_time

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 4/10/06, Ray Hauge <ray.hauge@xxxxxxxxxxxxxxxxxxxxxxx> wrote:
>
> On Monday 10 April 2006 11:30, Eric Butera wrote:
> > Dear List,
> >
> > I have been working with a PHP script that curls a file from another
> > server.  This works fine on my local machine, but not on our live
> server.
> > The script takes about 400 seconds to execute completely.  I was under
> the
> > impression that my call to set_time_limit(900); was helping.  Well, I
> took
> > that line out and nothing changed locally or on the server.  In fact I
> even
> > tried this little test:
> >
> > <?php
> > // header include for my config (to get Util)
> > error_reporting(E_ALL);
> > echo '<br>max execution time: '. ini_get('max_execution_time');
> > sleep(40);
> > echo "<br>done!";
> > echo "<br><br>Script Executed Time: ". Util::displayMicroTime(
> > $_SCRIPT_START_TIME, Util::getMicroTime() );
> > die('<br>'.__FILE__.__LINE__);
> > ?>
> >
> >
> > Outputs:
> > max execution time: 30
> > done!
> >
> > Script Executed Time: 40.01
> > /Users/eric/Sites/test/member_get_update.php26
> >
> >
> > Now why did this work?  Shouldn't the script have timed out after 30
> > seconds?
> >
> > Thanks in advance!
> >
> > Eric
>
> The information in set_time_limit() might help:
>
> http://us3.php.net/set_time_limit
>
> "Note:  The set_time_limit() function and the configuration directive
> max_execution_time only affect the execution time of the script itself.
> Any
> time spent on activity that happens outside the execution of the script
> such
> as system calls using system(), stream operations, database queries, etc.
> is
> not included when determining the maximum time that the script has been
> running."
>
> HTH
>
> --
> Ray Hauge
> Programmer/Systems Administrator
> American Student Loan Services
> www.americanstudentloan.com
> 1.800.575.1099
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php




Ray,

Thank you for your response.  I did read that in the manual, I promise.
That is why I included the sleep function in my example.  Shouldn't the
sleep function count as execution time?  One thing I didn't metion earlier,
for the sake of simplicity, is that my script is pulling an XML file.  After
I get the XML file I parse through it which also takes time too.  The
recordset is about 6 thousand records so it does take a while.

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux