473,378 Members | 1,436 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,378 software developers and data experts.

Stop PHP utterly!

Is there a way to stop the PHP cgi completely?
I made a typo and got caught in an infinite loop. Usually I can wait until
the execution time expires and fix the script but this time it kept going
and going and going!
I keep a log for error reporting and it went from 0 bytes to 8 megs until I
finally just rebooted the server! I also tried pausing/stopping the web
server. The max time for scripts is 60 seconds. I am wondering if there is a
function that pretty much just stops PHP dead in it's tracks and forces it
to reset itself or if there is a command line I can throw it to make it
stop?

Thanks,

--ScareCrowe


-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
Jul 17 '05 #1
6 8591
ScareCrowe wrote:
Is there a way to stop the PHP cgi completely?
I made a typo and got caught in an infinite loop. Usually I can wait until
the execution time expires and fix the script but this time it kept going
and going and going!
I keep a log for error reporting and it went from 0 bytes to 8 megs until I
finally just rebooted the server! I also tried pausing/stopping the web
server. The max time for scripts is 60 seconds. I am wondering if there is a
function that pretty much just stops PHP dead in it's tracks and forces it
to reset itself or if there is a command line I can throw it to make it
stop?

Thanks,

--ScareCrowe


-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----


Are you using Linux or Windows?
Jul 17 '05 #2
ScareCrowe wrote:

[...]

I am wondering if there is a
function that pretty much just stops PHP dead in it's tracks and forces it
to reset itself or if there is a command line I can throw it to make it
stop?


Linux:
$> ps
$> kill pid

Windows:
Ctrl + Alt + Del

--
The most likely way for the world to be destroyed,
most experts agree, is by accident.
That's where we come in; we're computer professionals.
We cause accidents.
--Nathaniel Borenstein
Jul 17 '05 #3
ScareCrowe wrote:
Is there a way to stop the PHP cgi completely?
I made a typo and got caught in an infinite loop. Usually I can wait until
the execution time expires and fix the script but this time it kept going
and going and going!
I keep a log for error reporting and it went from 0 bytes to 8 megs until
I finally just rebooted the server! I also tried pausing/stopping the web
server. The max time for scripts is 60 seconds. I am wondering if there is
a function that pretty much just stops PHP dead in it's tracks and forces
it to reset itself or if there is a command line I can throw it to make it
stop?


I suggest implementing something like:

if($logged_errors_total > 10)
die("Too many errors. Check error log and fix bugs.");

in your loop or error logging logic for development only.

If you don't want to do that, then you could just kill the process manually.
Use your favorite process manager on Windows/*n?x or for *n?x just type
"kill [php_process_id]" without quotes or brackets.
Jul 17 '05 #4

"Zurab Davitiani" <ag*@mindless.com> wrote in message
news:pU***************@newssvr27.news.prodigy.com. ..
I suggest implementing something like:

if($logged_errors_total > 10)
die("Too many errors. Check error log and fix bugs.");

in your loop or error logging logic for development only.

If you don't want to do that, then you could just kill the process manually. Use your favorite process manager on Windows/*n?x or for *n?x just type
"kill [php_process_id]" without quotes or brackets.


I'm using windows and I did try to kill the process with task manager, but
the php.exe was not listed!
I am still a little confused about what happened because it has always
stopped after the max time expired.
I am thinking it was a glitch because when I rebooted the server and ran the
script again it worked fine!?!

--ScareCrowe

-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
Jul 17 '05 #5
"ScareCrowe" wrote:
"Zurab Davitiani" <ag*@mindless.com> wrote in message
news:pU***************@newssvr27.news.prodigy.com. ..
I suggest implementing something like:

if($logged_errors_total > 10)
die("Too many errors. Check error log and fix bugs.");

in your loop or error logging logic for development only.

If you don’t want to do that, then you could just kill the process
manually.
Use your favorite process manager on Windows/*n?x or for *n?x

just type
"kill [php_process_id]" without quotes or brackets.


I’m using windows and I did try to kill the process with task
manager, but
the php.exe was not listed!
I am still a little confused about what happened because it has

always stopped after the max time expired.
I am thinking it was a glitch because when I rebooted the server and ran the
script again it worked fine!?!

--ScareCrowe

-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----


Are you sure you don’t have a statement in your script that disables
auto timeout. It is of the form:
set_time_limit(0);

--
http://www.dbForumz.com/ This article was posted by author's request
Articles individually checked for conformance to usenet standards
Topic URL: http://www.dbForumz.com/PHP-Stop-utterly-ftopict132773.html
Visit Topic URL to contact author (reg. req'd). Report abuse: http://www.dbForumz.com/eform.php?p=443623
Jul 17 '05 #6
ScareCrowe wrote:
I'm using windows and I did try to kill the process with task manager, but
the php.exe was not listed!


Maybe it's under one of the system services or something, if it's through
IIS. If it's Apache, it may be an Apache process. In either case, you can
easily tell by processor/memory usage; or, alternatively, use a more
comprehensive process manager.
Jul 17 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: engsol | last post by:
I'm using Python to parse a bunch of s/w test files and make csv files for later report generation by MS ACCESS....(my boss loves the quick turn-around compared to C). Each log file may contain one...
8
by: Eric Osman | last post by:
My javascript program has reason to want to stop. For example, function A has 5 lines, the second of which calls function B, which has 5 lines, the first of which calls function C. But...
5
by: Paul O. Morris | last post by:
Is there a script that I can run to stop a particular SQL server service on Win2003 server? I'm looking for a similar script to restart that service as well. Thanks.
2
by: Prasad | last post by:
Hi, I am writing a service which takes a long time to stop after the OnStop call is given by the Services Snap-in. The problem is I cannot cut down on the time that it takes to Stop. The Service...
8
by: Matt Theule | last post by:
While stepping through an ASP.NET project, I found that data was being inserted into my database even though I was not stepping through the code that inserted the data. I have a single page with...
7
by: shai | last post by:
I am working at .net 1.1, writing in c#. I have windows service with a COM object. Every unexpected time The COM object throw an error that make my service get stuck (do not respond). I can catch...
0
by: mattcfisher | last post by:
Hi, I have two windows services running together. One is the main program, and one is an "updater" wrapper for the main. The updater service starts and stops the main one (as in you should never...
24
by: =?windows-1256?B?2sfV4yDayM8gx+Hh2O3d?= | last post by:
Excuse me!! Would you stop for a moment?! O...man...Haven't you thought-one day- about yourself ? Who has made it? Have you seen a design which hasn't a designer ?! Have you seen a...
33
by: Sunny | last post by:
Hi, Sometime, when your script is too big, IE Gives you a warning "Stop Running This Script" A script on this page is causing Internet Explorer to run slowly. Does anyone knows, How to...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: 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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.