PHP code exec ("Kill $pid", $op, $returns) cannot kill a process under a Linux virtual machine

Source: Internet
Author: User
Title, I write PHP code under Linux exec ("Kill $pid", $op, $returns), through the PID kill process, after execution, the return is always "1", that is, the execution is unsuccessful, the process ID is still in after execution. The file that executed the kill call I have given the maximum permission. Online there is said to be php.ini configuration problem what, but found a day has not found any worthy of reference, ask the great God to give some advice AH!!!!!


Reply to discussion (solution)

is not the security of the PHP model what ah, how to do AH!

My Linux is logged on with root.

Configuration file, did you open the EXEC function?

Most of them don't have permission.

Configuration file, did you open the EXEC function?


No, I wrote the PHP code, which executes the EXEC function to kill a process I specified, but it didn't work. The EXEC function does nothing else, such as exec (' Pidof/sbin/reboot ', $op, $returns); Echo $returns; You can get 0, which means the execution is successful, but it's not going to kill the process, right? Or where is the configuration problem?

Most of them don't have permission.


What authority? Which file do you want to change? What kind of stuff?

No permissions.
Set Apache permissions to root and see.

Although I did not give the answer I want, but the 7 floor gave me a lot of inspiration, I went to the internet to find some changes on the Apache Executive Rights blog, and finally successfully solved the problem. The following blog that 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.