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条)

报告相同问题?

悬赏问题

  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码