Centos exec and system command

Asked

Viewed 72 times

0

Guys, I try to run a Kill, killall -9 to kill process with PHP and it doesn’t work, do I have to enable something inside php ? Simplest commands like whoami picks up... NOTE: I’m using Centos and Ubuntu.

<?php exec("killall -9 2119"); ?>
  • I believe the problem lies in the fact that kill-all needs privileges of superuser.

  • Otávio, in the case there when I soon in the centos, I already in the account as root, has something to do to give some permission to execute these commands ?

  • In this case then it should work. Is there any error message?

  • In php no, strange basic commands take ..

  • How are you running this script? Command line? Ususário root?

  • every time he enters the local file he should run, in the localhost/run.php house

  • 1

    If you are using apache then this page will run by the user apache who does not have enough privileges to killall.

  • If English is not a problem for you take a look here: http://stackoverflow.com/questions/20580886/run-killall-command-in-php-shell-exec-function

  • I’ll take a look anyway very much Thank you Octavian!

Show 4 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.