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?

6
  • Have you at least tried it to see what it would do? Oct 22 '14 at 17:20
  • @MichaelHampton :) no, this is a production server, and is currently live! Oct 22 '14 at 17:22
  • 1
    You don't have to say "yes" at the prompt! Oct 22 '14 at 17:22
  • Don't you have a development server to test it on?
    – ceejayoz
    Oct 22 '14 at 17:23
  • Ahh, I see what you mean: It fails after Dependency Resolution, and it shows below ' You could try using --skip-broken to work around the problem You could try running: rpm -Va --nofiles --nodigest' Oct 22 '14 at 17:24
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.

1
  • I also add some additinal packages as yum install php56-php-fpm php56-php-pdo as well
    – Yu Jiaao
    Sep 26 '16 at 3:29
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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.