php56 - CentOS - Remi Repo

大憨熊 提交于 2021-02-18 07:34:14

问题


I just installed php 5.6 on a test box, and the normal cli php interpreter doesn't appear to exist:

$ -> php -v
-bash: php: command not found

$ -> php56 -v
PHP 5.6.13 (cli) (built: Sep  3 2015 13:41:04)    

If I try to do a yum install php --enablerepo=remi then it tries to install php 5.4.

So it's obvious that php56 is a cli interpreter, but I've always been used to just typing php vs php56. Is this the new norm, or is there another step for installing php56 on CentOS (6.7)? Is it as simple as creating a symlink? ln -s /usr/bin/php56 /usr/bin/php

Steps to upgrade:

$ -> yum remove php* --enablerepo=remi

$ -> yum install php56* --enablerepo=remi

Thx to Remi for the push in the right direction, here's what my repo config looks like:

[upstream_remi54]
name=Remi - CentOS - $releasever/$arch
 baseurl=http://mirrors.mediatemple.net/remi/enterprise/$releasever/remi/$basearch/
enabled=0

gpgcheck=1

gpgkey=http://rpms.famillecollet.com/RPM-GPG-KEY-remi

[upstream_remi56]
name=Remi - CentOS - $releasever/$arch
baseurl=http://mirrors.mediatemple.net/remi/enterprise/$releasever/php56/$basearch/
enabled=0

gpgcheck=1

gpgkey=http://rpms.famillecollet.com/RPM-GPG-KEY-remi

This works well if you want to completely replace existing PHP, vs running versions in parallel. I have to keep PHP 5.4 in place for Roundcube and Postfix Admin, as some of the modules necessary for those to work have not yet been ported, so that server has to stay 5.4 for now.


回答1:


php-* are base packages, 1 repository per version

  • "remi" => php 5.4
  • "remi-php55" => php 5.5
  • "remi-php56" => php 5.6
  • "remi-php70" => php 7.0 (Release Candidate, not ready for prod)

php56-* packages are Software Collections, parallel installation allowing to run multiple versions of PHP.

See : http://blog.remirepo.net/pages/English-FAQ

So, if you only want a single php version 5.6

yum --enablerepo=remi-php56 install php-cli (and other needed modules)

And you can also enable the repository for future update (as the "remi-php56" is safe and only provides php 5.6 and its extension)

yum-config-manager --enable remi-php56


来源:https://stackoverflow.com/questions/32874708/php56-centos-remi-repo

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!