Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: PHP 5.6 CentOS 7
PostPosted: Fri May 19, 2017 11:56 am 
Offline
Newbie

Joined: Fri May 19, 2017 11:52 am
Posts: 2
Can anyone provide any guidance on how to best update PHP 5.4.16 to 5.6 on a Linode CentOS 7. I know the distro does not support it, but I need it for some specific apps. Thanks!


Top
   
 Post subject: Re: PHP 5.6 CentOS 7
PostPosted: Fri May 19, 2017 11:36 pm 
Offline
Newbie

Joined: Fri May 19, 2017 11:52 am
Posts: 2
Can anyone critique this process for installing PHP 5.6 on a Linode CentOS 7 Server?

https://zedt.eu/tech/linux/enabling-php ... -centos-7/

Will this work? Or will it cause damage?


Top
   
 Post subject: Re: PHP 5.6 CentOS 7
PostPosted: Sat May 20, 2017 11:01 am 
Offline
Senior Newbie

Joined: Sun Jun 28, 2015 8:51 pm
Posts: 5
I was looking for info on this myself. I read around, and found this set of upgrade instructions:
Quote:
To use the IUS packages in CentOS 7:

1. Install EPEL and IUS repositories:
# yum --enablerepo=extras install epel-release
# yum install https://centos7.iuscommunity.org/ius-release.rpm

2. Install yum-plugin-replace and replace the php packages with php56u packages:
# yum install yum-plugin-replace
# yum replace --replace-with php56u php

3. Restart any services which depend on php, such as httpd.

Note that this will install the current version of 5.6, which at the time of posting is 5.6.16, and that a "yum update" will keep the packages up to date in future.
I'm not a complete server neophyte, but this is something I've not done before (use a different repository), so I asked Linode support about it. They had this to say:
Quote:
It's hard to say if upgrading will break anything within your Linode as an infrastructure provider we do have our limitations as to what we can Support. But those steps you've listed look correct based my readings.
A subsequent question to them about "What's the official policy then" garnered this in reply:
Quote:
The official stance by CentOS's maintainers is to update to the latest version of CentOS 7 and then update PHP accordingly. However, if you want to keep the same version of CentOS then using a different repository for PHP updates should be fairly safe. If you need to, you can always uninstall PHP and install it from a different repository or package.

I've personally used Remi's repository for Enterprise Linux, which covers RHEL and CentOS:

https://rpms.remirepo.net/enterprise/7/

But I hear that IUS is also very reliable.
So at this point, I'm a bit confused as to what path to take. :)


Top
   
 Post subject: Re: PHP 5.6 CentOS 7
PostPosted: Sat May 20, 2017 7:36 pm 
Offline
Senior Member
User avatar

Joined: Sun Jan 18, 2009 1:41 pm
Posts: 945
I am starting the process of this myself, for a web application that no longer supports the base version (5.4) of PHP in CentOS 7. The most "official" way I have found is to use Software Collections. PHP 5.6 is included as a package. Once you have installed the centos-release-scl package, you will see a number of rh-php56* packages available through yum.

Keep in mind that these packages do not provide the built-in PHP module for Apache. To get that, you will need to install from the httpd24 Software Collection. I believe it should be possible to connect the base Apache in CentOS to PHP-FPM provided in rh-php56-php-fpm.


Top
   
 Post subject: Re: PHP 5.6 CentOS 7
PostPosted: Wed Jul 05, 2017 10:45 am 
Offline
Senior Newbie

Joined: Sun Jun 28, 2015 8:51 pm
Posts: 5
I wish it was easier to do this.


Top
   
 Post subject: Re: PHP 5.6 CentOS 7
PostPosted: Wed Jul 05, 2017 8:23 pm 
Offline
Senior Member
User avatar

Joined: Sun Jan 24, 2016 4:30 am
Posts: 189
The real problem is with the apps that require PHP 5.6.

There is no real reason to require 5.6 over 5.4, since their differences are can be bridged with little work. I would understand an app that requires 7.1, which comes with major changes, but in all honesty, an app requiring 5.6 is just bad development. Even as a managerial decision, a good manager will want to support a long term release as supported by CentOS, a major corporate distro. Especially when some corporate environments will refuse to upgrade or use alternative repositories.

_________________
:idea: I love my computer... all my friends live there.


Top
   
 Post subject: Re: PHP 5.6 CentOS 7
PostPosted: Wed Jul 05, 2017 10:57 pm 
Offline
Senior Member

Joined: Mon Aug 29, 2011 2:34 am
Posts: 214
Quote:
The real problem is with the apps that require PHP 5.6.

There is no real reason to require 5.6 over 5.4, since their differences are can be bridged with little work. I would understand an app that requires 7.1, which comes with major changes, but in all honesty, an app requiring 5.6 is just bad development. Even as a managerial decision, a good manager will want to support a long term release as supported by CentOS, a major corporate distro. Especially when some corporate environments will refuse to upgrade or use alternative repositories.
PHP 5.6 was released almost 3 years ago, and PHP 5.5 was released 4 years ago. Even Debian Jessie has 5.6. Having reviewed their respective migration guides, there are several items which are not simple or are impossible to implement in code that supports PHP 5.4. A couple examples are argument unpacking (expanding an array to an argument list) and timing attack-safe string comparison (I'd love to see you implement that in PHP; your implementation will be wrong in subtle ways you won't realize).

_________________
Disclaimer: I am no longer employed by Linode; opinions are my own alone.


Top
   
 Post subject: Re: PHP 5.6 CentOS 7
PostPosted: Thu Jul 06, 2017 4:53 am 
Offline
Senior Member
User avatar

Joined: Sun Jan 24, 2016 4:30 am
Posts: 189
You make the same assumption as my PCI DSS friends. You look at the version number and you think that is all that matters, when in fact that is not entirely the case. Redhat backports many improvements and fixes from newer versions into their official version, thus version PHP 5.4 in CentOS is not the same as the official PHP 5.4 that you download as a tar archive from php.net. I have the same argument with the PCI certification, when I try to explain that openssl 1.0.1e in CentOS has had a ton of backported fixes.

On the downside, the 10-year long term support by Redhat is not exactly 10 years. In the "small letters" (or in very clear a big letters if you find the correct page in their site), it is stated that those 10 years are split in 3 different parts. The first part is around 5 years and that is when you get most of the backports.

Anyway, for me there is no issue. Officially its 5.4 and if you want you can use Software Collections to support 5.6 or 7.

_________________
:idea: I love my computer... all my friends live there.


Top
   
 Post subject: Re: PHP 5.6 CentOS 7
PostPosted: Thu Jul 06, 2017 5:54 pm 
Offline
Senior Member

Joined: Mon Aug 29, 2011 2:34 am
Posts: 214
Quote:
You make the same assumption as my PCI DSS friends. You look at the version number and you think that is all that matters
No, I don't. I'm well aware of RedHat's bastardized creations from backporting specific features from newer releases. Just look at RHEL6's kernel; it reports it's 2.6.32, but the reality is that it's some frankenstein half 2.6.32 half 4.x kernel. And then there's when Linux 3.0 first released, and things like Mozilla's NSS build system threw errors because the kernel version didn't start with "2.6"; Fedora solved this by just changing the kernel version to 2.6.40, rather than fixing the check in NSS (among others).

_________________
Disclaimer: I am no longer employed by Linode; opinions are my own alone.


Top
   
 Post subject: Re: PHP 5.6 CentOS 7
PostPosted: Fri Jul 07, 2017 2:51 am 
Offline
Senior Member
User avatar

Joined: Sun Jan 24, 2016 4:30 am
Posts: 189
Oh, I forgot to mention that there are two ways to get updated packages (for PHP and others), Software Collection was mentioned above, which installs packages in PARALLEL with the old ones, another way is to use IUS which overwrites the old packages and keeps them up to date with regular updates.

It is an important difference, since Software Collections will add fixes but will not offer regular upgrades of the same package, instead they release a new "collection". But it may work better for people who want to keep the old version of the packages around the system.

You can see a comparison of the two here: https://ius.io/IUSvsSCL/

_________________
:idea: I love my computer... all my friends live there.


Top
   
 Post subject: Re: PHP 5.6 CentOS 7
PostPosted: Sun Jul 09, 2017 8:01 pm 
Offline
Senior Member
User avatar

Joined: Fri Jan 02, 2009 10:31 am
Posts: 163
Website: http://faroutscience.com
Location: Kansas / Texas
I know it is a kludge. I prefer CentOS.

I needed to install Moodle. Their newest version will not install without PHP 5.6.

None of the CentOS solutions seemed adequate. I deployed a small linode with Debian 8 and use that for the Moodle instance. It provides the added advantage of distributing the workload between two linodes.

Probably not the best option but it works until Redhat catches up with the rest of the internet world. (That seems to happen every couple of years.)

I should probably just migrate away from CentOS????

_________________
http://greersfos.com


Top
   
 Post subject: Re: PHP 5.6 CentOS 7
PostPosted: Sun Jul 09, 2017 9:00 pm 
Offline
Senior Member

Joined: Tue Apr 01, 2014 12:45 pm
Posts: 52
Website: https://centminmod.com
Location: Brisbane, Australia
For my Centmin Mod LEMP auto install which is CentOS only, I source compile PHP-FPM to support 5.5, 5.6, 7.0, 7.1 and 7.2 alpha and Nginx 1.13.x mainline with features supported newer than what Ubuntu/Debian side can provide :)

PHP 5.6.31 https://community.centminmod.com/thread ... ble.12215/

But for multiple PHP-FPM version support I am working on, looking at Remi YUM repo for PHP 5.6, 7.0, 7.1 and 7.2 alpha to install side by side with my source compiled PHP-FPM.

Demo at https://community.centminmod.com/thread ... iew.11900/

and https://community.centminmod.com/thread ... ha3.12211/

so check it Remi at https://rpms.remirepo.net/ and https://blog.remirepo.net/post/2017/07/ ... -and-7.1.7

_________________
* Centmin Mod Nginx menu based auto installer (Nginx, PHP-FPM, MariaDB MySQL) :: Centmin Mod LEMP Stack - What's New


Top
   
 Post subject: Re: PHP 5.6 CentOS 7
PostPosted: Mon Jul 10, 2017 4:49 am 
Offline
Senior Member
User avatar

Joined: Sun Jan 24, 2016 4:30 am
Posts: 189
CentOS is a real server operating system, much better geared for an internet server, so I'm sticking to that. I tried Ubuntu, but it always feels like its struggling to hide that its actually a desktop system, I understand that kids these days prefer Ubuntu because its popular and comes preinstalled with laptops, but it just couldn't cut the cheese.

Remi is a good and reliable repo, highly suggested. His PHP packages will replace the old CentOS packages and we know that upgrades are frequent and kept up to date.

_________________
:idea: I love my computer... all my friends live there.


Top
   
 Post subject: Re: PHP 5.6 CentOS 7
PostPosted: Fri Aug 18, 2017 12:55 am 
Offline

Joined: Fri Aug 18, 2017 12:54 am
Posts: 1
thanks


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
RSS

Powered by phpBB® Forum Software © phpBB Group