Multiple PHP versions on apache

Discussion in 'Apache' started by Tom K, Mar 21, 2013.

  1. #1
    I have a need to run several sites on the same server.
    Some of them require an older version of PHP (5.2) and some require the newest version (or at leaset 5.4)
    I'm separating the sites on my server using the ServerName Directive.
    I've started using this guide: http://blog.servergrove.com/2011/08/22/how-to-setup-multiple-php-versions-on-apache/
    and I've been following it almost to the letter. The reason I say almost is because I need the separation to be with the ServerName and it is not included in the guide, so I added it.
    Now when I access the site I'm getting an error page with the following:
    "The requested URL /cgi-bin/php-fcgi/index.php was not found on this server."
    At the same time, the /var/log/httpd/error shows the following:
    [Thu Mar 21 12:35:30 2013] [error] [client 192.168.7.101] script not found or unable to stat: /var/www/cgi-bin/php-fcgi
    
    Code (markup):
    I'm rather new to apache and don't understand all the directives yet.
    Here is the section I've added in my /etc/httpd/conf/httpd.conf file:

    <IfModule mod_fastcgi.c>
        <VirtualHost *:80>
        SuexecUserGroup testuser1 web
        ServerName wiki.tom-vcc
        DocumentRoot /var/www/vhosts/example.com/httpdocs
            <Directory "/var/www/vhosts/example.com/httpdocs">
                    Options +ExecCGI
                    AllowOverride All
                    AddHandler php5-fastcgi .php
                    Action php5-fastcgi /cgi-bin/php-fcgi
                    DirectoryIndex index.php index.html
                    Order allow,deny
                    Allow from all
            </Directory>
      ServerSignature Off
      </VirtualHost>
    </IfModule>
    
    Code (markup):

     
    Last edited: Mar 21, 2013
    Tom K, Mar 21, 2013 IP