Adding Remi's RPM repository to CentOS 7 and updating to PHP 5.6
-
Now that ownCloud has cleared up their recommended and supported versions, I want to get my systems up to recommended. Note, PHP5.4 is completely supported, but it is not the recommended. This is by no means a requirement. If you do not feel comfortable using Remi's, then please feel confident that you are still running a supported system.
#install the Remi repo yum -y install http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
At this point Remi is available to you but will not be used by default.
You have two choices.
- You can enable the repo permanently
- You can enable the repo as needed.
To help you make this decision, you need to understand what is actually available to you from Remi's. The repo is divided into a few pieces allowing you to only enable the parts you need. For this task I only want the ability to update PHP to 5.6.
Open the repo and look
nano /etc/yum.repos.d/remi.repo
# Repository: http://rpms.remirepo.net/ # Blog: http://blog.remirepo.net/ # Forum: http://forum.remirepo.net/ [remi] name=Remi's RPM repository for Enterprise Linux 7 - $basearch #baseurl=http://rpms.remirepo.net/enterprise/7/remi/$basearch/ mirrorlist=http://rpms.remirepo.net/enterprise/7/remi/mirror enabled=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi [remi-php55] name=Remi's PHP 5.5 RPM repository for Enterprise Linux 7 - $basearch #baseurl=http://rpms.remirepo.net/enterprise/7/php55/$basearch/ mirrorlist=http://rpms.remirepo.net/enterprise/7/php55/mirror # NOTICE: common dependencies are in "remi-safe" enabled=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi [remi-php56] name=Remi's PHP 5.6 RPM repository for Enterprise Linux 7 - $basearch #baseurl=http://rpms.remirepo.net/enterprise/7/php56/$basearch/ mirrorlist=http://rpms.remirepo.net/enterprise/7/php56/mirror # NOTICE: common dependencies are in "remi-safe" enabled=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi [remi-test] name=Remi's test RPM repository for Enterprise Linux 7 - $basearch #baseurl=http://rpms.remirepo.net/enterprise/7/test/$basearch/ mirrorlist=http://rpms.remirepo.net/enterprise/7/test/mirror # WARNING: If you enable this repository, you must also enable "remi" enabled=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi [remi-debuginfo] name=Remi's RPM repository for Enterprise Linux 7 - $basearch - debuginfo baseurl=http://rpms.remirepo.net/enterprise/7/debug-remi/$basearch/ enabled=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi [remi-php55-debuginfo] name=Remi's PHP 5.5 RPM repository for Enterprise Linux 7 - $basearch - debuginfo baseurl=http://rpms.remirepo.net/enterprise/7/debug-php55/$basearch/ enabled=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi [remi-php56-debuginfo] name=Remi's PHP 5.6 RPM repository for Enterprise Linux 7 - $basearch - debuginfo baseurl=http://rpms.remirepo.net/enterprise/7/debug-php56/$basearch/ enabled=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi [remi-test-debuginfo] name=Remi's test RPM repository for Enterprise Linux 7 - $basearch - debuginfo baseurl=http://rpms.remirepo.net/enterprise/7/debug-test/$basearch/ enabled=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi
Each of the sections in square brackets are different repositories available from Remi. The names are self explanatory in my opinion. As I am only after PHP 5.6, I see the repo name I need to enable is
remi-php56
.Now that I know this I can decide to enable it permanently simply by changing the line
enabled=0
toenabled=1
in theremi-php56
section. For me this is what I want because I useyum-cron
to update things and I always want php56 to be updated.If you only want to enable it for a single run of
yum
, you can add the--enablerepo
switch like this.yum --enablerepo=remi-php56 update
No matter which way you do it, you will see this
[root@oc ~]# yum clean all Loaded plugins: fastestmirror Cleaning repos: base ce_8.2 epel extras remi-php56 remi-safe updates Cleaning up everything Cleaning up list of fastest mirrors [root@oc ~]# yum update Loaded plugins: fastestmirror base | 3.6 kB 00:00:00 ce_8.2 | 1.2 kB 00:00:00 epel/x86_64/metalink | 12 kB 00:00:00 epel | 4.3 kB 00:00:00 extras | 3.4 kB 00:00:00 remi-php56 | 2.9 kB 00:00:00 remi-safe | 2.9 kB 00:00:00 updates | 3.4 kB 00:00:00 (1/10): ce_8.2/primary | 4.0 kB 00:00:01 (2/10): epel/x86_64/group_gz | 169 kB 00:00:00 (3/10): base/7/x86_64/group_gz | 155 kB 00:00:01 (4/10): epel/x86_64/updateinfo | 510 kB 00:00:01 (5/10): base/7/x86_64/primary_db | 5.3 MB 00:00:01 (6/10): extras/7/x86_64/primary_db | 101 kB 00:00:00 (7/10): remi-php56/primary_db | 191 kB 00:00:01 (8/10): epel/x86_64/primary_db | 3.9 MB 00:00:01 (9/10): remi-safe/primary_db | 360 kB 00:00:02 (10/10): updates/7/x86_64/primary_db | 3.1 MB 00:00:02 Determining fastest mirrors * base: chicago.gaminghost.co * epel: mirror.steadfast.net * extras: mirror.sesp.northwestern.edu * remi-php56: mirrors.mediatemple.net * remi-safe: mirrors.mediatemple.net * updates: reflector.westga.edu ce_8.2 9/9 Resolving Dependencies --> Running transaction check ---> Package php.x86_64 0:5.4.16-36.el7_1 will be updated ---> Package php.x86_64 0:5.6.19-1.el7.remi will be an update ---> Package php-cli.x86_64 0:5.4.16-36.el7_1 will be updated ---> Package php-cli.x86_64 0:5.6.19-1.el7.remi will be an update ---> Package php-common.x86_64 0:5.4.16-36.el7_1 will be updated --> Processing Dependency: php-json for package: owncloud-server-8.2.3-2.1.noarch --> Processing Dependency: php-zip for package: owncloud-server-8.2.3-2.1.noarch --> Processing Dependency: php-pecl-zip(x86-64) for package: php-common-5.6.19-1.el7.remi.x86_64 ---> Package php-common.x86_64 0:5.6.19-1.el7.remi will be an update ---> Package php-gd.x86_64 0:5.4.16-36.el7_1 will be updated ---> Package php-gd.x86_64 0:5.6.19-1.el7.remi will be an update --> Processing Dependency: gd-last(x86-64) >= 2.1.1 for package: php-gd-5.6.19-1.el7.remi.x86_64 --> Processing Dependency: libvpx.so.1()(64bit) for package: php-gd-5.6.19-1.el7.remi.x86_64 --> Processing Dependency: libgd.so.3()(64bit) for package: php-gd-5.6.19-1.el7.remi.x86_64 ---> Package php-ldap.x86_64 0:5.4.16-36.el7_1 will be updated ---> Package php-ldap.x86_64 0:5.6.19-1.el7.remi will be an update ---> Package php-mbstring.x86_64 0:5.4.16-36.el7_1 will be updated ---> Package php-mbstring.x86_64 0:5.6.19-1.el7.remi will be an update ---> Package php-mysql.x86_64 0:5.4.16-36.el7_1 will be obsoleted ---> Package php-mysqlnd.x86_64 0:5.6.19-1.el7.remi will be obsoleting ---> Package php-pdo.x86_64 0:5.4.16-36.el7_1 will be updated ---> Package php-pdo.x86_64 0:5.6.19-1.el7.remi will be an update ---> Package php-process.x86_64 0:5.4.16-36.el7_1 will be updated ---> Package php-process.x86_64 0:5.6.19-1.el7.remi will be an update ---> Package php-xml.x86_64 0:5.4.16-36.el7_1 will be updated ---> Package php-xml.x86_64 0:5.6.19-1.el7.remi will be an update --> Running transaction check ---> Package gd-last.x86_64 0:2.1.1-2.el7.remi will be installed --> Processing Dependency: libtiff.so.5(LIBTIFF_4.0)(64bit) for package: gd-last-2.1.1-2.el7.remi.x86_64 --> Processing Dependency: libtiff.so.5()(64bit) for package: gd-last-2.1.1-2.el7.remi.x86_64 --> Processing Dependency: libfontconfig.so.1()(64bit) for package: gd-last-2.1.1-2.el7.remi.x86_64 ---> Package libvpx.x86_64 0:1.3.0-5.el7_0 will be installed ---> Package php-pecl-jsonc.x86_64 0:1.3.9-1.el7.remi.5.6 will be installed ---> Package php-pecl-zip.x86_64 0:1.13.2-1.el7.remi.5.6 will be installed --> Processing Dependency: libzip.so.4()(64bit) for package: php-pecl-zip-1.13.2-1.el7.remi.5.6.x86_64 --> Running transaction check ---> Package fontconfig.x86_64 0:2.10.95-7.el7 will be installed --> Processing Dependency: fontpackages-filesystem for package: fontconfig-2.10.95-7.el7.x86_64 ---> Package libtiff.x86_64 0:4.0.3-14.el7 will be installed --> Processing Dependency: libjbig.so.2.0()(64bit) for package: libtiff-4.0.3-14.el7.x86_64 ---> Package libzip-last.x86_64 0:1.1.2-1.el7.remi will be installed --> Running transaction check ---> Package fontpackages-filesystem.noarch 0:1.44-8.el7 will be installed ---> Package jbigkit-libs.x86_64 0:2.0-11.el7 will be installed --> Finished Dependency Resolution Dependencies Resolved ====================================================================================================================== Package Arch Version Repository Size ====================================================================================================================== Installing: php-mysqlnd x86_64 5.6.19-1.el7.remi remi-php56 293 k replacing php-mysql.x86_64 5.4.16-36.el7_1 Updating: php x86_64 5.6.19-1.el7.remi remi-php56 2.6 M php-cli x86_64 5.6.19-1.el7.remi remi-php56 4.0 M php-common x86_64 5.6.19-1.el7.remi remi-php56 1.1 M php-gd x86_64 5.6.19-1.el7.remi remi-php56 82 k php-ldap x86_64 5.6.19-1.el7.remi remi-php56 63 k php-mbstring x86_64 5.6.19-1.el7.remi remi-php56 564 k php-pdo x86_64 5.6.19-1.el7.remi remi-php56 135 k php-process x86_64 5.6.19-1.el7.remi remi-php56 72 k php-xml x86_64 5.6.19-1.el7.remi remi-php56 243 k Installing for dependencies: fontconfig x86_64 2.10.95-7.el7 base 228 k fontpackages-filesystem noarch 1.44-8.el7 base 9.9 k gd-last x86_64 2.1.1-2.el7.remi remi-safe 140 k jbigkit-libs x86_64 2.0-11.el7 base 46 k libtiff x86_64 4.0.3-14.el7 base 167 k libvpx x86_64 1.3.0-5.el7_0 base 498 k libzip-last x86_64 1.1.2-1.el7.remi remi-safe 45 k php-pecl-jsonc x86_64 1.3.9-1.el7.remi.5.6 remi-php56 55 k php-pecl-zip x86_64 1.13.2-1.el7.remi.5.6 remi-php56 57 k Transaction Summary ====================================================================================================================== Install 1 Package (+9 Dependent packages) Upgrade 9 Packages Total download size: 10 M Is this ok [y/d/N]:
Answer
Y
and PHP will be updated to PHP 5.6Now restart Apache to make use of it.
systemctl restart httpd
-
Thanks!
-
If you don't want to do this in two steps you can install from RPM directly:
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
And if you want YUM to track things, you can do that directly, too.
yum -y install http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
-
@scottalanmiller said:
If you don't want to do this in two steps you can install from RPM directly:
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
And if you want YUM to track things, you can do that directly, too.
yum -y install http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
I always forget you can just do it through
yum
, updated the instructions above. -
Me too, no one ever does that. I've used RPM so much more than YUM that I've only recently gotten to the point that I remember with YUM now.
-
@scottalanmiller said:
Me too, no one ever does that. I've used RPM so much more than YUM that I've only recently gotten to the point that I remember with YUM now.
I used have the same habit. Got tired of yum complaining about the rpm database being changed by another program. Once I figured out yum can both handle downloading a package and installing an already downloaded rpm, that was an easy annoyance to fix.
yum localinstall /home/$user/remi-release-7.rpm
-
If you want to enable PHP 7 you need to edit a different repo file to find the remi-php70 repo to enable.
nano /etc/yum.repos.d/remi-php70.repo