craigp
November 12th, 2008, 08:07 PM
I am using this code to call a bash script on the computer
$last_line = system('/home/www/public_html/something/scripttesting/ls', $retval);
// Printing additional info
echo '
</pre>
<hr />Last line of the output: ' . $last_line . '
<hr />Return value: ' . $retval;
and it works for simple things like ls
However when i start to do things like mkdir it doesnt work due to permission issues. I understand that this is because it is being ran from the user www-data but how can i get that command to run as sudo?
Cheers
$last_line = system('/home/www/public_html/something/scripttesting/ls', $retval);
// Printing additional info
echo '
</pre>
<hr />Last line of the output: ' . $last_line . '
<hr />Return value: ' . $retval;
and it works for simple things like ls
However when i start to do things like mkdir it doesnt work due to permission issues. I understand that this is because it is being ran from the user www-data but how can i get that command to run as sudo?
Cheers