【发布时间】:2021-04-10 02:42:30
【问题描述】:
当我使用 phpinfo() 运行文件时,结果是 PHP 版本 7.4
但命令行运行php -v,但结果是PHP 7.2.34
PHP 7.2.34-8+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Oct 31 2020 16:57:15) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.34-8+ubuntu18.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies
with Xdebug v2.9.8, Copyright (c) 2002-2020, by Derick Rethans
为什么我会看到差异?
【问题讨论】:
-
因为 php -v 显示 php CLI 版本
-
PHP-CLI 与您在 Web 服务器中使用的 PHP 不同。这很常见。
-
请分享更多细节和你的调试尝试