, PHP . root, PHP , , .
, sudo , -.
Another sudo alternative for some systems is dbus. With the correct dbus privileges, you can send instructions to restart, for example.
dbus-send --system --print-reply --dest="org.freedesktop.Hal" /org/freedesktop/Hal/devices/computer org.freedesktop.Hal.Device.SystemPowerManagement.Shutdown
It works from the command line, and I believe dbus bindings are available for php.
Flexo source
share