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 have a Debian 6 server and I was previously using Apache with mod_php but decided to switch to using fcgi instead since Wordpress was somehow causing Apache to crash. I have the following in my site's Apache config file:

Options +ExecCGI
AddHandler fcgid-script .php
FCGIWrapper /usr/lib/cgi-bin/php5 .php

SuexecUserGroup "#1001" "#1003"

Everything works fine if I don't include the SuexecUserGroup, but it obviously then runs the script as www-data instead of the user and group above. When I include that line, I get a 500 error and the following shows up in my suexec.log file:

[2013-05-22 16:00:12]: command not in docroot (/usr/lib/cgi-bin/php5)

Everything was installed using the packages, so I don't even know where the docroot is.

Here is my suexec info:

# /usr/lib/apache2/suexec -V
 -D SUEXEC_CONFIG_DIR=/etc/apache2/suexec/
 -D AP_GID_MIN=100
 -D AP_LOG_EXEC="/var/log/apache2/suexec.log"
 -D AP_SAFE_PATH="/usr/local/bin:/usr/bin:/bin"
 -D AP_UID_MIN=100

And the permissions on my php5 file if that has anything to do with it:

# ls -l /usr/lib/cgi-bin/php5
-rwxr-xr-x 1 root root 7769160 Mar  4 08:25 /usr/lib/cgi-bin/php5
share|improve this question

The document root in the error message is the suexec document root. For security reasons, you cannot directly use any FCGIWrapper commands that are not contained within your suexec directory. By default, this is /var/www/, however when using apache2-suexec-custom, you can change this to whatever directory you want by modifying the first line in the /etc/apache2/suexec/www-data file.

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.