# [SOLVED] GID of a php script is smaller..

## etouche

Hi all,

I have a little stupid issue ... but i begin in server config, it is for my personal and local use.

I have Apache 2 and php4, php5 (last version) managed by suPHP 0.7.1.

I search since a couple a days a how to about suphp settings, i cannot find it.

The solutions on the web don't help me  :Sad: 

Someone know how to fix this :

Internal Server Error

GID of script "/var/www/localhost/htdocs/phpinfo.php" is smaller than min_gid

suPHP 0.7.1

nano /etc/suphp.conf

```

[global]

;Path to logfile

logfile=/var/log/apache2/suphp_log

;Loglevel

loglevel=info

;User Apache is running as

webserver_user=apache

;Path all scripts have to be in

docroot=/var/www/

; 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=true

;PATH environment variable

env_path=/bin:/usr/bin

;Umask to set, specify in octal notation

umask=0077

; Minimum UID

min_uid=1000

; Minimum GID

min_gid=100

[handlers]

;Handler for php-scripts

x-httpd-php="php:/usr/lib/php5/bin/php-cgi"

x-httpd-php5="php:/usr/lib/php5/bin/php-cgi"

x-httpd-php4="php:/usr/lib/php4/bin/php-cgi"

x-httpd-phtml="php:/usr/lib/php5/bin/php-cgi"

;Handler for CGI-scripts

x-suphp-cgi="execute:!self"
```

```

myGentoo ~ # ls -l /var/www/localhost/htdocs/

total 16

-rw-r--r-- 1 root  root 45 Mar 18 20:37 index.html

-rw-r--r-- 1 root root 20 Jan  7  1980 phpinfo.php

-rw-r--r-- 1 root  root 20 Jan  7  1980 phpinfo.php4

-rw-r--r-- 1 root  root 20 Jan  7  1980 phpinfo.php5

```

If you need more info feel free to ask is a beta server version  :Wink: 

Thanks for your help and your time.

----------

## boerKrelis

GID of group 'root' is 0, usually. min_gid in your safety config is 100. That's your problem. You may not want to elevate to root privileges when executing that script.

----------

## etouche

Ok i agree with you.

And i make change ...

After this command :

```
 chown gen13:users /var/www/localhost/htdocs/phpinfo.php

```

Result : 

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, root@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Where can i find a good tuto about how to set a server ?   :Rolling Eyes: 

----------

## boerKrelis

 *etouche wrote:*   

> 
> 
> More information about this error may be available in the server error log. 
> 
> 

 

So, did you have a look? Gentoo has a Apache troubleshooting guide in which you may find clues.

----------

## etouche

I join the error log :

```
[Sun Mar 21 17:38:06 2010] [error] [client 192.168.1.7] terminate called after throwing an instance of 'suPHP::LookupException'

[Sun Mar 21 17:38:06 2010] [error] [client 192.168.1.7] Premature end of script headers: phpinfo.php

[Sun Mar 21 17:38:06 2010] [error] [client 192.168.1.7] File does not exist: /var/www/localhost/htdocs/favicon.ico

[Sun Mar 21 17:38:54 2010] [error] [client 192.168.1.7] terminate called after throwing an instance of 'suPHP::LookupException'

[Sun Mar 21 17:38:54 2010] [error] [client 192.168.1.7] Premature end of script headers: phpinfo.php

[Sun Mar 21 17:38:54 2010] [error] [client 192.168.1.7] File does not exist: /var/www/localhost/htdocs/favicon.ico

[Sun Mar 21 17:38:58 2010] [error] [client 192.168.1.7] terminate called after throwing an instance of 'suPHP::LookupException'

[Sun Mar 21 17:38:58 2010] [error] [client 192.168.1.7] Premature end of script headers: phpinfo.php

[Sun Mar 21 17:39:39 2010] [error] [client 192.168.1.7] File does not exist: /var/www/localhost/htdocs/favicon.ico

[Sun Mar 21 17:39:42 2010] [error] [client 192.168.1.7] terminate called after throwing an instance of 'suPHP::LookupException'

[Sun Mar 21 17:39:42 2010] [error] [client 192.168.1.7] Premature end of script headers: phpinfo.php

```

With the net2ftp tool uploaded on the server :

```

[Sun Mar 21 18:01:34 2010] [error] [client 192.168.1.7] terminate called after throwing an instance of 'suPHP::LookupException'

[Sun Mar 21 18:01:34 2010] [error] [client 192.168.1.7] Premature end of script headers: index.php

```

Here the error message :

[Sun Mar 21 18:13:25 2010] [error] [client 192.168.1.7] terminate called after throwing an instance of 'suPHP::LookupException'

[Sun Mar 21 18:13:25 2010] [error] [client 192.168.1.7] Premature end of script headers: phpinfo.php

Thanks

----------

## etouche

About

```
[Tue May 20 02:14:18 2008] [error] [client x.x.x.x] terminate called after throwing an instance of 'suPHP::LookupException'

[Tue May 20 02:14:18 2008] [error] [client x.x.x.x] Premature end of script headers: info.php

```

it was a mistake into this file " /etc/apache2/modules.d/70_mod_suphp.conf" user and group was not both apache but an error on the name.

----------

## etouche

The issue is fixed about the error :

"GID of script "/var/www/localhost/htdocs/phpinfo.php" is smaller than min_gid "

It is because the "/var/www/localhost/htdocs/" must be root:root and the content to a user:group.

 NO SOLUTION ERASE INSTALL AND TEST WITHOUT SUPHP 

----------

