php shell_exec() command is not working

php, python-2.7, shell

Solution

If it works well in shell, I think apache is chrooted. So php can't find /var/...

Or user of httpd user does not have permission to enter /var/...

If you are good at PHP. Open dir /var/... And readdir() and check dir exists and check file exists.

This question might help you. scanning /home/ with opendir()

Problem

I am trying to run a .sh file from php. I tried doing it with shell_exec(). but its not working I refered many questions related to this in stack overflow but could not solve my php code is(web.php) ``` <?php echo shell_exec('/var/www/project/xxe.sh'); echo "done"; ?> ``` only done is printed. but it is working from terminal(php /var/www/project/web.php) In xxe.sh I am calling a python file ``` python vin.py ``` I have also changed the file permission to 777 for both .sh n .py files please help

Original source

Related problems