如何在XAMPP中更改PHP的默认路径

如何在XAMPP中更改PHP的默认路径

本文介绍了如何在XAMPP中更改PHP的默认路径?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用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?

推荐答案

  1. http://windows.php下载所需版本的PHP线程安全二进制文件(压缩). .net/download/.
  2. 将下载的PHP版本解压缩到一个单独的目录中.请确保您的新php目录名称不是"PHP". (例如,对于PHP 5.4使用php54)
  3. 将新的PHP目录复制到您的XAMPP目录中. (请勿覆盖现有的php目录!)
  4. 现在转到您的xampp/apache/conf/extra目录.进行备份,然后打开httpd-xampp.conf文件.
  5. 更改以下变量/指令:

  1. Download your desired version of the PHP thread-safe binary (zipped) from http://windows.php.net/download/.
  2. 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)
  3. Copy the new PHP directory into your XAMPP directory. (DO NOT overwrite your existing php directory!)
  4. Now go to your xampp/apache/conf/extra directory. Make a backup of, then open the httpd-xampp.conf file.
  5. 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的默认路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-27 10:52