PHP upgrade - yes/no?

I just wonder, I run VPS with CentOS 6.5 x86 (not 64) and face the issue that some software is not upgradeable because of PHP 5.3.3

Will an upgrade to PHP 5.6.* (or PHP 7..) have any effect on Webmin? The idea of upgrading php scares me a little…

Howdy,

It’s good to be cautious there, as there’s ways that upgrading PHP can cause some pretty big issues. In particular, we’d recommend caution in using third party software repositories.

Give this here a try though, this is a way to run a newer PHP version side-by-side with your existing PHP:

https://www.virtualmin.com/documentation/web/multiplephp

I am a bit scared and don’t want to spend the next week correcting my errors. You page is just to PHP 5.6. I do fancy PHP7.0.* (latest stable is 7.0.6)

How das that look:

yum install scl-utils rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm yum install php70w php70w-opcache

The setup in virtualmin is clear so far.

Two more Q.:

  1. The link mentioned ‘multiple’ - I can try more then 2 PHP versions?

  2. It said ‘works best with 64 bit’ - I have the 32 bit version - will it still work?

If the never PHP version works I would remove the older one(s) eventually.

I think you’re setting yourself up for a world of hurt there:

  1. The webtatic repo always seems to have issues working with other repos - really, if you want to install alternate versions of PHP you’re probably best off updating from software collections or the REMI repo which are really much more reliable. Also the webtatic repos are intended to be REPLACEMENT versions of PHP — not different versions running in parallel like the software collections/REMI versions can do. Doing what you suggest will in fact not work very well, will replace PHP with the newer version entirely (actually I suspect your install won’t work unless you delete all your current PHP first anyway).
  2. That being said, the better repos really don’t support 32-bit systems any more — Red Hat’s support of 32-bit systems is slowly disappearing, and therefore support in CentOS is doing the same.
  3. Yes, you can support any number of PHP versions if you use repo versions that are built with that in mind – as is suggested in the Virtualmin article referenced… You won’t be able to do that with webtatic. We currently are supporting PHP 5.5, 5.6, and 7. But most of our users can’t really use 7 with their code.
  4. There are a LOT Of compatibility issues with just moving to PHP 7 – you’ll find that quite a lot of older code just will not run properly under PHP 7 — which is why having multiple versions available is a really useful thing.
  5. You might want to read the CentOS Wiki page about repositories at https://wiki.centos.org/AdditionalResources/Repositories?highlight=(repositories)
    My advice? bite the bullet. Build a new server using CentOS 7 and 64-bit. That will give you a new stable environment with a base version of PHP that is old enough that you’ll probably not cause a ton of compatibility problems. Move your domains to the new server and check that they’re okay. Then think about installing some of the newer PHP versions in parallel. But that’s just me.

@cruiskeen
Thanks for that gloomy reply. I prefer that over the no problem approach.

CentOS 64 is no option right now. I just run a few private domains and 64 bit is (from my experience) a bit more RAM hungry. I just run 1Gb though (on an otherwise fast VPS). More RAM will be quite more expensive.

Here is my question:

Is there any way to get a (any) switchable PHP that is better then 5.3.3 on my CentOS 6.5 i386 ?

Howdy,

Ah, with 32 bit CentOS, that is a bit trickier.

Can it be done? Yes. But there isn’t a supported or recommended way.

The only way to do that would be to install packages from a third party repository – and that can cause a variety of problems. So much so that we recommend against that, unfortunately.

Is migrating to another server a possibility? You could always setup a 64 bit server, and migrate your domains over to it. At that point setting up multiple PHP versions would be simpler.

-Eric

Thanks for the reply. I prefer a very stable system, so I prefer safe repos.

Is migrating to another server a possibility?

My VPS offers 30 or so different OS to chose from, incl. some CentOS-64 version. I wonder if that is advisable with just 1Gb RAM? And then the horror of installing the wholse system again incl. webmin etc., setting up all mail accounts…

I have some problems now. I installed PHP 7.0.6 from IUS. Removed 5.3.3 first. It went smooth.

Then…:

[root@vps ~]# service httpd restart Stopping httpd: [ OK ] Starting httpd: Syntax error on line 1048 of /etc/httpd/conf/httpd.conf: Invalid command 'php_admin_value', perhaps misspelled or defined by a module not included in the server configuration [FAILED]

// I think that’s Webmin related, so…

[root@vps ~]# yum install mod_php70u

// apache error log:
[warn] RSA server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[warn] RSA server certificate wildcard CommonName (CN) `*.domain.com’ does NOT match server name!?

Apache starts now without error. Webmin works fine. Domains work only when the are in HTML, so most domains trigger that Apache error.

What can I do next?

Update:
The SSL error isn’t really related to that no show problem.
To be a bit more specific: *.html page display fine, but *.php get downloaded rather then displayed.
but domain.com:10000 & domain.com:20000 work fine. Send and receive mails is no problem too, incl. pop.

There’s likely a couple of problems there. Try switching PHP execution mode (e.g. CGi vs. FCGI, vs. mod_php) in Virtualmin first; this might trigger the right handlers and such getting put into place. You can switch back to your preferred execution model (I recommend fcgid) afterward; we’re just switching it to get Virtualmin to regenerate the configuration for the right PHP version.

If that doesn’t do it, it might need some manual poking in the config files. Probably /etc/httpd/conf.d/php.conf or similar. Getting rid of any SetHandler lines in there (if you’re using mod_fcgid) might be necessarily, as those are generally setup for mod_php.

If it’s not apparent after poking at it in this way, we’d need to see the php.conf in the Apache config dir (not the php.ini, that’s not relevant here), and the fcgi files in your domain home directory, as well as the configuration in httpd.conf for the domain in question.

Hi Joe,
I did solve that issue. I made actually a new topic because it’s a bit off this topic.

https://www.virtualmin.com/node/40813

The PHP 7 upgrade set the Engine Value to ‘Off’

Webmin > Server > Apache > Existing Virtual Host > virtual server > PHP > PHP Admin Configuration Values > Engine > On

All fine and sweet now. Potential PHP 7 upgraders should be aware that some websites may not work. My old Drupal i.e., or Bolt.cm (wonderfull CMS!) 2.0 and older.