note 50777 added to function.shell-exec
| From: | Kenneth at osu1 dot php dot net | Date: | Wed, 09 Mar 2005 17:19:53 +0000 |
| Subject: | note 50777 added to function.shell-exec | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-86161@lists.php.net to get a copy of this message | ||
Sometimes it's needed to be able to execute shell commands as root using PHP. For instance,
restarting named after adding or changing zones, or adding new alliases for sendmail.
My approach is to run a server called Nanoweb, available from http://nanoweb.si.kz/. It's a webserver written in PHP, and
needs only the pcntl extension extra to operate. Nanoweb is configured to only listen for
connections on localhost, port 81 for example. From my normal PHP scripts running inside Apache I
simply call scripts in Nanoweb to get the messy 'root' tasks done. Much more secure and
safer.
Hope this helps
----
Manual Page -- http://www.php.net/manual/en/function.shell-exec.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+50777
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+50777&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+50777&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+50777&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+50777&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+50777&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+50777&report=yes
Search -- http://master.php.net/manage/user-notes.php