Go Back   CodingForums.com > :: Server side development > Apache configuration

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-12-2012, 02:25 PM   PM User | #1
MarPlo
Regular Coder

 
Join Date: Mar 2011
Posts: 145
Thanks: 0
Thanked 20 Times in 20 Posts
MarPlo is an unknown quantity at this point
Run different PHP versions on virtual hosts in apache 2.2

Hi,
How can I configure Apache 2.2 server to have PHP 5.3 in all virtual hosts, except one virtual host in which to run PHP 4.4? I have all the php and .dll files.
__________________
MarPlo is offline   Reply With Quote
Old 08-12-2012, 03:40 PM   PM User | #2
MarPlo
Regular Coder

 
Join Date: Mar 2011
Posts: 145
Thanks: 0
Thanked 20 Times in 20 Posts
MarPlo is an unknown quantity at this point
If it is useful for someone, I found this example on the net:
Code:
# 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>
__________________
MarPlo is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:25 AM.


Advertisement
Log in to turn off these ads.