yum -y update php

General support questions
Post Reply
xo)mora
Posts: 58
Joined: 2017/01/13 20:52:59

yum -y update php

Post by xo)mora » 2017/05/26 16:03:49

Hi, I need update the PHP 5.4.16 (cli) to PHP 5.6 in Centos 7, I did :
# rpm -Uvh https://dl.fedoraproject.org/pub/epel/e ... noarch.rpm
Retrieving https://dl.fedoraproject.org/pub/epel/e ... noarch.rpm
Preparing... ################################# [100%]
package epel-release-7-9.noarch is already installed

# yum -y update php
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: centos.pymesolutionsweb.com
* epel: archive.linux.duke.edu
* extras: centos.firehosted.com
* updates: centos.vwtonline.net
No packages marked for update


Will you help me please with that, please?

CaViCcHi
Posts: 68
Joined: 2012/04/18 17:03:15
Contact:

Re: yum -y update php

Post by CaViCcHi » 2017/05/26 18:25:34

what exact version do you need of php-cli?

http://mirrors.oit.uci.edu/centos/7/os/ ... x86_64.rpm

there's this, so you should get it simply with

Code: Select all

yum install php-cli
if that doesn't work, what does

Code: Select all

rpm -qa | grep ^php 
return?

User avatar
TrevorH
Site Admin
Posts: 33219
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: yum -y update php

Post by TrevorH » 2017/05/27 14:03:23

We do not ship php other than the 5.4.16 that's in the repos.

There are several ways to get a newer version but they are all only recommended if you actually require the functionality from the newer versions. Redhat take care of making sure that the 5.4.16 in base is up to date with security updates so running 5.4.16 is not a security concern - it is fully patched and should be secure as long as you regularly yum update

The main two replacements are to either use SCL - this provides parallel installable copies of things but they have a 3 year shelf life where security updates from newer versions will be backported to the older versions that SCL supply. Using an SCL package requires special steps involving the use of the scl enable ... command.

The other mechanism is to use a third party repo called IUS Community. The guys that run IUS work for Rackspace though it's not an official Rackspace project. They supply packages that are named differently than the versions that CentOS supply so that you do not accidentally upgrade your php/mysql/whatever from the stable version that CentOS supplies to a new version just by the act of installing the repo. So their php 5.6 packages are called php56u-* and you must remove all the distro supplied php* packages and install the php56u* equivalents. IUS packages are supported for the lifetime of the upstream version of the code - so php56u packages will be supported and updated until php.net decide they are end of life and at that point the IUS packages will receive no more updates.

You won't find anything in EPEL that conflicts with packages from the CentOS repos - that's part of their rules. So no point looking there for php or for anything else that CentOS already ships.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

bertalanimre
Posts: 140
Joined: 2015/06/02 13:04:03

Re: yum -y update php

Post by bertalanimre » 2017/05/31 07:50:16

My personal use for upgrading, installing PHP is the 3rd party repository called Remi. After installing the repository, you'll have different repo files for the different PHP versions that you can enable/disable as you like. But keep in mind, if you enable like both PHP 5.6 and 7.0 and you execute yum install php, then the higher version will be applied so enable only the exact versions you'll need. Available versions in Remi are: 5.5, 5.6, 7.0 and 7.1.

Also installing... it is fairly easy. To enable PHP 7.1 do:

Code: Select all

rpm -Uvh "https://rpms.remirepo.net/enterprise/remi-release-7.rpm"
yum-config-manager --enable remi-php71
yum install php

Post Reply