I have symfony task call “doNothing” and i want to execute it from executing shell_exec('/var/www/esm/symfony php symfony doNothing');
by calling to my symfony action
apache error saying permission denied.
i think www-data user dont have permission how could i resolved this?
Edited
error is
sh: /var/www/esm/symfony: permission denied
You should look in the directory where your script is.
Use
ls -lato show all files in the folder and their permissions (to execute php script file must have at leastxbit assigned to www-data or its group).Also all the parent directories up to
/MUST havexbit assigned to user/group for apache to be able to change directory to.Look. You have Tree structured Files system:
/var/wwwis in/var/var/www/esmis in/var/www/var/www/esm/symfonyis in/var/www/esmSo www-data user should have the ability to Execute (
xbit) all of that directories.So when in
/executels -land look wheter/varhasxbit for www-data user or it’s group (drwxrwx—) and it owns this directory. When in/varexecutels -lan so on…You can change permissions to 777 for every directory. But DO NOT use
-Rkey. Just change permissions to the directory only.