Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm having this problem in PHP using exec():

sh: CutyCapt: Permission denied

So, how do I give permission to the apache user or www-data user to execute CutyCapt?

share|improve this question

Use chmod to add execute permission:

chmod +x /path_to_CutyCapt
share|improve this answer

Every time you want to execute a script you should add excecute permission:

chmod +x /path/name/of/your/script
share|improve this answer

Unless you're using suPHP or the like, all PHP processes (scripts) are executed as the apache user.

This means any binaries you wish to execute from PHP must be executable by that user, as well.

What, exactly, does the error log say ?

share|improve this answer

You're going to need to set the user/owner to apache:apache or www-data:www-data depending on the user that Apache is running as.

Once you know what the username is for the Apache process, type:

chown <apache_user>:<apache_group> /path/to/

Once you've done that, you've changed ownership of that file to the Apache user. The next step is to make the script executable.

chmod +x /path/to/
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.