0

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?

JMC
  • 506
  • 6
  • 23
  • Need to know if you're using mod_php or cgi in order to tell you what to kill. – DerfK Jul 20 '11 at 19:51
  • @DerfK - Good question, what command could I run to find out? – JMC Jul 20 '11 at 20:10
  • @Derfk - php_sapi_name() returns "apache2handler". Does that help? – JMC Jul 20 '11 at 20:16
  • GATEWAY_INTERFACE = CGI/1.1 – JMC Jul 20 '11 at 20:24
  • 1
    apache2handler means you're using mod_php which is inside apache. Are you sure the server is stopping? PHP doesn't have any kind of restart ability. Either the command you're giving isn't stopping the server (and its running all the time), or as soon as it comes back up someone is hitting the page and starting the script over again. – DerfK Jul 20 '11 at 21:40

1 Answers1

2

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

Andrew Case
  • 3,489
  • 3
  • 23
  • 39