1

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

2
  • this problem is only for opera? Commented Mar 15, 2011 at 12:03
  • no .. i even tried in mozilla.. same problem.. Commented Mar 15, 2011 at 12:07

2 Answers 2

1

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
Sign up to request clarification or add additional context in comments.

2 Comments

u mean permission to the script file?? i have given 777 for that directory and to the script file. If its not what ur saying please let me know hoe to do it.
@su03: Setting 777 when it's not necessary opens up big security holes.
1

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.