1

I'm trying to install a second version of PHP, to run alongside the current version of php. I've compiled the latest php source from github (5.5-DEV), and I'm trying to run it as CGI.

Here is my virtual host config:

<VirtualHost *:8055>
    DocumentRoot /Library/WebServer/Documents/
    ScriptAlias /cgi-bin/ /usr/local/php55/cgi

    Action php55-cgi /cgi-bin/php-cgi
    AddHandler php55-cgi .php

    <Directory /Library/WebServer/Documents/>
        Options Indexes FollowSymLinks Includes ExecCGI
        AllowOverride All
        Order Allow,Deny
        Allow from all
    </Directory>

    DirectoryIndex index.html index.php
</VirtualHost>

But when I go to http://127.0.0.1:8055/info.php, I get the following error:

Forbidden

You don't have permission to access /cgi-bin/php-cgi/info.php on this server

Edit

I'm now switching between

LoadModule php5_module        /usr/local/php54/libphp5.so

and

LoadModule php5_module        /usr/local/php55/libphp5.so

It works for now, but is not ideal. I would like to have the different versions of php on different virtual hosts

emcconville
  • 504
  • 5
  • 11
Pierre
  • 133
  • 2
  • 7

1 Answers1

0

You'll need to tell Apache how to handle the system's new /usr/local/php55 directory.

<Directory /usr/local/php55/cgi>
    Allow from all
</Directory>

You might need to add an extra "/" at the end ScriptAlias assignment, or the Action may resolve to

Action php55-cgi /usr/local/php55/cgiphp-cgi

So your vhost block would read as:

<VirtualHost *:8055>
    DocumentRoot /Library/WebServer/Documents/
    ScriptAlias /cgi-bin/ /usr/local/php55/cgi/

    Action php55-cgi /cgi-bin/php-cgi
    AddHandler php55-cgi .php

    <Directory /usr/local/php55/cgi>
        Allow from all
    </Directory>

    <Directory /Library/WebServer/Documents/>
        Options Indexes FollowSymLinks Includes ExecCGI
        AllowOverride All
        Order Allow,Deny
        Allow from all
    </Directory>

    DirectoryIndex index.html index.php
</VirtualHost>
emcconville
  • 504
  • 5
  • 11