简体   繁体   English

Apache + Mutli PHP版本

[英]Apache + mutli php version

Apache 2.4.25 + php 5.6.30 + php 7.1.4 I did this successful, several times. Apache 2.4.25 + php 5.6.30 + php 7.1.4我多次成功地做到了这一点。 But now php 5.6.30 cannot work, only php 7.1.4 works. 但是现在php 5.6.30无法工作,只有php 7.1.4可以工作。 Too strange... 太奇怪了

httpd-vhosts.conf 的httpd-vhosts.conf

AddType application/x-httpd-php .php
ScriptAlias /php-5.6.30/ "D:/Codes/webserver/php/php-5.6.30-Win32-VC11-x64/"
ScriptAlias /php-7.1.4/ "D:/Codes/webserver/php/php-7.1.4-Win32-VC14-x64/"

<Directory "D:\Codes\webserver\php">
    Require all granted
</Directory>

<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot "D:\Codes\wwwroot\tests\php71"
    ServerName php71.local
    ErrorLog "logs/php71-error.log"
    CustomLog "logs/php71-access.log" common
    <Directory "D:\Codes\wwwroot\tests\php71">
        Action application/x-httpd-php "/php-7.1.4/php-cgi.exe"
        Options FollowSymLinks Includes ExecCGI
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot "D:\Codes\wwwroot\tests\php56"
    ServerName php56.local
    ErrorLog "logs/php56-error.log"
    CustomLog "logs/php56-access.log" common
    <Directory "D:\Codes\wwwroot\tests\php56">
        Action application/x-httpd-php "/php-5.6.30/php-cgi.exe"
        Options FollowSymLinks Includes ExecCGI
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

Both index.php 两者都是index.php

<?php phpinfo(); ?>

I did this on my pc, ok. 我在我的电脑上做到了,好的。
Then I did this on my nb, ok. 然后我在我的nb上做到了,好的。
I re-install nb's windows 10, ok. 我重新安装nb的Windows 10,确定。
Now I re-install pc's windows 10, not ok. 现在,我重新安装PC的Windows 10,不行。

The page shows 500 Internal Server Error. 该页面显示500 Internal Server Error。
error log of php56 is: php56的错误日志是:
End of script output before headers: php-cgi.exe 标头之前的脚本输出结束:php-cgi.exe

How to fix this? 如何解决这个问题?

I added everyone permission on php56 folder, not work. 我在php56文件夹上添加了所有人的权限,无法正常工作。

I found the problem. 我发现了问题。 Install: Microsoft Visual C++ 2008 SP1 Redistributable Package (x64) Visual C++ Redistributable for Visual Studio 2012 Update 4 安装:Microsoft Visual C ++ 2008 SP1可再发行组件包(x64)Visual Studio 2012 Update 4的Visual C ++可再发行组件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM