【发布时间】:2016-01-07 04:29:40
【问题描述】:
我要在 xampp 上加载多个版本的 php,并使用 ht-access 添加处理程序,所以我的一个应用程序应该使用其 htaccess 在 5.3 php 版本中运行,而另一个应用程序应该使用 5.4 php 版本。
谁能帮我解决这个问题?
谢谢 阿米特
【问题讨论】:
标签: php apache .htaccess xampp
我要在 xampp 上加载多个版本的 php,并使用 ht-access 添加处理程序,所以我的一个应用程序应该使用其 htaccess 在 5.3 php 版本中运行,而另一个应用程序应该使用 5.4 php 版本。
谁能帮我解决这个问题?
谢谢 阿米特
【问题讨论】:
标签: php apache .htaccess xampp
一种方法是使用 mod_php 设置您的 php 主版本,并通过不同端口(即 81、82、83 等)上的快速 cgi 运行所有其他版本。
【讨论】:
The best method is to change the PHP settings in
/apache/conf/extra/httpd-xampp.conf
to reflect the new version of PHP you want to use
In my case I unpacked PHP5.4 to C:\XAMPPLITE\PHP5.4 and then updated key lines in this file such as:
SetEnv PHPRC "C:\\xampplite\\php5.4"
LoadFile "C:/xampplite/php5.4/php5ts.dll"
PHPINIDir "C:/xampplite/php5.4"
You also need to ensure that the correct version of php5apache2_2.dll is installed
To ensure this I copied the new version of php5apache2_2.dll to the Apache modules directory with a unique name, and then modified the configuration to match that:
copy php5.4\php5apache2_2.dll apache\modules\php5apache2_2-5_4.dll
and in the httpd-xampp.conf file
LoadModule php5_module modules/php5apache2_2-5_4.dll
【讨论】: