SOLVED Question on using php 7 on single domain

Operating System & Version
CentOS 6
cPanel & WHM Version
v84.0.21

nootkan

Well-Known Member
Oct 25, 2006
146
9
168
I have a CENTOS 6.10 v84.0.21 with easyapache 4 and php 5.6 on my server and I want to have php 7 set up for two domains only. I tried to do this inside whm>>software>>MultiphpManag er and was told to install php-fm which I did. I then refreshed and tried to change the domains to php 7 that I wanted but the option to do so isn't there (only php 5.6 and inherit). What did I miss-understand?

Update: I created a new profile adding php 7.2 and 7.3 with all extensions to my existing profile and this gave me the options to change the domain to php 7.2 or php 7.3 but when I set the domain to either one I got a 500 server error when going to the domain. I decided to change back to my original profile until I understand this better or get some advice from one of you who is better experienced at the mulitphp manager feature.

I've read through the documentation at MultiPHP Manager for WHM | cPanel & WHM Documentation but will wait to hear from someone here about what I am doing wrong or misunderstanding. Thanks in advance.
 
Last edited:

quietFinn

Well-Known Member
Feb 4, 2006
1,332
141
193
Finland
cPanel Access Level
Root Administrator
Update: I created a new profile adding php 7.2 and 7.3 with all extensions to my existing profile and this gave me the options to change the domain to php 7.2 or php 7.3 but when I set the domain to either one I got a 500 server error when going to the domain. I decided to change back to my original profile until I understand this better or get some advice from one of you who is better experienced at the mulitphp manager feature.
You don't need to create a new profile, click the Customize button and add PHP 7.2 & 7.3, it will ask if you want the same extensions as in PHP 5.6.

When you get the 500 error look in /etc/apache2/logs/error_log, it should give more info about what is causing the error.
 

keat63

Well-Known Member
Nov 20, 2014
1,916
263
113
cPanel Access Level
Root Administrator
When you install 7.2/7.3, there may be additional modules to apply.
In my experience, it doesn't come fully configured out of the box.

Using Easy apache, look at your 5.6 profile.
Make a note of which modules and extensions you have.
You might have to write these down.

When you compile your new 7.x profile, apply the same modules/plugins as your 5.6 install.


So long as you don't modify your existing 5.6 profile, then there's no need to restore your old profile if something doesn't work.
As once the newer versions are installed, you can switch between versions on the fly.

Be aware that some php functions may have been depreciated in 7.x, you may find that PHP scipts which run happily on 5.6, might not run on 7.2.
PHP 7.1 has a little more comaptibility with 5.6, but even then, you may run in to coding errors.
And 7.1 is now end of life.

Also how log did you wait for those 500 errors to clear.
when switching profiles, there will be a short delay for the new versions to take effect.
I've no idea what the official stance is on this, but on my server it takes a few seconds, and a browser refresh
 
Last edited:
  • Like
Reactions: nootkan

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,271
313
Houston
Both of these responses are valid - I'd especially recommend you check the error log for the specific cause of the 500 error you're receiving.

Also how log did you wait for those 500 errors to clear.
when switching profiles, there will be a short delay for the new versions to take effect.
I've no idea what the official stance is on this, but on my server it takes a few seconds, and a browser refresh
The only wait time there should be is when the services restart and that would vary depending on the number of domains you're loading/server load
 
  • Like
Reactions: nootkan

nootkan

Well-Known Member
Oct 25, 2006
146
9
168
Hi all and thanks for the replies. Sorry I should have stated that I saved my original profile with a new title and then customized my original profile with the newer versions of php not created a new one.

I've followed the suggestions and see these errors in my log files:

client denied by server configuration - I am assuming this has to do with the error below.

missing required mysql extension required by wordpress (this one showed up when I tried to browse to the website) - Seems maybe mysql lite (php 5.6) isn't the right extension but I can't find how to upgrade it inside easyapache 4 like I could with easyapache 3.

I am planning to migrate to a new server soon but thought I'd see how everything works with the newer versions of php using easyapache 4.

I do have some older scripts that won't work with the newer versions of php but they are on a different domain than the one I am trying to use php 7.2 on.
Hence the stalling to migrate until I track down the developer and get him to upgrade his scripts for me.

I'll keep plugging away until I figure this out. Might have to do a yum upgrade to mysql, but not sure.

As always thanks for the support, much appreciated.
 
  • Like
Reactions: cPanelLauren

nootkan

Well-Known Member
Oct 25, 2006
146
9
168
Okay I got this resolved. Keat 63 was right there were some extra modules I needed to install. Not to mention a whole bunch of php coding errors and warnings for some themes/plugins that needed to be addressed with the new php 7.2.

Contacted the plugin/theme developers and fixed some myself but everything seems to be working now. Thanks again for all the support and advice. Really like this new apache 4 feature allowing us to switch between php versions.

Tried to mark this as resolved but don't see that option anywhere.
 
  • Like
Reactions: cPanelLauren