CentOS installed php72 but command line php isn not working(CentOS 安装 php72 但命令行 php 不工作)
问题描述
我正在阅读以下关于在 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
知道我应该做什么吗?
推荐答案
请阅读向导说明
如果您需要单个版本,使用 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 不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:CentOS 安装 php72 但命令行 php 不工作
基础教程推荐
- 如何替换eregi() 2022-01-01
- YouTube API v3 点赞视频,但计数器不增加 2022-01-01
- PHP PDO MySQL 查询 LIKE ->多个关键词 2021-01-01
- 有什么方法可以用编码 UTF-8 而不是 Unicode 返回 PHP`json_encode`? 2021-01-01
- 在PHP中根据W3C规范Unicode 2022-01-01
- PHP 类:全局变量作为类中的属性 2021-01-01
- 如何在 Laravel 中使用 React Router? 2022-01-01
- 如何在 Laravel 5.3 注册中添加动态下拉列表列? 2021-01-01
- 学说 dbal querybuilder 作为准备好的语句 2022-01-01
- Cron Jobs 调用带有变量的 PHP 脚本 2022-01-01
