Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Script stops running during while()
- Damien Renwick
April 3, 2005, 2:54 am
rate this thread
I have a php script which simply stops midway through a while loop
that processes records returned by a MySQL query. The HTML page
continues trying to load the page but the php has stopped running and
eventually I get a timeout. The script is running in my development
environment which consists of php 4.3.4, Apache 1.3.28 and MySQL
4.0.17, installed on Windows XP with Service Pack 2.
I suspect that there may be a problem with my installation
configuration for a number of reasons:
- I have a new PC and had to re-install php, Apache and MySQL
- The script executed perfectly on my old PC (which I no longer have)
using the same versions of php etc.
- The script executes perfectly in my production environment (which is
running on a Linux server using Apache and MySQL)
- The PC I am using is a work laptop which has been secured down to
the max. I previously had local administrator rights but these have
been recently removed but I can't see how this would just stop the
I cannot find anything in the Apache error log and there is nothing in
the MySQL *.err file. I have tried increasing the value of
memory_limit in my php.ini file but to no avail. I have inserted some
tracing into the function to report where the script gets to and have
found that the script keeps failing around the same record - sometimes
it fails a couple of records before or a couple of records after.
I am now stumped for ideas.
Someone please help.......
Re: Script stops running during while()
Damien Renwick wrote:
I believe the default time limit for PHP scripts is 30 seconds. You can
change that at runtime with set_time_limit(number of seconds), where
set_time_limit(0) means no limit.
By the way, you're not the local administrator of your own development
machine? I don't envy you, I can't imagine having to work like that.
Real e-mail address unavailable. 5000+ spams per month.