Php code exec (kill $ pid, $ op, $ returns) cannot kill processes under the linux virtual machine. for example, I write the php code exec ("kill $ pid ", $ op, $ returns). after a pid is run to kill a process, "1" is always returned, which means that the execution fails and the process id remains. I have granted the maximum permission to the files that execute the kill call. I have some questions about the configuration of php. ini on the Internet, but I haven't found any comments worth your reference after a day. please give me some comments !!!!!
Reply to discussion (solution)
Is it because of the php Security mode? how can this problem be solved!
I use root to log on to linux.
Is the exec function enabled in the configuration file?
Most of them do not have permissions.
Is the exec function enabled in the configuration file?
No, it's my php code. it executes the exec function to kill a process I specified, but it doesn't work. It is okay to execute other exec functions, such as exec ('pidof/sbin/reboot', $ op, $ returns); echo $ returns; then you can get 0, it indicates that the execution is successful, but the process cannot be killed. what is the permission problem? Or where is the configuration problem?
Most of them do not have permissions.
What permissions? Which file do you want to change? What?
No permission.
Set apache permission to root.
Although I did not give the answer I want, I was inspired by the 7 th floor. I went online to find some blogs about modifying apache execution permissions, and finally solved the problem. The following blog is helpful to me: http://blog.csdn.net/lxwxiao/article/details/8513355