Submitted by -eclipse- on Wed, 01/11/2017 - 12:07 Pro Licensee
Hi
I have installed 5.6 using the guide here. https://www.virtualmin.com/documentation/web/multiplephp#toc-installing-... Then I have tried to run the replace command. yum replace php-common --replace-with=rh-php56-php-common
But when I try to run php -v it doesn't get the command. When trying to restart the httpd service it can't locate the php process
What do I miss here? I am running Centos 7.
PS. To get the yum-replace-plugin installed I followed the following. To use the IUS packages in CentOS 7:
- Install EPEL and IUS repositories:
- Install yum-plugin-replace and replace the php packages with php56u packages:
- Restart any services which depend on php, such as httpd.
- Tim
Status:
Closed (fixed)
Comments
Submitted by andreychek on Wed, 01/11/2017 - 12:36 Comment #1
Howdy -- the instructions on the Virtualmin site are for installing a second PHP version side-by-side with your existing PHP version.
In that case, you don't need to remove or replace anything.
You would then have a second PHP version, which should be detected when going into System Settings -> Re-Check Config. You would have a new PHP binary you could call when you need access to the other PHP version.
Submitted by -eclipse- on Wed, 01/11/2017 - 12:40 Pro Licensee Comment #2
Hi
Thanks, I am aware, but I want to replace the core PHP with the new PHP 5.6 repo, is that possible?
Submitted by -eclipse- on Wed, 01/11/2017 - 12:46 Pro Licensee Comment #3
Hi
I managed to replace the 5.4 with the 5.6 using the following guide :) https://www.mojowill.com/geek/howto-install-php-5-4-5-5-or-5-6-on-centos...
You can close this support request.
Yes you can use remi repo on Centos for this purpose:
https://rpms.remirepo.net/wizard/
Submitted by -eclipse- on Wed, 01/11/2017 - 13:11 Pro Licensee Comment #5
Hi Mostafa
Did the above, php 5.6.29 is installed and ioncube 5.6 is enabled. Apache seems not to use the PHP though, when I open a webpage it downloads the index file. So what settings are I missing to be able to compile the PHP files?
To fix the download issue, open the file /etc/httpd/conf.d/php.conf and comment out
SetHandler application/x-httpd-php
and restart apacheYou should also run Recheck-Configuration in virtualmin and make sure that everything is fine there.
Submitted by -eclipse- on Wed, 01/11/2017 - 13:24 Pro Licensee Comment #7
Hi Mostafa
All looks fine when running the "recheck-configuration". I will try to add the sethandler and get back to you.
Submitted by -eclipse- on Wed, 01/11/2017 - 13:26 Pro Licensee Comment #8
Hi
It's already commented out in the php.conf file.
Submitted by -eclipse- on Wed, 01/11/2017 - 13:26 Pro Licensee Comment #9
Here is the result of the recheck configuration. The following PHP versions are available : 5.6.29 (/bin/php-cgi)
Submitted by andreychek on Wed, 01/11/2017 - 13:30 Comment #10
I just want to clarify, we don't recommend using third party repositories for what you're describing, as we've seen a number of issues with that.
Mostafa's advice is how some folks accomplish that, though we've seen problems with packages from repositories such as that one which cause problems during some updates.
So if you want to use a repository other than the SCL repo, you can do that, but we recommend caution when doing so... and if you can make snapshots of your server (ie, if it's a VPS), we'd recommend that :-)
Submitted by -eclipse- on Wed, 01/11/2017 - 13:31 Pro Licensee Comment #11
So if I use the SCL repo for the replacement of the PHP version 5.4 it would work?
Submitted by -eclipse- on Wed, 01/11/2017 - 14:01 Pro Licensee Comment #12
I just want to replace the base PHP 5.4 with 5.6.x to be able to get WHMCS version 7.x working correctly.
Submitted by -eclipse- on Wed, 01/11/2017 - 14:15 Pro Licensee Comment #13
The problem is that the base system PHP is still 5.4 even though I install the 5.6 version from the SCL repo. That gives me some problems running CRON jobs in WHMCS.
Submitted by andreychek on Wed, 01/11/2017 - 14:47 Comment #14
We don't recommend replacing PHP, and the SCL is not designed to do that.
What we suggest doing is installing a second PHP version, and have WHMCS use that second PHP version.
It sounds like in your case, that your cron jobs aren't using the second PHP version, and that is fixable.
You'd either want to not call PHP scripts directly from cron -- instead, call them via Apache with something like:
@daily wget mydomain.com/whmcs/admin/cron.php
Or, if you have a script that's being run like this:
php -q /home/domain/public_html/whmcs/admin/cron.php
Modify the command line to use your preferred PHP version, something like:
/path/to/php56 -q /home/domain/public_html/whmcs/admin/cron.php
@andreycheck Remi repo also supports multiphp the same way as SCL does
I remember that I had that download issue once when upgraded the base php packages however I could manage to fix it, and iirc it has something to do with php.conf file. wish we could find the reason this time and add it to the documentation for future references. This is actually one important feature that I LOVE about Virtualmin (and you don't find it on other panels e.g. cpanel, directadmin, plesk, ...) that Virtualmin manages what you have on your system, and you are not limited to just use a particular repository.
Submitted by -eclipse- on Sat, 01/14/2017 - 11:03 Pro Licensee Comment #16
Hi both
I already have the second PHP version 5.6 running. My basic question was if it was possible to replace the PHP base version, the 5.4 is quite old already.
I have managed to fix the WHMCS issue using the multiple PHP installation.
Submitted by andreychek on Sat, 01/14/2017 - 12:05 Comment #17
There isn't a Virtualmin-supported way to do that unfortunately.
There are ways to accomplish it, such as using third party repositories -- but we would recommend either using two PHP versions, or upgrading your distro to a more recent distro.
Submitted by -eclipse- on Sat, 01/14/2017 - 13:45 Pro Licensee Comment #18
Hi Eric
Thanks for your answer. I will leave it here until a newer version, hopefully, soon will be out on the officiel channels.
Submitted by -eclipse- on Sat, 01/14/2017 - 13:46 Pro Licensee Comment #19