Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

php56 - CentOS - Remi Repo

Tags:

linux

php

centos

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.

like image 481
Mike Purcell Avatar asked Dec 09 '22 01:12

Mike Purcell


1 Answers

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
like image 194
Remi Collet Avatar answered Dec 11 '22 08:12

Remi Collet