Upgrace to PHP 7.2 on Ubuntu 14.02

I got myself into some soup here…

we took our Hinduismtoday.com site, which is running on a linode server and under VirtualMin Control/setup

I created another Linode instance it has IP… we cloned the old site onto this new instance. All i had to do was change the IP in


and bingo, site (running on XOOPS) was up and available and working perfectly on this new “box”

OK next step was to upgrade PHP to 7.2 I went through all the steps, installed the PPA, ran apt-get, even sudo a2dismod php5 sudo a2enmod php7.2

in the /home/htoday/etc/php/php5.ini (default)

I try to hack the upgrade to php7.2 with this change to point to the new includes in that ini file

; extension_dir = /usr/lib/php5/20121212

extension_dir = /usr/lib/php/20170718

But… no go. restarted apache throughout this process (several times) but still Apache thinks we are running php5.5.9 and phpinfo() also says we are running php5.5.9

I am able to get in to VirtualMin on this new IP, but and if we look at PHP Versions. it only shows 5.5.9 and then 7.1.8 but we have 7.2 also installed.

php -v shows PHP 7.2.0beta2 (cli) but of course we know that’s not way Apache2 is using…

I selected 7.1.8 in the VM control panel

but now it would only offer to download

application/x-httpd-php (3.7 KB)

Going back to Virtual min in the Manage PHP configuration we see (of course)


So we are missing something simple here… how do we get VM to see and Apache2 to use 7.2?
I rebooted the box, restarted apache (many times throughout the process) but we are missing something

Don’t enable the php module using a2enmod. You don’t want mod_php under any circumstances. You want mod_fcgid or php-fpm.

So…we just need to convince Virtualmin this new version exists. The code for that detection has changed a bunch since it was introduced (it has to deal with like 20-30 different combinations of PHP versions and paths and such, it’s a nightmare), so I don’t know exactly where it could be going wrong. I’ll have to poke at it. I’m gonna be testing installs on 14.04 today, anyway, because php7 installation is failing there with the new installer, so I’ll have a chance to look at that.

“Don’t enable the php module using a2enmod. You don’t want mod_php under any circumstances. You want mod_fcgid or php-fpm.”

Hmm. but I went back in and ran

locate mod_php.so and the file is not on the box.

but I do see:


is there and so i assume, enabled. But we are stuck now… I’m nervous about make more changes from the command line when I don’t know what I am doing :slight_smile:

You can disable any module you’ve enabled with a2enmod with a2dismod. :wink:

I’m not sure why your new PHP isn’t being detected. There’s so many PHP versions and paths that the code that detects it is stupid hairy. I’ve begun to standardize some in the Virtualmin 6 installer, where we install our preferred PHP7 packages on each distro (still all different and we still probably have problems finding them all and setting them all up correctly, but we need to sort that out one platform at a time).

Also, above, it sounds like you were following our docs for installing PHP7, but I didn’t think our docs would include a2enmod php; was that improvisation, or do I need to fix our broken docs? :wink: (I mean, I know I need to fix our broken docs in a lot of places, but does it have this problem in the PHP7 docs?)

Oh, and I meant to ask: What is the path to the php, php-cgi, and php-fpm binaries in the version you installed?