473,387 Members | 1,585 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Script stops running during while()

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
4 2863
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Eric Walker | last post by:
I am a php beginner, so apologize if this question is silly. I am encountering apparently random script stops when I try to get a remote HTML file with either file() or fopen(). A typical code...
7
by: lawrence | last post by:
Suppose I create dynamic web pages with 3 functions (which call other functions to make everything happen, but these 3 you might think of as being the top layer): registerSessions();...
1
by: bayouprophet | last post by:
Cant get menu script to to put linked page in the same frame. I am new to Java and I am wondering what am I doing wrong? below are my java applet file, frame.html file, and my text file and one...
2
by: MatthewRoberts | last post by:
Howdy All, I have a Windows Service that often stops in its tracks with no exception and no explanation on our QA system. During testing on the development machine, it can handle any workload,...
9
by: mareal | last post by:
I have noticed how the thread I created just stops running. I have added several exceptions to the thread System.Threading.SynchronizationLockException System.Threading.ThreadAbortException...
3
by: Terry Olsen | last post by:
I have a windows service that has been running fine for almost 6 months. Last week, it just stopped working. It is still in the task list and still shows "started" in the service manager. There...
5
by: This | last post by:
I have a pretty basic emailing script that sends a relatively small number (150) of html emails. The emails are compiled, personalised from a mysql db subscribers list, and sent using mail() -...
5
by: Guillermo Antonio Amaral Bastidas | last post by:
Hi everybody, I have a quick and probably dumb question, keep in mind I just dumped my old love FastCGI + Perl for it's younger hotter friend PHP5. If the user calls a time consuming script...
1
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Many websites have a form or a link you can use to download a file. You click a form button or click...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.