Php code exec ("kill $ pid", $ op, $ returns) cannot kill processes on linux virtual machines

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.