suPHP -couldn't create child process error

Discussion in 'HOWTO-Related Questions' started by tipsy, Jul 21, 2006.

  1. tipsy

    tipsy New Member

    hi,

    i was trying to follow the "How To Set Up suPHP With PHP4 And PHP5" but i ran into trouble when i tried to test my configuration :(

    i managed to install the php cgi's and compiled the suPHP according to the instructions and my virtualhost config is as follows:

    Code:
    NameVirtualHost *
    <VirtualHost *>
    
      ServerName www.example.com
      ServerAdmin [email protected]
      DocumentRoot /var/www
      ErrorLog /var/log/apache2/error.log
    
      suPHP_Engine on
      suPHP_UserGroup testuser test
      AddHandler x-httpd-php .php .php3 .php4 .php5
      suPHP_AddHandler x-httpd-php
    
    </VirtualHost>
    
    
    my suphp.conf file:

    Code:
    [global]
    ;Path to logfile
    logfile=/var/log/suphp.log
    
    ;Loglevel
    loglevel=info
    
    ;User Apache is running as
    webserver_user=www-data
    
    ;Path all scripts have to be in
    docroot=/
    
    ;Path to chroot() to before executing script
    ;chroot=/mychroot
    
    ; Security options
    allow_file_group_writeable=false
    allow_file_others_writeable=false
    allow_directory_group_writeable=false
    allow_directory_others_writeable=false
    
    ;Check wheter script is within DOCUMENT_ROOT
    check_vhost_docroot=true
    
    ;Send minor error messages to browser
    errors_to_browser=false
    
    ;PATH environment variable
    env_path=/bin:/usr/bin
    
    ;Umask to set, specify in octal notation
    umask=0077
    
    ; Minimum UID
    min_uid=100
    
    ; Minimum GID
    min_gid=100
    
    
    [handlers]
    ;Handler for php-scripts
    x-httpd-php=php:/usr/bin/php4-cgi
    
    ;Handler for CGI-scripts
    x-suphp-cgi=execute:!self
    
    php installations:
    Code:
    # php5-cgi -v
    PHP 5.1.4-1.dotdeb.2 (cgi-fcgi) (built: Jun  2 2006 10:26:45)
    Copyright (c) 1997-2006 The PHP Group
    Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
    
    # php4-cgi -v
    PHP 4.3.10-16 (cgi-fcgi) (built: Aug 24 2005 20:10:22)
    Copyright (c) 1997-2004 The PHP Group
    Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
    
    now as for the error..

    i am getting a http500 on every page (even with the simple phpinfo(); ) and when i look into /var/log/apache/error.log i see these lines:

    Code:
    [Fri Jul 21 20:25:49 2006] [error] [client x.x.x.x] (2)No such file or directory: couldn't create child process: /usr/sbin/suphp for /var/www/index.php
    suphp exists in /usr/sbin

    Code:
    # /usr/sbin/suphp
    suPHP version 0.6.1
    (c) 2002-2005 Sebastian Marsching
    
    suPHP has to be called by mod_suphp to work.
    
    i have read that it is a bug (and apparently fixed according to: http://issues.apache.org/bugzilla/show_bug.cgi?id=30137 ).

    what can i do to overcome this, i thought of compiling the latest 2.0 code but then it will break the apt-get..

    thanks.
     
    Last edited: Jul 22, 2006
  2. tipsy

    tipsy New Member

    a follow up,

    i noticed in my vhost config i used suPHP_UserGroup testuser test and thought it may be the problem. so i did:

    # groupadd unpriv
    # useradd -g unpriv suphpuser

    and changed the suPHP_UserGroup to suPHP_UserGroup unpriv suphpuser


    and it is now even worse :(

    Code:
    [Sat Jul 22 15:25:35 2006] [error] [client x.x.x.x] Premature end of script headers: index.php
    [Sat Jul 22 15:25:35 2006] [error] [client x.x.x.x] SoftException in Application.cpp:291: UID of script "/var/www/index.php" is smaller than min_uid
    index.php is:
    Code:
    <?php
      phpinfo();
    ?>

    there is something terribly wrong going on here, any help is appreciated :)
     
    Last edited: Jul 22, 2006
  3. falko

    falko Super Moderator Howtoforge Staff

    Did you follow the tutorial as close as possible (please compare your setup with the one from the tutorial)? Which distribution do you use?
     
  4. tipsy

    tipsy New Member

    hi,

    i followed the guide step by step and i am using a fresh debian 3.1 installation.
    just to ensure i did not skip a step, i tried it twice, and i restored the harddisk to the fresh state after i failed first time :(
     
  5. falko

    falko Super Moderator Howtoforge Staff

    Do the user testuser and the group test exist on your system? Please check /etc/passwd and /etc/group.
     
  6. tipsy

    tipsy New Member

    hi falko,

    i noticed the user test and the group testuser did not exist after my first post so in my follow-up message i did:

    and it still did not solve it.


    thanks for your help, it's much appreciated :)
     
  7. falko

    falko Super Moderator Howtoforge Staff

    What does your vhost configuration look like now? Which error message do you get?
     
  8. tipsy

    tipsy New Member

    hi,

    the vhost config is:
    Code:
    NameVirtualHost *
    <VirtualHost *>
    
      ServerName www.example.com
      ServerAdmin [email protected]
      DocumentRoot /var/www
      ErrorLog /var/log/apache2/error.log
    
      suPHP_Engine on
      suPHP_UserGroup unpriv suphpuser
      AddHandler x-httpd-php .php .php3 .php4 .php5
      suPHP_AddHandler x-httpd-php
    
    </VirtualHost>
    
    the error message is:
    Code:
    [Wed Jul 26 04:13:58 2006] [error] [client x.x.x.x] SoftException in Application.cpp:291: UID of script "/var/www/index.php" is smaller than min_uid
    
    the usergroup 'unpriv' and user 'suphpuser' exist.


    thanks for your help.
     
  9. falko

    falko Super Moderator Howtoforge Staff

    It must be
    Code:
    suPHP_UserGroup suphpuser unpriv
    instead. You mixed up the user and group.
     
  10. tipsy

    tipsy New Member

    well, i gave up. it does not work :(


    thanks for your help anyway. i will probably use one of your other howtos to set up a web server.
    regards.
     
  11. swan

    swan New Member

    check /etc/suphp/suphp.conf and increase the user/group ids to 10000 (if thats where you web*_usernames start from) suPHP_UserGroup directive doesnt seem to work and has to be commented out in /root/ispconfig/scripts/lib/config.lib.php
     

Share This Page