CentOS安装了php72,但命令行php无法正常工作 [英] CentOS installed php72 but command line php isn not working
问题描述
我正在阅读以下有关在CentOS 7上安装PHP 7.2的教程 https://www.cyberciti.biz/faq/how-to-install-php-7-2-on-centos-7-rhel-7/
I'm reading the following tutorial on installing PHP 7.2 on CentOS 7 https://www.cyberciti.biz/faq/how-to-install-php-7-2-on-centos-7-rhel-7/
基本上是这样;
sudo yum install epel-release
sudo yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
sudo yum install yum-utils
sudo yum-config-manager --enable remi-php72
sudo yum update
sudo yum install php72
然后说要使用标准来验证安装
Then it says to verify the installation using the standard
php --version
返回以下内容;
-bash: php: command not found
但是,如果我键入以下内容;
BUT, if i type the following;
php72 --version
它可以正常工作并返回版本.
It works just fine and returns the version.
问题在于,一切都依赖于命令php而不是php72
The problem is that everything relies on the command php and not php72
关于我应该做什么的任何想法?
Any idea on what i should be doing?
推荐答案
请阅读向导说明
如果您需要使用remi-php72存储库和 php-* 软件包的单个版本,则命令将为 php .
If you need a single version, using remi-php72 repository, and the php-* packages, the command will be php.
# yum-config-manager --enable remi-php72
# yum update
# yum install php-cli
# php -v
如果需要多个版本,可以使用 php72-php-* 软件包,命令为 php72 或
If you need multiples versions, the php72-php-* packages are available, and the command is php72 or
# yum install php72-php-cli
# php72 -v
# scl enable php72 bash
# php -v
因此,根据您的问题,您已启用remi-php72存储库,但已从remi-safe存储库安装了php72 *软件包...
So, according to your question, you have enable the remi-php72 repository, but installed the php72* packages from the remi-safe repository...
这篇关于CentOS安装了php72,但命令行php无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!