I have a problem on a page "php scripts continues to become defunct", and appears to be the page1.php script. Parent process is terminated while child is not being terminate. I am using shell_exec function to run linux commands.
shell_exec("killall -9 httpd");
shell_exec("killall -9 mysqld");
shell_exec("service httpd restart");
shell_exec("service mysqld restart");
is this code right? 2-3K people use this file at a time. Please guide me?
|
| |||
|
feedback
|
|
For killall and service to work the php-script need to execute as root, or some other user with appropriate permissions. Is this a standard alone shell script or a web page? A kill -9 should be avoided because the application may lose data, for example, mysql may not have time to save everything to permanent storage before the process is killed. Kill -9 is a convenient command for these special cases but I do not recommend to use this as a part of a script. | |||||||
feedback
|