在服务器中,它从任一 cPanel 显示 7.0 php,如下所示
或 cat/etc/apache2/conf.d/php.version
在服务器中
但是在 php --version
中,它显示 php5.6。
如何将我的 php 升级到 7.0?谢谢。
最佳答案
如果您从 cpanel 帐户更改 PHP 版本,它将被应用并且您的网站将使用新版本。
php -v
命令显示您系统的默认 PHP 版本,但如果您只想检查您的 cpanel 帐户的 PHP 版本,您只需要修改您的 ~/.bashrc
文件:
alias php="/opt/cpanel/ea-php70/root/usr/bin/php"
然后:
source ~/.bashrc
现在你会发现输出类似于:
php -v
PHP 7.0.33 (cli) (built: xxxxxx) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.0.33, Copyright (c) 1999-2017, by Zend Technologies
关于php 版本在 WHM 和服务器中显示不同,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57630550/