|
Posted by petersprc on 03/29/07 16:16
On Mar 29, 11:59 am, "theGerm" <jrmo...@gmail.com> wrote:
> Is it possible for me to restart a service with PHP? I need to run
> this from a webpage
>
> /sbin/service squid reload
You could do somethine like:
$cmd = 'sudo /sbin/service squid reload 2>&1';
exec($cmd, $output, $exitCode);
if ($exitCode != 0) {
trigger_error("Command \"$cmd\" failed with exit code $exitCode: " .
join("\n", $output), E_USER_ERROR);
}
[Back to original message]
|