3

I would like to ask how to upgrade to PHP 5.6 on my CentOS machine using Yum + REMI repo.

For example, I already use the REMI repo for everything.

Now, after I change this line in /etc/yum.repos.d/remi.repo:

[remi-php56]
enabled=0

to

enabled=1

I can now see the PHP 5.6.2 package on the repo. If I simpy update as such yum update php, will that update the entire PHP package (ie php_mysql, pdo, etc) ?

And what about mod_php in httpd? (Apache)?

Or are there other steps I need to take?

fizzy drink
  • 385
  • 4
  • 8
  • 22

2 Answers2

3

You made need to install php56 explicitly, e.g.:

yum install php56 php56-php-cli  php56-php-common php56-php-pear php56-php-pecl-jsonc php56-php-pecl-zip php56-php-process php56-php-xml php56-runtime

and then remove the old php, e.g.

yum remove php55 php55-php-cli  php55-php-common php55-php-pear php55-php-pecl-jsonc php55-php-pecl-zip php55-php-process php55-php-xml php55-runtime

You can run yum list installed |grep php to see which PHP packages are already installed.

Nic Cottrell
  • 1,302
  • 16
  • 32
2

Ok,

so to upgrade, do the following:

make sure that in the file /etc/yum.repos.d/remi.repo, that you enable the remi-php56 repo

[remi-php56]
enabled=1

And you can then do 'yum update php`.

If you get problems such as inconsistency between Modules API and PHP API, the installation still works. But you may end up having to update PECL + PERL.

What I did was uninstall all PHP packages which you can find by looking up rpm -qa | grep php and then uninstalling yum remove php php-cli php-common php-mysql php-pear php-pecl php-pdo php-xml

and of course reinstalling yum install php php-cli php-common php-mysql php-pear php-pecl php-pdo php-xml which will give you the new version.

And, don't forget to restart httpd service httpd restart

fizzy drink
  • 385
  • 4
  • 8
  • 22