Aug 18, 2011
tom

Kill Process Running PHP Script on Linux

Question

How do I kill the process running php scripts on a linux box? I’m using Debian with php5.

Sometimes during development a php script will continue to interact with a 3rd party webserver even after I’ve hit stop on the browser that I was testing it in. If I accidentally write an infinite loop, then it can get pretty annoying for the 3rd party. I can stop my local webserver, but the script usually continues where it left off once I restart the local server. What can I do to stop the script until I run it again?

Answer

Setting the max_execution_time in the php.ini may be a better solution than restarting your webserver.

Related posts:

  1. how to kill a process running on remote windows machine from linux?
  2. How to break from infinite loop, caused by PHP script running as root?
  3. PHP Script Won’t Run – Apache2/MySQL Servers Running, PHP Installed – Ubuntu 10.04
  4. Correct user / permissions for running php script which writes to disk?
  5. Launching a PHP daemon from an LSB init script w/ start-stop-daemon

Leave a comment