dongsuikai8286 2018-02-08 09:59 采纳率: 100%
浏览 623
已采纳

CentOS安装php72但命令行php无效

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/

It basically says;

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

Which returns the following;

-bash: php: command not found

BUT, if i type the following;

php72 --version

It works just fine and returns the version.

The problem is that everything relies on the command php and not php72

Any idea on what i should be doing?

  • 写回答

7条回答

  • douyinjiao9351 2018-02-08 10:20
    关注

    Please read the Wizard instructions

    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
    

    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
    

    So, according to your question, you have enable the remi-php72 repository, but installed the php72* packages from the remi-safe repository...

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(6条)

报告相同问题?

悬赏问题

  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥30 用arduino开发esp32控制ps2手柄一直报错
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 求chat4.0解答一道线性规划题,用lingo编程运行,第一问要求写出数学模型和lingo语言编程模型,第二问第三问解答就行,我的ddl要到了谁来求了
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名
  • ¥65 汇编语言除法溢出问题
  • ¥15 Visual Studio问题