note 59698 added to function.exec
| From: | rassehund at gmail dot com | Date: | Tue, 13 Dec 2005 20:34:45 +0000 |
| Subject: | note 59698 added to function.exec | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-100084@lists.php.net to get a copy of this message | ||
I spent quite a lot time fixing problem of invoking scripts in Linux remotly. In the beginning I
thought that it was a problem of exec() function, than I thought that something wrong in Apache
server, cos through the web server you are NOBODY and have no rights to invoke scripts in Linux.
so for example in my php script I had such line :
exec ('pathToScript/script.sh &');
If to start my php script with such line in the linux shell like : php myphp.php everything is
perfect. But if to do the same through the server than problem occurs.
I solved this problems with sudoers file in Linux. U needn't change anything in Apache or in
php script. Just find sudoers in your system and add there rights to NOBODY.
----
Manual Page -- http://www.php.net/manual/en/function.exec.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+59698
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+59698&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+59698&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+59698&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+59698&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+59698&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+59698&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+59698&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+59698&report=yes
Search -- http://master.php.net/manage/user-notes.php