:D
Impossible to find what I want by searching hours on google.
By any chance, does anyone know how to set up multiple PHP versions on a Windows install with Apache 2.4 on it and how to choose version on vhosts ?
Thanks !
Okay so I figured out the problem !
In my Apache httpd.conf
LoadModule fcgid_module /server/Apache-2.4/modules/mod_fcgid.so
<IfModule fcgid_module>
FcgidInitialEnv PATH "C:/server/php-5.6-nts/php.ini;C:/WINDOWS/system32;C:/WINDOWS;C:/WINDOWS/System32/Wbem;"
FcgidInitialEnv SystemRoot "C:\Windows"
FcgidInitialEnv SystemDrive "C:"
FcgidInitialEnv TEMP "C:\Windows\Temp"
FcgidInitialEnv TMP "C:\Windows\Temp"
FcgidInitialEnv windir "C:\WINDOWS"
FcgidIOTimeout 1200
FcgidConnectTimeout 1200
FcgidBusyScanInterval 1200
FcgidBusyTimeout 1200
FcgidErrorScanInterval 1200
FcgidIdleScanInterval 1200
FcgidIdleTimeout 1200
FcgidProcessLifeTime 3600
FcgidZombieScanInterval 1200
# Location php.ini:
FcgidInitialEnv PHPRC "C:/server/php-5.6-nts"
FcgidInitialEnv PHP_FCGI_MAX_REQUESTS 1000
<Files ~ "\.php$">
Options Indexes FollowSymLinks ExecCGI
AddHandler fcgid-script .php
FcgidWrapper "C:/server/php-5.6-nts/php-cgi.exe" .php
</Files>
</IfModule>
<IfModule mime_module>
AddType application/x-httpd-php .phps
AddType application/x-httpd-php .php3
</IfModule>
Then in my vhost config :
<VirtualHost *>
ServerName xxx.xxx
DocumentRoot "C:/www/xxx"
AddHandler fcgid-script .php
FcgidInitialEnv PHPRC "/server/php-5.2-nts"
<Directory "C:/www/xxx">
AllowOverride All
order allow,deny
allow from all
deny from none
Require all granted
<Files ~ "\.php$">
AddHandler fcgid-script .php
FcgidWrapper "/server/php-5.2-nts/php-cgi.exe" .php
Options +ExecCGI
order allow,deny
allow from all
deny from none
Require all granted
</Files>
</Directory>
</VirtualHost>
Now I can declare whatever PHP version I want !
It is possible to do that. You should use PHP as an Apache module, and in each vhost configuration, you can define which PHP version to use.
You can find out more here or you could also check out this site for a detailed answer.