SteveLeg
SteveLeg

Reputation: 89

Two versions of PHP on Apache (Windows) based on directory

I would like to run two versions of PHP (5.3 and 5.6) under Apache on a Windows Server.

The problem is the directory tree.

My tree is www_root/ -->Dir1 -->Dir2

www_root and Dir1 are on the same vhost (www.domain.com and www.domain.com/Dir1)

How can I run PHP 5.6 on the "www_root" directory, PHP 5.6 on the "www_root/Dir1" and PHP 5.3 on the "www_root/Dir2" ?

Upvotes: 2

Views: 1689

Answers (1)

Pedro Lobito
Pedro Lobito

Reputation: 99011

Use htaccess with AddHandler.
Create a .htaccess file on both folders and add the following according to the php version you want to use.

AddHandler application/x-httpd-php56 .php

AddHandler application/x-httpd-php53 .php

You may also want to read Apache, MySQL, PHP server on Windows with multiple, simultaneous PHP versions

Upvotes: 4

Related Questions