PHP update on CentOS 6.5 (Final)

I am trying to update my PHP (currently v: 5.3.3 to the last stable PHP build), but it does not play the ball, and it says that there is nothing to update.

Any help would be helpful.

Continues to say:

No packages marked for upgrade

+65
php yum centos6
Feb 01 '14 at 19:41
source share
8 answers

As Jacob mentioned, CentOS repo packages are currently only available for PHP 5.3. But these teams worked for me ...

rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm yum remove php-common # Need to remove this, otherwise it conflicts yum install php56w yum install php56w-mysql yum install php56w-common yum install php56w-pdo yum install php56w-opcache php --version # Verify version has been upgraded 

If necessary, you can use php54w or php55w .

ATTENTION!
This can potentially disrupt your site if it does not completely resolve all your dependencies, so you may need several additional packages in some cases. See here for a list of other available PHP 5.6 modules.

If you encounter a problem and need to reset back to default, you can use the following commands:

 sudo yum remove php56w sudo yum remove php56w-common sudo yum install php-common sudo yum install php-mysql sudo yum install php 

(Thanks to Fabrizio Bartolomucci)

+119
Jun 22 '14 at 12:38
source share

For CentOS 6, PHP 5.3.3 is the latest version of PHP available through the official CentOS package repository . Keep in mind that although PHP 5.3.3 was released on July 22, 2010 , the official CentOS 6 PHP package was updated on November 24, 2013. Why? Critical errors fixed. See this question for more information: "Why do obsolete packages install yum on CentOS? (In particular, PHP 5.1) How to fix it?"

If you want to use a more recent version of PHP, Les RPM de Remi offers CentOS PHP packages through a repository that you can add to the yum package manager. To add it as a yum repository, follow the instructions on the site .

Note: this type of issue is probably better suited for a server crash .

+28
Feb 01 '14 at 20:44
source share

I managed to install php54w according to Simon's suggestion, but then my sites stopped working, possibly due to incompatibility with php-mysql or some other module. Even the desperate restoration of the old situation was not funny: for each in my own situation, the sequence:

 sudo yum remove php54w sudo yum remove php54w-common sudo yum install php-common sudo yum install php-mysql sudo yum install php 

It would be nice if someone sent the full procedure to update the entire php package. It was my production server, and my heart still beats fast.

+7
Jan 30 '15 at 13:56
source share

This is the easiest way that worked for me: Install PHP 5.6 on CentOS 6 or 7:

CentOS 6. Enter the following commands in the order shown:

 yum -y update yum -y install epel-release wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm wget https://centos6.iuscommunity.org/ius-release.rpm rpm -Uvh ius-release*.rpm yum -y update yum -y install php56u php56u-opcache php56u-xml php56u-mcrypt php56u-gd php56u-devel php56u-mysql php56u-intl php56u-mbstring php56u-bcmath 

CentOS 7. Enter the following commands in the order shown:

 yum -y update yum -y install epel-release wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm wget https://centos7.iuscommunity.org/ius-release.rpm rpm -Uvh ius-release*.rpm yum -y update yum -y install php56u php56u-opcache php56u-xml php56u-mcrypt php56u-gd php56u-devel php56u-mysql php56u-intl php56u-mbstring php56u-bcmath 

Sorry - I cannot post the source URL - due to reputation

+6
Dec 28 '16 at 4:59
source share
  • Check Current PHP Version Enter the following information to see the current PHP version:

    php -v

    It should output something like:

    PHP 5.3.3 (cli) (built: July 9, 2015 5:39:00 p.m.) Copyright (c) 1997-2010 PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies

  • Install Remi and EPEL RPM repositories

If you haven’t already done so, install the Remi and EPEL repositories.

 wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm && rpm -Uvh epel-release-latest-6.noarch.rpm wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm && rpm -Uvh remi-release-6*.rpm 

Enable REMI repository globally:

 nano /etc/yum.repos.d/remi.repo 

In the section that looks like [remi], make the following changes:

 [remi] name=Remi RPM repository for Enterprise Linux 6 - $basearch #baseurl=http://rpms.remirepo.net/enterprise/6/remi/$basearch/ mirrorlist=http://rpms.remirepo.net/enterprise/6/remi/mirror enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi 

In addition, the following changes are made to the section that looks like [remi-php55]:

 [remi-php56] name=Remi PHP 5.6 RPM repository for Enterprise Linux 6 - $basearch #baseurl=http://rpms.remirepo.net/enterprise/6/php56/$basearch/ mirrorlist=http://rpms.remirepo.net/enterprise/6/php56/mirror # WARNING: If you enable this repository, you must also enable "remi" enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi 

Enter CTRL-O to save and CTRL-X to close the editor

  1. Upgrading PHP 5.3 to PHP 5.6 Now we can upgrade PHP. Just enter the following command:

    yum -y upgrade php *

Once the update is complete, make sure you have PHP 5.6 installed:

 php -v 

Should see a result similar to the following:

 PHP 5.6.14 (cli) (built: Sep 30 2015 14:07:43) Copyright (c) 1997-2015 The PHP Group Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies 
+4
Aug 30 '16 at 17:19
source share

This Amina's answer worked great. I would add that I needed to save one of the IP addresses in 5.3.3. I was able to do this in Pleks Onyx using the Apache CGI application. Not sure why Fast CGI application did not work. But then I switched it back to Fast CGI and it worked.

+1
Apr 03 '17 at 21:20
source share

IUS offers a script installation to subscribe to its repository and import related GPG keys. Make sure you are in your home directory and extract the script using curl:

 curl 'https://setup.ius.io/' -o setup-ius.sh sudo bash setup-ius.sh 

Install the necessary packages -:

 sudo yum install -y mod_php70u php70u-cli php70u-mysqlnd php70u-json php70u-gd php70u-dom php70u-simplexml php70u-mcrypt php70u-intl 

See my article for more details.

0
Apr 18 '16 at 19:03
source share

Steps to upgrade to PHP7 on CentOS 6. Adapted from install-php-7-in-centos-6

To install the latest version of PHP 7, you need to add the EPEL and Remi repository to your CentOS 6 system

 yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm yum install http://rpms.remirepo.net/enterprise/remi-release-6.rpm 

Now install yum-utils, a group of useful tools that enhance the default package management features of yums

 yum install yum-utils 

At this point, you need to enable the Remi repository using the yum-config-manager utility, as the default repository for installing PHP.

 yum-config-manager --enable remi-php70 

If you want to install PHP 7.1 or PHP 7.2 on CentOS 6, just enable it as shown.

 yum-config-manager --enable remi-php71 yum-config-manager --enable remi-php72 

Then finally install PHP 7 on CentOS 6 with all the necessary PHP modules using the following command.

 yum install php php-mcrypt php-cli php-gd php-curl php-mysql php-ldap php-zip php-fileinfo 

Double check the installed version of PHP on your system as follows.

 php -V 
0
Dec 20 '18 at 23:29
source share



All Articles