Wampserver 不会更改 WEB 的 PHP 版本(不是 CLI) [英] Wampserver not changing the PHP version for WEB (not CLI)

查看:37
本文介绍了Wampserver 不会更改 WEB 的 PHP 版本(不是 CLI)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Windows 7 上安装了 WampServer 版本 3.1.4 64 位,它带有 PHP 版本 php5.6.38、php7.0.32、php7.1.22 和 php7.2.10.我想使用 php5.6.x 而不是 php7.x.

I have WampServer Version 3.1.4 64bit installed on Windows 7 and it comes with PHP versions php5.6.38, php7.0.32, php7.1.22, and php7.2.10. I would like to use php5.6.x rather than php7.x.

所以,当我从服务器托盘图标从 php7.2.10 切换到 php5.6.38 时;它不会更新由 phpinfo() 显示的实际 php 版本.在本地主机上,它仍然说:

So, when I switch from php7.2.10 to php5.6.38 from the server tray icon; it does not update the actual php version which is shown by phpinfo(). On localhost, it still says:

PHP Version: 7.2.10

但是,它是在 CLI 端更新的.这是通过在 cmd 中运行来测试的:

However, it is updated on CLI side. This is tested with running this in the cmd:

php -v

结果是:

c:\wamp64\bin\apache\apache2.4.35\bin>php -v
PHP 5.6.38 (cli) (built: Sep 13 2018 12:45:08)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies

重启WAMP服务后,重新打开终端,重启电脑,还是没有通过phpinfo更新.它可能与Apache服务使用的php版本有关.如何将其更改为 5.6.x有什么建议 ?非常感谢

After restarting WAMP services, and re opening the terminal, and restarting computer, it still not updated through phpinfo. It probably related the php version used by Apache service. How can I change this to 5.6.x Any suggestions ? Many thanks

注意:该问题与更改 php cli 版本无关,因为它被指出 here.我不明白为什么他们中的一些人在没有仔细阅读帖子的情况下坚持认为这是潜在的重复.

Note : The issue is not related with changing php cli version as it was pointed here. I do not understand why some of them insist that this is potential duplication without reading the post carefully.

推荐答案

我遇到了类似的问题,我已经从 https://wampserver.aviatechno.net/?lang=en.我需要 php 7.3 和 7.4,安装 php 升级后,这些新版本没有反映在 wampserver 托盘菜单中(左键单击 wamp 图标-> php-versions).在花了相当多的时间研究这个之后,终于可以通过以下步骤解决这个问题:

I have faced kind of similar issue, I have installed wampserver upgrades from https://wampserver.aviatechno.net/?lang=en. I needed php 7.3 and 7.4, after installing the php upgrades, those new versions were not being reflected in wampserver traymenu (left click on wamp icon->php-versions). After spending quite some time looking into this, finally could fix this by following steps :

清除日志(右键单击 wampserver 图标 -> 工具 -> 空日志)[我的 php 日志文件是 300+ MB].

Clearing logs (right click on wampserver icon -> tools -> empty logs) [my php log file was 300+ MB].

重新启动 wampserver,一切顺利.

Restarted wampserver and it was good to go.

我从这个帖子中找到了解决方案 http://forum.wampserver.com/read.php?2,159184

I found solution from this thread http://forum.wampserver.com/read.php?2,159184

这篇关于Wampserver 不会更改 WEB 的 PHP 版本(不是 CLI)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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