look for "sudo" (super-user-doer)
use than a construct like this:
<?PHP
...
exec("sudo a_shell_command");
...
?>
if you want, you can even execute a php-script
exec("sudo /path_to_php_bin/php /path_to_script/script.php");
further details in the docs of sudo