--- Phill Sparks <[EMAIL PROTECTED]> wrote:

> On Thu, May 29, 2008 at 10:46 AM, Yuhdi Pangestu <[EMAIL PROTECTED]> wrote:
> > can we excute reconfigure/restart squid proxy svr by php ?
> > i was try using shell_exec() can't working.
> >
> 
> PHP probably does not have the permissions to restart or even start
> the squid service.  Sadly I'm not sure where to look to find out but I
> would just say NEVER run php as root! :-)
> 
> Phill

I second the notion of running as root.  Of course, it would normally be
Apache's user that the PHP scripts run as.

I would imagine that some of the web administration tools (CPANEL, Webmin, etc)
have ways around this.  That is, the PHP runs as a non-privileged user and can
start programs which normally require root access.  This is most likely
achieved by some sort of SUID (set user ID) which means that the program runs
as the owner of the program rather than the user which launched the program. 
SUID programs can be very dangerous--hackers love them, especially amateur ones
which are not though out very carefully.

Normally something like Squid (web caching) should be running at server boot
anyways.  Are you the admin of this server?  If not, have you communicated your
desire with the admin?

James

Reply via email to