How can I have a PHP script run a shell script as root?

前端 未结 7 1249
野的像风
野的像风 2021-01-15 03:54

Running Fedora 9/10, Apache 2, PHP 5...

Can I run a shell script as root, from a PHP script using exec()?

Do I just give Apache root priveleges, and then add

7条回答
  •  难免孤独
    2021-01-15 04:10

    You could consider using an ssh connection to localhost with keepair authentication to an account that has root permissions. In such a setup you won't need root access for your webserver.

提交回复
热议问题