how do I exectute shell commands from a php script?
Posted: Tue Apr 25, 2006 8:21 pm
Im trying to execute a shell command from a php script.
the php script is in /var/www/kernel_web
#install.php
<?php
exec("sudo -u root /var/www/./test.sh");
?>
commands like ls works but anything with a sudo wouldnt work
i have already edited to etc/sudoers file so it wouldnt ask for password.
%admin ALL=(ALL) NOPASSWD:ALL
the error log on var/log/apache2/error.log reports that the command requires a password.
the php script is in /var/www/kernel_web
#install.php
<?php
exec("sudo -u root /var/www/./test.sh");
?>
commands like ls works but anything with a sudo wouldnt work
i have already edited to etc/sudoers file so it wouldnt ask for password.
%admin ALL=(ALL) NOPASSWD:ALL
the error log on var/log/apache2/error.log reports that the command requires a password.