Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

4 Answers 4

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/CutyCapt.sh

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/CutyCapt.sh
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

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

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

Use chmod to add execute permission:

chmod +x /path_to_CutyCapt
share|improve this answer

Your Answer

 
discard

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.