I have a Windows server running Apache 2.4 and PHP 5.6 and I’m like to add PHP 7 to have two version on same server.
PHP 7 must be run on specific alias.
Here my error
End of script output before headers: php-cgi.exe
Here my steps:
1] I have downloaded php-7.4.15-nts-Win32-vc15-x64
2] Unzipped in D:php7_4
3] Renamed php.ini-production into php.ini
4] Enabled extension_dir = "ext"
5] Edited httpd.conf and added Include "conf/alias/*"
In alias folder i have addedd a php7_4.conf with:
#
# PHP-CGI setup
#
# Put Authorization Header back to HTTP Headers
# If you are using Apache with CGI/FastCGI, then you might get an error message about missing authorization headers.
# This is because Apache does not, by default, pass authorization headers to PHP.
SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0
# PHP Versions
ScriptAlias /php7_4/ "D:/php7_4/"
<IfModule actions_module>
Action application/x-httpd-php7_4 "/php7_4/php-cgi.exe"
</IfModule>
Alias /myalias_php7 "E:/myalias_php7"
<Directory "E:/myalias_php7">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride all
Require all granted
# Where to find php.ini
SetEnv PHPRC "D:/php7_4"
<Files "php-cgi.exe">
Require all granted
</Files>
<FilesMatch ".php$">
SetHandler application/x-httpd-php7_4
</FilesMatch>
</Directory>