By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,920 Members | 1,660 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,920 IT Pros & Developers. It's quick & easy.

Script stops running during while()

P: n/a
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
script running?

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.......
Jul 17 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Damien Renwick wrote:
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
script running?

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.......


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.

JP

--
Sorry, <de*****@cauce.org> is a spam trap.
Real e-mail address unavailable. 5000+ spams per month.
Jul 17 '05 #2

P: n/a
I had the same problem and when i used set_time_limit(0), the problem was
not resolved!
It just moved away to 60 seconds. When 60 seconds passed, the connection
would be
closed, no matter what. :-( Does anyone know how to fix this?
"Jan Pieter Kunst" <de*****@cauce.org> wrote in message
news:42*********************@news.xs4all.nl...
Damien Renwick wrote:
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
script running?

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.......


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.

JP

--
Sorry, <de*****@cauce.org> is a spam trap.
Real e-mail address unavailable. 5000+ spams per month.

Jul 17 '05 #3

P: n/a
Damien Renwick wrote:
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.

<snip>
try playing with:

set_time_limt()
ignore_user_abort()
register_shutdown_function()
debug_backtrace()

HTH

C.
Jul 17 '05 #4

P: n/a
Colin McKinnon <co**************@andthis.mms3.com> wrote in message news:<d2*******************@news.demon.co.uk>...
Damien Renwick wrote:
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.

<snip>
try playing with:

set_time_limt()
ignore_user_abort()
register_shutdown_function()
debug_backtrace()

HTH

C.


Thanks for all the advice, unfortunately, nothing has helped. FYI the
script stops running after about 0.1ms, yes, almost instantaneously
after processing a hand full of records.

Still seeking advice.....
Jul 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.