开发者

executing a shell script from a php file

开发者 https://www.devze.com 2023-02-17 09:54 出处:网络
i have a php file from which i need to call a开发者_开发技巧 shell script which i am doing as follows:

i have a php file from which i need to call a开发者_开发技巧 shell script which i am doing as follows:

$out = exec("/root/.mozilla/firefox/score.sh 2>&1");
echo $out;

when i execute this code in opera its giving Permission denied. I have given permission to all directory and the script also.

is the problem because of that .mozilla file?? how to solve?? also tried with shell_exec().. not working


Have you given the web server user write/execute permissions?:

For example (assuming your web server user is apache belonging to group apache):

sudo chown apache:apache /root/.mozilla/firefox/score.sh
sudo chmod -R 744 /root/.mozilla/firefox/score.sh


Ensure that the webuser has permission to access all directories leading up to /root/.mozilla/firefox/. Ideally, you'd move this script someplace else than root's homedir.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号