PDA

View Full Version : suPHP -couldn't create child process error


tipsy
21st July 2006, 16:26
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:


NameVirtualHost *
<VirtualHost *>

ServerName www.example.com
ServerAdmin webmaster@example.com
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:


[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:

# 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:

[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

# /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.

tipsy
22nd July 2006, 11:20
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 :(

[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:
<?php
phpinfo();
?>


there is something terribly wrong going on here, any help is appreciated :)

falko
22nd July 2006, 17:22
Did you follow the tutorial as close as possible (please compare your setup with the one from the tutorial)? Which distribution do you use?

tipsy
22nd July 2006, 23:11
Did you follow the tutorial as close as possible (please compare your setup with the one from the tutorial)? Which distribution do you use?

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 :(

falko
23rd July 2006, 23:55
Do the user testuser and the group test exist on your system? Please check /etc/passwd and /etc/group.

tipsy
24th July 2006, 11:55
Do the user testuser and the group test exist on your system? Please check /etc/passwd and /etc/group.

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:


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 still did not solve it.


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

falko
25th July 2006, 14:37
What does your vhost configuration look like now? Which error message do you get?

tipsy
26th July 2006, 00:07
What does your vhost configuration look like now? Which error message do you get?

hi,

the vhost config is:
NameVirtualHost *
<VirtualHost *>

ServerName www.example.com
ServerAdmin webmaster@example.com
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:
[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.

falko
26th July 2006, 11:42
hi,

the vhost config is:

suPHP_UserGroup unpriv suphpuser



It must be
suPHP_UserGroup suphpuser unprivinstead. You mixed up the user and group.

tipsy
30th July 2006, 15:11
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.

swan
26th November 2007, 01:56
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