php upgrading on centos 7

hello all -

for some reason, the people at centos-7 just love to use a php version that is near obsolete. and from experience, just upgrading php without being VERY careful seems to cause its own set of issues, like deprecated code suddenly causes errors.

anyways, it appears i need to move from php-5.4 to 5.6. however, its wise to make absolutely sure you can go back quickly. but going back does not appear to be very well documented!

here is what i figured out. first, make sure what php modules you have installed before starting anything:

yum list installed | grep php ;

then here is how i removed php after moving to 5.6:

yum-config-manager --disable remi-php56 [Intall PHP 5.6] ; ## notice --disable, not --enable
yum --assumeyes remove php* ;

this is NOT one of those tasks you want to do under pressure, or if you are in a hurry. Probably a nice quiet time during the weekend is best, IMHO.

my upgrade steps are below:

yum --assumeyes install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm ;
yum --assumeyes install http://rpms.remirepo.net/enterprise/remi-release-7.rpm ;
yum --assumeyes install yum-utils;
yum-config-manager --enable remi-php56 [Intall PHP 5.6] ;

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

Quags

Administrator
Staff member
Always good to take a backup first!

php7 is much faster. centos7 will never officially offer it since they back port their current version.
 
php7 may be much faster & better, but there is still a lot of stuff that is not yet ready to run on php7. there is nothing more embarrassing than suddenly finding out some critical purchased application is not ready for php7 yet.

can you really backup a php install?
 

Quags

Administrator
Staff member
Yes they are EOL by the php team. However redhat does back port 5.4 so it continues to get security updates.
 
quick update: i apparently made a big mess of things when i tried to install a more recent version of php a couple of years ago. now on php5.6, fast-cgi stopped working.
so, its time to bring in the experts. i am hiring a guy to work with me, in preparation for a move to php7.2 as well. that seems to not be as easy as you might think, at least using centos7, apache, and virtualmin together.
 
Top