Virtualmin + CentOS 7 + PHP7 the right way?


I did a couple of tries to get PHP7 working 100% correctly on VirtualMin, but I failed.
What are the official instructions (if they exist) to get Virtualmin working 100% correctly with CentOS and PHP7? I prefer the Software Collections way, (so you be able to switch!)
I tried lots of guides and tutorials, even older ones which are pre-virtualmin 5. Now Virtualmin 5 exists and it problably changed. I am looking for the best way, I hope someone can help! (Virtualmin + CentOS or Debian is no problem, just PHP7!)

What I tried:
CentOS7 minimal install. Yum update/upgrade. Reboot
Setup ssh.
Install Virtualmin.
yum install
yum install
yum install php70

Virtualmin detects PHP7 and I choose it as default. But Apache fails to start after installing and choosing PHP7.
Maybe this isn’t the right way. I hope someone can tell me the best way.

Thanks in advance!


I would actually try installing PHP 7 alongside your existing PHP version using the software collections repository.

I wouldn’t recommend any third party repositories, as those can cause some trouble.

If you have trouble using the software collections repository, let us know the details of the issue you’re seeing.

Also, there’s details for using the software collections repo here:

Thanks for your fast reply.
I tried it again and it’s working now.

This is what I did:
I used Remi repo and PHP7 seems to work perfect. This is what I did (if someone sees something bad, just say because I am not an 100% sure if it is perfect, but here it works).

yum install scl-utils yum install yum install yum install php70 yum install php70-php-mysqlnd yum install php70-php-curl yum install php70-php-simplexml yum install php70-php-devel php70-php-gd php70-php-json php70-php-mcrypt php70-php-mbstring php70-php-opcache php70-php-pear php70-php-pecl-apcu php70-php-pecl-geoip php70-php-pecl-imagick php70-php-pecl-json-post php70-php-pecl-memcache php70-php-pecl-xmldiff php70-php-pecl-zip php70-php-pspell php70-php-soap php70-php-tidy php70-php-xml php70-php-xmlrpc

With this you have PHP7 and all important extensions running next to the other PHP versions!
If anyone sees room for improvement, then I am very interested. Would be good information on this topic.
And I know it would be better to not use third party repos, but I could not find PHP7 for CentOS 7.2 then. Is it correct you only can get this with a third party (Remi) repo?
Also I hope it wasn’t a bad choice to choose this repo.

So if i understand you right php70 works for you now when you run this commands?

Yes, after these commands it was installed properly and it’s running very well!

I am really happy with VirtualMin (and PHP7).

I installed PHP7 on Centos 7 with NGINX. Then installed Virtualmin/webmin pro. After some debugging everything appears to be working except use of PHP 7 as the default PHP version. I have PHP 5.4.16 and PHP 7 (as per latest update) installed. Virtual servers or sub-servers that are set up using (default) server template with highest PHP version selected results in the server(s) beinng setup using PHP 5.4.16 rather than PHP7. Attempts to select the PHP version using Server Configuration> PHP Versions results in the mentioned
Website options cannot be edited, as no Apache virtual host for port 80 was found!” message.

I am considering uninstalling PHP 5.4.16 or, alternatively, upgrading that version to a later PHP 5 version that is compatible with PHPMyadmin, Joomla, and other application scripts that require higher than 5.4.

Advice on how to proceed to fix this impass would be appreciated.

I got everything working on Ubuntu 16.04 with this,

I suggest you installing Virtualmin first with the script and then installing Nginx. I don’t have much experience with CentOS, but I think the default php version is 7. But I might be wrong.

guys centos is not working properly with standard install… even from forums posts - why bother to support it at all… it does not meet requirements even after fresh install… php7 is buggy and not officially released yet @ freddy63… means you will have a troubles.

Ubuntu 16.04 now ships with PHP 7. I’m using PHP 7 on my Ubuntu 14.04 server. It’s working I don’t have a doubt about that.

Centos fine with me.

ah I see… well, as I said its not ready , was not released yet to be used as an stable and if you will have look around net and this forums - you will found out that it is not working very well… :slight_smile: I would say, if your standard php version shipped with your os is working then use that… no issues at all… good luck.

But I installed Virtualmin yesterday on Centos7 wthout any issues

Centos is the most widely used linux for servers … it is slower to officially support new capabilities because stability is prized and, probably, because of inertia. I have PHP7 working on Centos 6.8 without any problems and with wider support for applications than PHP5.x However, I thought it was time to shift to Centos 7 as it has been out for some time, over a year and a half and it comes with MariadB. The major problem is lack of experience on the platform including lack of documentation for specific software stacks such as Centos 7, MariadB 10, NGINX, PHP7 with Virtualmin/Webmin/Cloudmin.
It looks like the issue I am having has to do with sequence of installation. I will first try uninstalling PHP 5.4 and PHP 7 and then reinstall PHP7. That may not be the best or easiest thing to do but I am curious to see if it works. Then I will do a fresh install of Centos 7, install needed repos and upgrades, and then follow the sequence that others have found to work. If I find irregularities or information left out, I will feed that back.

Get a server running fine with PHP7 is one thing, what about the software like web scripts etc etc.

Would love to know scripts that are running fine with PHP7

I currently have upgraded to php 7 , and as of right now , the scripts don’t work or upgrade as they are all wanting to use php 5.X dependencies.

Not sure if there is a fix for this.


PHP should work on any supported distro out of the box.

As far as using PHP7 – PHP7 is indeed supported. It comes with Ubuntu 16.04 by default.

However, switching from PHP5 to PHP7 on an existing domain may require some tweaking. You might want to try switching the PHP Execution Mode to something like mod_php, then back to FCGID – which will re-generate the Apache config and PHP wrapper scripts.

However, I wouldn’t just upgrade to PHP7 on CentOS. Instead, I would install it side-by-side with the existing PHP version, which can be done with these instructions here:

Now, to my knowledge PHP7 isn’t yet available in that repo… but there’s a test version of that available, which is described here:

Just an update , switching the PHP Execution Mode to something like mod_php, then back to FCGID, worked. and everything updated.

Thank you

My experience with PHP7 is limited to Joomla 3.6.2, PHPmyAdmin. All J extensions work.

I’m chiming in here because I am having a related issue. I posted a thread here :

I have CentOS 7.2 / Virtualmin , PHP 5.4.16 (BASE PHP) / same as outputted on php -v (terminal) and it’s the only PHP version that is displayed in any of my Virtual Server’s phpinfo.php file. The re-check configuration doesn’t detect php71* packages which are installed successfully. But even disregarding the PHP 7.1 detection…

I have my Virtual Servers setup for a PHP 5.6.5 template and it’s only outputting PHP 5.4.16 … I even tried the above solution for Switching Website Options on each Virtual Server to mod_php and then back to FCGID, saved, restarted httpd & php-fpm . No Dice.

Anything would be greatly appreciated.

Thanks Elite Linux Badasses :slight_smile:


I found a tutorial here:

Then hit the terminal and knocked these keysets out:

  • systemctl stop php-fpm
  • systemctl disable php-fpm
  • systemctl start php71-php-fpm start
  • systemctl enable php71-php-fpm

[root@MaximumLightning brandon]# php -v
PHP 7.1.0RC1 (cli) (built: Sep 1 2016 14:09:54) ( NTS )
Copyright © 1997-2016 The PHP Group
Zend Engine v3.1.0-dev, Copyright © 1998-2016 Zend Technologies

And phpinfo.php outputs as the following: (on the PHP 5.6.5 configured Virtual Server)

PHP Version 7.1.0RC1

… Guessing Solved. However, I don’t know how versatile this is or if it’s proper.

Hope it helps someone.

P.S: In Virtualmin , when I run Re-Check configuration it outputs :

The following PHP versions are available : 5.4.16 (/bin/php-cgi), 5.6.5 (/opt/rh/php56/root/usr/bin/php-cgi)

Not even acknowledging the installed and active PHP 71.0RC1

Anyone? :slight_smile: