Stop executing a PHP script

I have php_mod and apache server. If I run the script from the browser, it will be saved until completion (even if I close the browser)

How can I stop the process?

+3
source share
4 answers

Usually, if you send the output, this does not happen: if the web server detects a shutdown, the PHP process is also stoppend (which is why we have functions such as register_shutdown_functionto make sure that something is done (unelss you, of course, encounter with a fatal error)).

, HTTP , , - , - (. ignore_user_abort ( false, , )), kludge , HTML, flush. , (PHP, , ), - 100%, . , , , , - , .

+4

, ignore_user_abort (true) script. ignore_user_abort php_value, .htaccess

+2

script ( - )

die();
-1
source

Closing the browser does not kill the running process. If you want to stop the background process, you have to kill the process.

If you use windows, you can restart apache using the Apache service manager or kill it using the task manager.

-3
source

Source: https://habr.com/ru/post/1768389/


All Articles