I can not kill a process in a PHP script on Ubuntu

I run the shell on the command line after 1 hour. I want to use a PHP script to stop it. I knew its $ pid 2000 with getmypid ();

I used a PHP script like: exec("kill 2000");exec("kill -KILL 2000"); exec("kill -9 2000"); posix_kill(2000,9);but could not kill it.

If in the terminal I just use ~$ kill 2000. But can not with PHP script.

+3
source share
2 answers

If you use PHP with safe mode, you will need to change safe_mode_exec_dir to enable the dir of the kill binaries, you will also have to use "su -c" to kill processes that do not belong to you. It also depends on whether exec () is in the disabled_functions list in php.ini.

+2
source

php.ini. . .

0

All Articles