如何更改 XAMPP 中 PHP 的默认路径? [英] How do I change the default path of PHP in XAMPP?

查看:39
本文介绍了如何更改 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 线程安全二进制文件(压缩).网络/下载/.
  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[你的 xampp 文件夹]/[新版本的 PHP]

LoadModule[你的 xampp 文件夹]/[新版 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/how-to-upgrade-php-in-xampp/

这篇关于如何更改 XAMPP 中 PHP 的默认路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆