Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am running the version of softwares mentioned in subject. Apache was installed from standard centos repo, fastcgi was install from http://centos.karan.org/kbsingh-CentOS-Extras.repo and PHp was manually compiled and install to /usr/local/php5-fastcgi.

I keep getting 5xx Server errors when i try to visit a url such as http://vantagefx.com/affiliate/merchants/ , (and i am not using suexec btw).

vhost

<VirtualHost x.x.x:80>
    ServerAdmin webmaster@example.com
    ServerName example.com
    ServerAlias www.example.com


    DocumentRoot /var/www/html
    <Directory /var/www/html/>

            Options Indexes FollowSymLinks
            AllowOverride All


            Order allow,deny
            Allow from all

    </Directory>



    <IfModule mod_fcgid.c>
                <Directory /var/www/html/php530-files/>
                          Options +ExecCGI
                          AllowOverride All
                          AddHandler fcgid-script .php
                          FCGIWrapper /var/www/php-fcgi-scripts/php-fcgi-starter .php

                          Order allow,deny
                          Allow from all
                </Directory>
      </IfModule>

/var/www/php-fcgi-scripts/php-fcgi-starter

#!/bin/sh
export PHP_FCGI_MAX_REQUESTS=5000
export PHP_FCGI_CHILDREN=8
exec /usr/local/php5-fcgi/bin/php -c /etc/php.ini

error log

[Wed Sep 08 02:39:25 2010] [notice] mod_fcgid: process /var/www/html/php530-files/scripts/imp.php(2319) exit(communication error), terminated by calling exit(), r5
 [Wed Sep 08 02:39:30 2010] [notice] mod_fcgid: call /var/www/html/php530-files/scripts/imp.php with wrapper /var/www/php-fcgi-scripts/php-fcgi-starter
 [Wed Sep 08 02:39:31 2010] [notice] mod_fcgid: call /var/www/html/php530-files/scripts/imp.php with wrapper /var/www/php-fcgi-scripts/php-fcgi-starter
 [Wed Sep 08 02:39:32 2010] [notice] mod_fcgid: call /var/www/html/php530-files/scripts/imp.php with wrapper /var/www/php-fcgi-scripts/php-fcgi-starter
 [Wed Sep 08 02:39:33 2010] [notice] mod_fcgid: call /var/www/html/php530-files/scripts/imp.php with wrapper /var/www/php-fcgi-scripts/php-fcgi-starter
 [Wed Sep 08 02:39:33 2010] [notice] mod_fcgid: process /var/www/html/php530-files/scripts/imp.php(2340) exit(communication error), terminated by calling exit(), r5
 [Wed Sep 08 02:39:33 2010] [notice] mod_fcgid: process /var/www/html/php530-files/scripts/imp.php(2335) exit(communication error), terminated by calling exit(), r5
 [Wed Sep 08 02:39:33 2010] [notice] mod_fcgid: process /var/www/html/php530-files/scripts/imp.php(2334) exit(communication error), terminated by calling exit(), r5
 [Wed Sep 08 02:39:37 2010] [notice] mod_fcgid: process /var/www/html/php530-files/scripts/imp.php(2341) exit(communication error), terminated by calling exit(), r5
 [Wed Sep 08 02:39:42 2010] [notice] mod_fcgid: call /var/www/html/php530-files/scripts/imp.php with wrapper /var/www/php-fcgi-scripts/php-fcgi-starter
 [Wed Sep 08 02:39:43 2010] [notice] mod_fcgid: call /var/www/html/php530-files/scripts/imp.php with wrapper /var/www/php-fcgi-scripts/php-fcgi-starter
[Wed Sep 08 02:39:44 2010] [notice] mod_fcgid: call /var/www/html/php530-files/scripts/imp.php with wrapper /var/www/php-fcgi-scripts/php-fcgi-starter
[Wed Sep 08 02:39:45 2010] [notice] mod_fcgid: call /var/www/html/php530-files/scripts/imp.php with wrapper /var/www/php-fcgi-scripts/php-fcgi-starter
[Wed Sep 08 02:39:45 2010] [notice] mod_fcgid: process /var/www/html/php530-files/scripts/imp.php(2364) exit(communication error), terminated by calling exit(), r5
[Wed Sep 08 02:39:45 2010] [notice] mod_fcgid: process /var/www/html/php530-files/scripts/imp.php(2359) exit(communication error), terminated by calling exit(), r5

and:

[Wed Sep 08 09:49:05 2010] [warn] (104)Connection reset by peer: mod_fcgid: read data from fastcgi server error.
[Wed Sep 08 09:49:06 2010] [warn] (104)Connection reset by peer: mod_fcgid: read data from fastcgi server error.
[Wed Sep 08 09:49:07 2010] [warn] (104)Connection reset by peer: mod_fcgid: read data from fastcgi server error.
[Wed Sep 08 09:49:16 2010] [warn] (104)Connection reset by peer: mod_fcgid: read data from fastcgi server error.
[Wed Sep 08 09:49:17 2010] [warn] (104)Connection reset by peer: mod_fcgid: read data from fastcgi server error.
[Wed Sep 08 09:49:18 2010] [warn] (104)Connection reset by peer: mod_fcgid: read data from fastcgi server error.
[Wed Sep 08 09:49:19 2010] [warn] (104)Connection reset by peer: mod_fcgid: read data from fastcgi server error.
[Wed Sep 08 09:49:28 2010] [warn] (104)Connection reset by peer: mod_fcgid: read data from fastcgi server error.
[Wed Sep 08 09:49:29 2010] [warn] (104)Connection reset by peer: mod_fcgid: read data from fastcgi server error.
[Wed Sep 08 09:49:30 2010] [warn] (104)Connection reset by peer: mod_fcgid: read data from fastcgi server error.
[Wed Sep 08 09:49:31 2010] [warn] (104)Connection reset by peer: mod_fcgid: read data from fastcgi server error.
[Wed Sep 08 09:49:35 2010] [warn] mod_fcgid: can't apply process slot for /var/www/html/affiliate/phpinfo.php
[Wed Sep 08 09:49:40 2010] [warn] (104)Connection reset by peer: mod_fcgid: read data from fastcgi server error.
[Wed Sep 08 09:49:41 2010] [warn] (104)Connection reset by peer: mod_fcgid: read data from fastcgi server error.
[Wed Sep 08 09:49:42 2010] [warn] (104)Connection reset by peer: mod_fcgid: read data from fastcgi server error.
[Wed Sep 08 09:49:43 2010] [warn] (104)Connection reset by peer: mod_fcgid: read data from fastcgi server error.
[Wed Sep 08 09:49:52 2010] [warn] (104)Connection reset by peer: mod_fcgid: read data from fastcgi server error.
[Wed Sep 08 09:49:53 2010] [warn] (104)Connection reset by peer: mod_fcgid: read data from fastcgi server error.
[Wed Sep 08 09:49:54 2010] [warn] (104)Connection reset by peer: mod_fcgid: read data from fastcgi server error.
[Wed Sep 08 09:49:55 2010] [warn] (104)Connection reset by peer: mod_fcgid: read data from fastcgi server error.
[Wed Sep 08 09:50:05 2010] [warn] (104)Connection reset by peer: mod_fcgid: read data from fastcgi server error.

and if i manually execute the code of

/usr/local/php5-fcgi/bin/php /var/www/html/php530-files/scripts/imp.php 

it executes just fine, no errors, no warnings, no notices.

[EDIT]

PHP Processes

ps aux | grep php
apache   22494  1.5  0.0      0     0 ?        Z    08:16   0:00 [php] <defunct>
root     22500  0.0  0.0  61168   728 pts/0    S+   08:16   0:00 grep php

I also created a phpinfo.php inside php530-files dir and tried accessing that, still no luck, 503 Service Unavailable and log was:

[Wed Sep 08 08:27:45 2010] [notice] mod_fcgid: call /var/www/html/php530-files/phpinfo.php with wrapper /var/www/php-fcgi-scripts/php-fcgi-starter
[Wed Sep 08 08:27:46 2010] [notice] mod_fcgid: call /var/www/html/php530-files/phpinfo.php with wrapper /var/www/php-fcgi-scripts/php-fcgi-starter

See, this process did not terminate due to any communication error or such but i still get 5xx errors.

Permissions

[root@www php530-files]# ls -l
total 35604
drwxrwxr-x  3 apache vfx_affil     4096 Sep  8 03:41 accounts
drwxrwxr-x  4 apache vfx_affil     4096 Sep  8 03:42 affiliates
drwxrwxr-x  2 apache vfx_affil     4096 Sep  8 03:41 api
-rw-rw-r--  1 apache vfx_affil      247 Sep  8 03:41 CHANGELOG.txt
drwxrwxr-x 11 apache vfx_affil     4096 Sep  8 03:41 include
-rw-rw-r--  1 apache vfx_affil     2203 Sep  8 03:41 index.html
drwxrwxr-x  9 apache vfx_affil     4096 Sep  8 03:41 install
-rw-rw-r--  1 apache vfx_affil      185 Sep  8 03:42 INSTALL.txt
-rw-rw-r--  1 apache vfx_affil     7643 Sep  8 03:41 LICENSE.txt
drwxrwxr-x  3 apache vfx_affil     4096 Sep  8 03:41 merchants
-rw-rw-r--  1 apache vfx_affil 36340881 Sep  8 03:41 pap_4.5.19.2.zip
-rw-r--r--  1 apache vfx_affil       20 Sep  8 08:23 phpinfo.php
drwxrwxr-x 52 apache vfx_affil     4096 Sep  8 03:42 plugins
-rw-rw-r--  1 apache vfx_affil     1008 Sep  8 03:41 README.txt
drwxrwxr-x  2 apache vfx_affil     4096 Sep  8 03:41 samples_tests
drwxrwxr-x  3 apache vfx_affil     4096 Sep  8 03:50 scripts
-rw-r--r--  1 apache vfx_affil       31 Sep  8 08:27 test.php
-rw-rw-r--  1 apache vfx_affil      371 Sep  8 03:41 UPDATE.txt
[root@www affiliate]# ls -l /var/www/php-fcgi-scripts/
total 4
-rwxrwxr-x 1 apache vfx_affil 203 Sep  8 03:39 php-fcgi-starter
share|improve this question

2 Answers 2

Is /var/www/php-fcgi-scripts/php-fcgi-starter executable, and is it and the directory it's in owned by the web server user?

share|improve this answer
    
ls -l /var/www/php-fcgi-scripts/php-fcgi-starter -rwxrwxr-x 1 apache vfx_affil 203 Sep 8 03:39 /var/www/php-fcgi-scripts/php-fcgi-starter So Yes –  Shoaibi Sep 7 '10 at 22:37
    
also see:ps aux | grep php apache 22494 1.5 0.0 0 0 ? Z 08:16 0:00 [php] <defunct> root 22500 0.0 0.0 61168 728 pts/0 S+ 08:16 0:00 grep php –  Shoaibi Sep 7 '10 at 22:38
up vote 0 down vote accepted

Found it! In my case i was using wrong php binary in /var/www/php-fcgi-scripts/php-fcgi-starter, it should have been php-cgi.

Works like a charm with:

#!/bin/sh
PHP_CGI=/usr/local/php5-fcgi/bin/php-cgi
PHP_INI=/etc/php-fastcgi.ini
export PHP_FCGI_TIMEOUT=1200
export PHP_FCGI_CHILDREN=10
export PHP_FCGI_MAX_REQUESTS=1000
exec $PHP_CGI -c $PHP_INI
share|improve this answer

Your Answer

 
discard

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.