问题描述
我正在使用xampp部署Web应用程序.它在软件包中包括PHP模块.现在,我要做的就是将默认路径更改为PHP,以便可以使用其他版本的PHP,而无需覆盖现有模块.我的新PHP副本存在于桌面上.如何配置Apache以引用桌面上存在的PHP模块,而不是默认模块?
I am using xampp for deploying web apps. It includes the PHP module in a package. Now what I want to do is change the default path to PHP so that I can make use of other versions of PHP without overwriting the existing module. My new copy of PHP exists on the desktop. How can I configure Apache to refer to the PHP module present on the desktop, rather than the default one?
推荐答案
- 从 http://windows.php下载所需版本的PHP线程安全二进制文件(压缩). .net/download/.
- 将下载的PHP版本解压缩到一个单独的目录中.请确保您的新php目录名称不是"PHP". (例如,对于PHP 5.4使用
php54
) - 将新的PHP目录复制到您的XAMPP目录中. (请勿覆盖现有的
php
目录!) - 现在转到您的xampp/apache/conf/extra目录.进行备份,然后打开
httpd-xampp.conf
文件. -
更改以下变量/指令:
- Download your desired version of the PHP thread-safe binary (zipped) from http://windows.php.net/download/.
- Unzip the downloaded version of the PHP in a separate directory. Please make sure that your new php directory's name is not "PHP". (For example, use
php54
for PHP 5.4) - Copy the new PHP directory into your XAMPP directory. (DO NOT overwrite your existing
php
directory!) - Now go to your xampp/apache/conf/extra directory. Make a backup of, then open the
httpd-xampp.conf
file. Change the following variables/directives:
PHPINIDir
为[your xampp folder]/[new version of PHP]
LoadModule
为[your xampp folder]/[new version of PHP]/php5apache2_2.dll
保存httpd-xampp.conf
文件.重新启动XAMPP apache服务器.如果服务器成功重新启动,则服务器的PHP版本已升级.您可以使用URL [localhost][:port]/xampp/phpinfo.php
来检查PHP版本的状态.
Save the httpd-xampp.conf
file. Restart your XAMPP apache server. If your server get restarted successfully, then your server's PHP version was upgraded. You can check the status of your PHP version by using the URL [localhost][:port]/xampp/phpinfo.php
.
如果仍然有问题,请尝试以下操作:
If you are still having issues, try this as well:
将LoadFile "[xammp folder]/php/php5ts.dll"
指令更改为LoadFile "[xampp folder]/php54/php5ts.dll"
来源: http://www.techflirt.com/如何升级xampp中的php/
这篇关于如何在XAMPP中更改PHP的默认路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!