Jump to content

Run different PHP versions on virtual hosts in apache 2.2


MarPlo

Recommended Posts

If it is useful for someone, I found this example on the net:

# Port-based virtual hosting: every php install uses a vhost on a different port
Listen 8447
Listen 8423

### BASE virtualhost
### set up the main php version we're using
<VirtualHost *:80>
    LoadModule php5_module "E:/php5/php5apache2_2.dll"
    PHPIniDir "E:/php5"
    php_value extension_dir "E:/php5/ext/"
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php-source .phps
</VirtualHost>

<VirtualHost *:8447>
    # it would be handy to use php_value directives, but CGI versions of php will not grok them,
    # so we rely on different php.ini
    SetEnv PHPRC "E:/php4/"
    ScriptAlias /php447/ "E:/php4/"
    Action application/x-httpd-php447 "/php447/php.exe"
    AddType application/x-httpd-php447 .php .inc
    # apache 2.2 denies access to the php cgi executable, unless it is explicitly granted
    <Directory "E:/php4/">
      <Files "php.exe">
        Allow from all
      </Files>
    </Directory>
</VirtualHost>

<VirtualHost *:8423>
    SetEnv PHPRC "E:/php423/"
    ScriptAlias /php423/ "E:/php423/"
    Action application/x-httpd-php423 "/php423/php.exe"
    AddType application/x-httpd-php423 .php .inc
    <Directory "E:/php423/">
      <Files "php.exe">
        Allow from all
      </Files>
    </Directory>
</VirtualHost>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.