Hi, I'm having a bit of trouble getting suexec to run properly.

Basically when I try execute a PHP script with SuexecUserGroup set, I get the following error:

uid: (501/uname) gid: (501/501) cmd: php-cgi
command not in docroot (/usr/bin/php-cgi)

Without SuexecUserGroup set, they work fine, but obviously aren't executed as the script's owner.

Here's one of the domain's configs:
<VirtualHost *:80>
    ServerName www.domain
    ServerAlias domain

    SuexecUserGroup uname gname

    ServerAdmin webmaster@domain
    DocumentRoot /var/www/domain/public_html

    <Directory /var/www/domain/public_html/>
        Order allow,deny
        allow from all

    ErrorLog logs/domain-error_log
    CustomLog logs/domain-access_log common
And the suexec config info

suexec -V
 -D AP_DOC_ROOT="/var/www"
 -D AP_GID_MIN=100
 -D AP_HTTPD_USER="apache"
 -D AP_LOG_EXEC="/var/log/httpd/suexec.log"
 -D AP_SAFE_PATH="/usr/local/bin:/usr/bin:/bin"
 -D AP_UID_MIN=500
 -D AP_USERDIR_SUFFIX="public_html"
Any suggestions on what I might be doing wrong? I can provide other info if needed.

For a bit of background info, the end result i'm trying to achieve is for files that get uploaded via a php script to be owned by the user account that owns the script rather than by the apache user. From what I can tell, suexec is the way to accomplish this.

I have also tried using suPHP to achieve the same goal, which has worked after a fashion, but introduced another problem. phpMyAdmin (which is installed to /usr/share/phpmyadmin so it's accessible to all domains) won't work as it isn't in the domain's document root, nor owned by the domain's user account.

phpmyadmin apache config:

<Directory "/usr/share/phpmyadmin">
  Order Deny,Allow
#  Deny from all
#  Allow from
  Allow from all

Alias /phpmyadmin /usr/share/phpmyadmin
Alias /phpMyAdmin /usr/share/phpmyadmin
Alias /mysqladmin /usr/share/phpmyadmin
Basically what I'm trying to achieve is the files upload as the domain's user, and still have phpmyadmin and other shared scripts accessible to all domains/accounts. If this is possible with suexec or suphp, great. If there's a better way, I'm open to suggestions