Hi,
- Apache 2.4.52fcgi 32 & 64bit
This version integrates the Apache fcgi_module which allows to change the PHP version of each VirtualHost in order to obtain VirtualHosts with different PHP versions
Only on
https://wampserver.aviatechno.netTo use another PHP version, of course provided that this version already exists in Wampserver as an addon, simply modify the desired VirtualHost as follows:
By default, a VirtualHost created by Wampserver looks like this:
<VirtualHost *:80>
ServerName mysite
DocumentRoot "G:/www/myfolder"
<Directory "G:/www/myfolder/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride all
Require local
</Directory>
</VirtualHost>
In order for this VirtualHost to use fcgid_module and another version of PHP, we just need to add seven lines, the first of which defines the version of PHP to be used and, to avoid any error if the fcgid_module is not loaded, we will frame these seven lines with a <IfModule fcgid_module>... </IfModule> structure:
<IfModule fcgid_module>
Define FCGIPHPVERSION "7.1.33"
FcgidInitialEnv PHPRC ${PHPROOT}${FCGIPHPVERSION}
<Files ~ "\.php$">
Options +Indexes +Includes +FollowSymLinks +MultiViews +ExecCGI
AddHandler fcgid-script .php
FcgidWrapper "${PHPROOT}${FCGIPHPVERSION}/php-cgi.exe" .php
</Files>
</IfModule>
This makes the VirtualHost become:
<VirtualHost *:80>
ServerName mysite
DocumentRoot "G:/www/myfolder"
<IfModule fcgid_module>
Define FCGIPHPVERSION "7.1.33"
FcgidInitialEnv PHPRC ${PHPROOT}${FCGIPHPVERSION}
<Files ~ "\.php$">
Options +Indexes +Includes +FollowSymLinks +MultiViews +ExecCGI
AddHandler fcgid-script .php
FcgidWrapper "${PHPROOT}${FCGIPHPVERSION}/php-cgi.exe" .php
</Files>
</IfModule>
<Directory "G:/www/myfolder/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride all
Require local
</Directory>
</VirtualHost>
That's all!
Edited 3 time(s). Last edit at 01/05/2022 10:54AM by Otomatic.