Re: Start/Stop Service from program php
| From: | Micah Gersten | Date: | Sun, 27 Jul 2008 03:48:37 +0000 |
| Subject: | Re: Start/Stop Service from program php | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-277368@lists.php.net to get a copy of this message | ||
Generally, apache runs as www-data. What was the output of the command?
Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com
I need write a script execute some command, but try start or stop service
like named, network this don't work
I edit visudo and add the next lines
User_Alias MYGROUP = apache, xyz
opc@orenses.com wrote:
> Hi
>
> I try execute unsucesfull the next code from web page
>
> <?php
> $cmd1 = shell_exec ("sudo /sbin/service named stop");
> echo "$cmd1";
> ?>
>
> I need write a script execute some command, but try start or stop service
> like named, network this don't work
>
> I edit visudo and add the next lines
>
> User_Alias MYGROUP = apache, xyz
> Cmnd_Alias MYCOMMAND = /sbin/service
> %MYGROUP ALL = MYCOMMAND
> %MYGROUP ALL=(ALL) NOPASSWD: ALL
>
> But don't work.
>
> Suggest? Thanks ...
>
>