what i am trying to acomplish is to have a php page execute a shell command and display the output on the web page.
the code for the page is something along the lines of
<?php
echo shell_exec('ls -l /code');
?>
when i load up this page all i see is blank. yet when i execute it from the command line i see the command being executed and the output printed.
I am sure its something to do with the permissions and i am hoping someone can point me the right way.
this is what I see in the httpd log file
ls: cannot access /gateway_code: Permission denied
ls: cannot access /gateway_code: Permission denied
BTW the directory /code is set to "Read only" for the user "apache"
thanks! -ankit
sudo su apache-user -c "ls -l /code"? You need to replace apache-user with the actual user defined. – Khaled Jan 25 '11 at 6:13