httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From JvR O <>
Subject [users@httpd] mod_fcgid working via cli but fails with the browser
Date Tue, 10 Sep 2013 16:48:42 GMT
I'm trying to execute different versions of PHP for different VirtualHosts

The default version of PHP is 5.3.3

I have installed a php v5.4.18 at /var/www/vhosts/ the project
I have installed mod_fcgid to use it for new virtual hosts.

I'm testing with a phpinfo() file to get the php version used and see if
php is executed via FastCGI in the new virtual host.

There is a problem to execute the file in the browser correctly.
The phpinfo.php file is not being executed the response is 500 status code
(Internal Server Error)

The error_log:
[Tue Sep 10 18:48:29 2013] [warn] [client] (104)Connection
reset by peer: mod_fcgid: error reading data from FastCGI server
[Tue Sep 10 18:48:29 2013] [error] [client] Premature end of
script headers: phpinfo.php

I can execute the phpinfo.php file via CLI with
/var/www/vhosts/ /var/www/vhosts/ > /var/www/vhosts/

At the txt file
X-Powered-By: PHP/5.4.18
<tr><td class="e">Server API </td><td class="v">CGI/FastCGI </td></tr>

Then is correct, when is executed via CLI.

This /var/www/vhosts/ directory is not in the
PATH but if I add to the $PATH.
Which will be executed?
If there is another script with the same name php-cgi at /usr/bin which is
already in the $PATH

The configuration:


     ServerName   ""
     ServerAlias  ""
     ServerAdmin  ""
     DocumentRoot /var/www/vhosts/

    ErrorLog  "/var/www/vhosts/"

<Directory /var/www/vhosts/>

         AddHandler fcgid-script .php
         Options +ExecCGI
         FcgidWrapper /var/www/vhosts/ .php
         Order allow,deny
         Allow from all

    php_admin_value open_basedir ".:/var/www/vhosts/
    php_admin_value include_path ".:/usr/share/pear"


<Directory "/var/www/vhosts/">

    SetHandler fcgid-script
    Options +ExecCGI

    # Customize the next two directives for your requirements.
    Order allow,deny
    Allow from all


# apache settings for virtual host
     php_value memory_limit 256M



The FCGIWrapper at /var/www/vhosts/
export PHPRC
exec $PHP_CGI

I have used this commands for the file
chmod +x php-fcgi, anyway has got 755

Why is working via CLi but is not working with the browser?

View raw message