升级到PHP 7 Bin / Magento CLI命令不起作用Magento 2.0.2 CE
-
28-09-2020 - |
题
我已将apache2.4服务器的PHP版本从5.6升级到7.0。 OS版Ubuntu 14.04 LTS。 在此更新之后,尽管我尝试运行
时,我已经安装了php7.0-cliphp7.0 bin/magento list command
.
我得到掉落输出:
Content-type: text/html; charset=UTF-8
bin/magento must be run as a CLI application
.
输出当我运行sudo apt-get安装php7.0-cli:
php7.0-cli is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
.
当我转到bin目录并尝试运行命令:
magento list
.
我得到输出:
magento: command not found
.
将欣赏任何帮助!
解决方案
什么是输出:
ls -l $(which php)
.
对我来说是显示的:
/usr/bin/php -> /etc/alternatives/php
.
还检查其中的输出:
echo $PATH
.
并查看错误PHP的任何路径,也许您只需要修复$ PATH。
如果不起作用,请尝试重新安装整个包,覆盖原始文件:
sudo apt-get install --reinstall php7.0-cli
. 其他提示
不需要重新安装PHP。你只是做这个命令
php7.0-cli bin/magento
.
列表命令