This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Upgrading PHP Version?
#1
Upgrading PHP Version?
Hello,

I'm trying to install Moodle 3.2 for a demo project but it requires "at least PHP 5.6.5". I am running Sentora 1.0.3 with PHP 5.4.16 on a CentOS 7.3.1611 (Core) install.

I did a bit of searching on the forums and there was some discussion about a Ubuntu install and issues surrounding Suhosin, but it seemed to go unresolved. Rather than hijack an old post, I figured it was better to post here.

Is there an easy way to upgrade the PHP version or is this not possible at this time?

Thanks!
Gordon
Reply
Thanks given by:
#2
RE: Upgrading PHP Version?
In one word, no. What is it they say, with great power comes great responsibility? I am running CentOS 6 and 7 servers with php5.6.30+ on them. You are right about the situation with Suhosin - it must be compiled as it will not be included for the update.

To start you out I must tell you this is not supported and for good reasons.  I will try and expand on them later...

This "works" to get you started.

The consequences of doing so are great. If you follow that guide, make sure after you have upgraded, you manually compile Suhosin.

This will show you how to compile Suhosin.

Keep in mind when you upgrade to php5.6.x there is a new way of enabling extensions - they are no longer enabled in the php.ini file. I touch on this in my Suhosin compiling post. So this means while you may be able to get that extra "php_awesome_module" installed with the remi repo, the right thing to do is compile it - then you keep just the enabling command in the /etc/php.d ini files. Looking at one of my servers now I see that I should have compiled the two cache packages and accidentally used the remi repo, so all of the instructions are in the ini files in the /etc/php.d files for them. Php5.6 parses the /etc/php.d files for enabling all of your extensions. (No more need to edit the php.ini directly at least for modules...)

I cannot emphasize enough what this upgrade path will do for your system.

DO NOT modify the remi repo files and enable php5.6 - if you do that your system will be broken beyond repair in short order. You also need to use some method of keeping the OS from updating certain packages when you do need to run yum with remi enabled. ALWAYS DO THIS MANUALLY IN YOUR YUM COMMAND! Like this:

Code:
yum --enablerepo=remi,remi-php56 install such_and such_package

This way you see what is going on and can head off problems at the cli and not later after things are all broken. And it also is required; for if you try to install anything that needs a php5.6 package to be updated or installed, the output of your yum command will be a pile of conflict errors.

You need to pay close attention to what the OS wants to update when you do enable remi in your yum statement. You will find after upgrading and depending on what sort of other repos you have installed, that you may need to exclude some updates as they may break or conflict with critical Sentora packages. I use the exclude command in the repos because I am lazy... The right thing to do is likely use yum priorities for this - but I found that to be very difficult and not guaranteed.

And don't forget. When you go to install a package with yum, if there is an accompanying php update, you will see all sorts of conflicts when you try and run yum. If one of the things in the list is a php module of some sort, you will need to manually enable remi in your yum statement as noted above and try again.

The bottom line is this. I needed the updated php just as you do for a dependency. So I took a deep breath and dove in. What the developers here will tell you and rightfully so is that by doing this, changes they make to the Sentora package may end up becoming completely broken because their expert work is based on the older, but default (and supported by back-porting) php versions that come packaged with CentOS Ubuntu or the like.

Off the top of my head, perhaps you might want to first search for doing the update with I believe it is the SCL repo? I have heard but not tested this and it may be less troublesome Huh . I have no data on that...

If you have specific questions, I (and perhaps others) will try and help you, but I think I gave you enough here to get the job done, or blow it up trying.

LAST WARNING --> This is not supported in the least by the developers! Good luck, and don't fret most of it sounds more intimidating than it really is in the end.

Oh, I almost forgot to mention the obvious to me and maybe not to others is you must have Sentora up and running in CentOS with its native php version BEFORE upgrading. You cannot install php5.6 and then try and install Sentora, it will not allow it.
Everyone makes mistakes, but to truly screw up it takes the root password!
Reply
Thanks given by:
#3
RE: Upgrading PHP Version?
Run command!

# rpm -Uvh https://dl.fedoraproject.org/pub/epel/ep...noarch.rpm
# rpm -Uvh https://mirror.webtatic.com/yum/el7/webt...elease.rpm
# yum install yum-plugin-replace
# yum replace php-common --replace-with=php56w-common
# cd /tmp
# wget -nv -O suhosin.tar.gz https://download.suhosin.org/suhosin-0.9.38.tar.gz
# tar -xvzf suhosin.tar.gz
# rm -f suhosin.tar.gz
# cd suhosin-0.9.38
# phpize &> /dev/null
# ./configure &> /dev/null
# make &> /dev/null
# make install
# cd ..
# rm -rf suhosin-0.9.38
# php -v
AWServer I'm, Returned!

Reply
Thanks given by:
#4
RE: Upgrading PHP Version?
Good deal. Great post. It is nice to just up and post the steps - with no explanation of what it will mean to the server's everyday business...

And BTW, your procedure inevitably ends up in failing due to dependency issues with php.
Everyone makes mistakes, but to truly screw up it takes the root password!
Reply
Thanks given by:


Possibly Related Threads…
Thread Author Replies Views Last Post
[split] Can Not Log Into PHPMyAdmin or Webmail after upgrading to PHP 7.1.24 ogika 2 5 ,097 09-14-2021, 06:25 AM
Last Post: sparkrack
How to run multiple version PHP with Apache (use Sentora panel) on Centos ??? BigBang 4 9 ,340 12-23-2020, 03:31 PM
Last Post: djkashdui1
Upgrading phpmyadmin testing 0 2 ,584 07-04-2020, 05:26 AM
Last Post: testing

Forum Jump:


Users browsing this thread: 1 Guest(s)