Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

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 currently have a setup which runs Apache2 + FastCGI PHP + Suexec.

As an example, I'm using /mnt/data/www/vhosts/inflex.co.uk/htdocs as a DocRoot for one of my virtual hosts.

I have a script /mnt/data/www/php5-cgi/inflex.co.uk/php5-cgi which contains:

    exec /usr/bin/php5-cgi

The account the scripts should run under is duncan, this file is owned by duncan and also in the group duncan. It has -rwxr-x--- permissions.

.../www/vhosts/inflex.co.uk and ../inflex.co.uk/htdocs is owned by duncan and in the group duncan.

If I remove all access for others, such as chmod 750, I get an error regarding permissions when trying to access the website, if I allow read/write for others, 755 say, it works.

I'm assuming this is an issue with www-data (apache2 user) accessing the directory, but I thought the point of Suexec was that all of this was ran under a seperate user, or does www-data require read (maybe write?) on the folder and then executes PHP php file as the user?

share|improve this question
Ok, had another look with a fresh pair of eyes, turns out you need to have o+x so that the directories can be tranversed by others. – dunks Apr 9 '12 at 12:21
But it seems that files still need to be readable by others (or www-data) – dunks Apr 9 '12 at 12:25

Your Answer


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

Browse other questions tagged or ask your own question.