What do the permissions of your cgi-bin
directory and PHP fastcgi wrapper script look like? In my experience suEXEC 403 errors are often because the owner/group of the script doesn't match the owner of the cgi-bin
directory, or the directory above it.
EDIT: OK. Not sure what's going on here... the new information confused me a bit :-) Have you tried setting LogLevel Debug
in httpd.conf, and checking to see what appears in the error_log when you try to load a PHP script in your browser?
Using suexec and suphp enforce a different type of privilege separation than the default.
The default is to separate the user's permission from the web server. That is, the user owns the files, and he has to grant the web server permission to view and change them.
The suexec/suphp model is that the webserver (when running scripts) runs under the user's account, so the website has permission to do anything that the user has permission to do. To a certain degree, this removes the separation between the user and the webserver, but in exchange it enforces a DIFFERENT separation: that is, between the website of one user and the website of a different user on the same box.
By default, PHP always runs under Apache's user account, so one website's PHP scripts can access any files that another site's PHP scripts can. Therefore, if one account on the server gets hacked, the infection can spread to the others. SuPHP prevents this.
Neither suexec nor suphp will affect the way apache serves static content. All the old rules still apply. Instead, suexec and suphp change the account under which CGI and PHP (respectively) will run. Suexec makes CGI executable run under the owner's account, while SuPHP makes PHP scripts run under the owner's account.
Suexec and SuPHP aren't necessarily better. They're just different. They won't prevent a website from being hacked (and arguably might make the site easier to hack), but they will prevent a compromise on one site from spreading to all the others. To the site administrator, this isolation is arguably more important, which is why some shared hosting systems make suexec and suphp the default.
One extremely common "gotcha" is that SuPHP checks the ownership and permissions of a script before it runs, and will return a 500 error if the permissions aren't appropriate.
In particular:
- The owner and group of the file must match the website owner (as setting in apache configuration)
- The file must not be world-writable
- The parent directory must not be world-writable
Best Answer
suExec is used to change the user under which a CGI script runs. The above notice simply tells you it is enabled. It is commonly seen as part of Apache starting for instance, when I restart apache, I get: