The problem was that the line at /usr/share/webmin/virtual-server/php-lib.pl:34:
local ($dir) = grep { $->{‘words’}->[0] eq $pdir ||
$->{‘words’}->[0] eq $pdir."/" }
&apache::find_directive_struct(“Directory”, $vconf);
Directories of the form /home/*/public_html
don’t match. I replaced the asterisk with the virtual server name and things worked again.
Moreover, at line 54, there is:
return ‘mod_php’;
Which executes if there is no match in the virtual server’s directives above – which explains how I could be getting a “mod_php” when apachctl reported no php modules at all.
------ The original question follows -----
Installed multiple versions of PHP with the packages.sury.org/php/ repository.
php
php php5.6 php5dismod php5-fpm php7.0 php-cgi phpdismod phpquery
php5 php5-cgi php5enmod php5query php7.1 php-cgi7.0 phpenmod
php -v
PHP 5.6.30-0+deb8u1 (cli) (built: Feb 8 2017 08:50:21)
Copyright © 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright © 1998-2016 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright © 1999-2016, by Zend Technologies
update-alternatives --set php /usr/bin/php5
However, Virtualmin -> Install Scripts -> Wordpress still reports
This script cannot be installed, as it requires PHP version 5.
And Virtualmin -> Server Configuration -> PHP Versions reports:
This virtual server is using the mod_php execution mode for PHP, such does not allow per-directory version selection.
I installed the php repo that supports multiple versions with:
#!/bin/bash
# To add this repository please do:
if [ “$(whoami)” != “root” ]; then
SUDO=sudo
fi
${SUDO} apt-get install apt-transport-https lsb-release ca-certificates
${SUDO} wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
${SUDO} sh -c ‘echo “deb https://packages.sury.org/php/ $(lsb_release -sc) main” > /etc/apt/sources.list.d/php.list’
${SUDO} apt-get update
The installed php packages:
apt list --installed |egrep ‘php(5|7)’
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
libapache2-mod-php5/now 5.6.30+dfsg-0+deb8u1 amd64 [installed,local]
libapache2-mod-php5.6/unknown,now 5.6.30-11+0~20170522123046.34+stretch~1.gbp3d9cea amd64 [installed,automatic]
libapache2-mod-php7.0/unknown,now 7.0.19-1+0~20170522122642.31+stretch~1.gbpfcdab8 amd64 [installed,automatic]
libapache2-mod-php7.1/unknown,now 7.1.5-1+0~20170513113444.24+stretch~1.gbpe4bc94 amd64 [installed,automatic]
php5-cgi/now 5.6.30+dfsg-0+deb8u1 amd64 [installed,local]
php5-cli/now 5.6.30+dfsg-0+deb8u1 amd64 [installed,local]
php5-common/now 5.6.30+dfsg-0+deb8u1 amd64 [installed,local]
php5-fpm/now 5.6.30+dfsg-0+deb8u1 amd64 [installed,local]
php5-gd/now 5.6.30+dfsg-0+deb8u1 amd64 [installed,local]
php5-json/now 1.3.6-1 amd64 [installed,local]
php5-mcrypt/now 5.6.30+dfsg-0+deb8u1 amd64 [installed,local]
php5-mysqlnd/now 5.6.30+dfsg-0+deb8u1 amd64 [installed,local]
php5-mysqlnd-ms/now 1.6.0-1+b1 amd64 [installed,local]
php5-readline/now 5.6.30+dfsg-0+deb8u1 amd64 [installed,local]
php5.6/unknown,unknown,now 5.6.30-11+0~20170522123046.34+stretch~1.gbp3d9cea all [installed]
php5.6-cli/unknown,now 5.6.30-11+0~20170522123046.34+stretch~1.gbp3d9cea amd64 [installed,automatic]
php5.6-common/unknown,now 5.6.30-11+0~20170522123046.34+stretch~1.gbp3d9cea amd64 [installed,automatic]
php5.6-json/unknown,now 5.6.30-11+0~20170522123046.34+stretch~1.gbp3d9cea amd64 [installed,automatic]
php5.6-opcache/unknown,now 5.6.30-11+0~20170522123046.34+stretch~1.gbp3d9cea amd64 [installed,automatic]
php5.6-readline/unknown,now 5.6.30-11+0~20170522123046.34+stretch~1.gbp3d9cea amd64 [installed,automatic]
php7.0/unknown,unknown,now 7.0.19-1+0~20170522122642.31+stretch~1.gbpfcdab8 all [installed]
php7.0-bz2/unknown,now 7.0.19-1+0~20170522122642.31+stretch~1.gbpfcdab8 amd64 [installed,automatic]
php7.0-cgi/unknown,now 7.0.19-1+0~20170522122642.31+stretch~1.gbpfcdab8 amd64 [installed]
php7.0-cli/unknown,now 7.0.19-1+0~20170522122642.31+stretch~1.gbpfcdab8 amd64 [installed]
php7.0-common/unknown,now 7.0.19-1+0~20170522122642.31+stretch~1.gbpfcdab8 amd64 [installed,automatic]
php7.0-curl/unknown,now 7.0.19-1+0~20170522122642.31+stretch~1.gbpfcdab8 amd64 [installed]
php7.0-gd/unknown,now 7.0.19-1+0~20170522122642.31+stretch~1.gbpfcdab8 amd64 [installed]
php7.0-imap/unknown,now 7.0.19-1+0~20170522122642.31+stretch~1.gbpfcdab8 amd64 [installed]
php7.0-intl/unknown,now 7.0.19-1+0~20170522122642.31+stretch~1.gbpfcdab8 amd64 [installed]
php7.0-json/unknown,now 7.0.19-1+0~20170522122642.31+stretch~1.gbpfcdab8 amd64 [installed,automatic]
php7.0-mbstring/unknown,now 7.0.19-1+0~20170522122642.31+stretch~1.gbpfcdab8 amd64 [installed]
php7.0-mcrypt/unknown,now 7.0.19-1+0~20170522122642.31+stretch~1.gbpfcdab8 amd64 [installed]
php7.0-mysql/unknown,now 7.0.19-1+0~20170522122642.31+stretch~1.gbpfcdab8 amd64 [installed]
php7.0-opcache/unknown,now 7.0.19-1+0~20170522122642.31+stretch~1.gbpfcdab8 amd64 [installed]
php7.0-pspell/unknown,now 7.0.19-1+0~20170522122642.31+stretch~1.gbpfcdab8 amd64 [installed]
php7.0-readline/unknown,now 7.0.19-1+0~20170522122642.31+stretch~1.gbpfcdab8 amd64 [installed,automatic]
php7.0-recode/unknown,now 7.0.19-1+0~20170522122642.31+stretch~1.gbpfcdab8 amd64 [installed]
php7.0-sqlite3/unknown,now 7.0.19-1+0~20170522122642.31+stretch~1.gbpfcdab8 amd64 [installed]
php7.0-tidy/unknown,now 7.0.19-1+0~20170522122642.31+stretch~1.gbpfcdab8 amd64 [installed]
php7.0-xml/unknown,now 7.0.19-1+0~20170522122642.31+stretch~1.gbpfcdab8 amd64 [installed,automatic]
php7.0-xmlrpc/unknown,now 7.0.19-1+0~20170522122642.31+stretch~1.gbpfcdab8 amd64 [installed]
php7.0-xsl/unknown,unknown,now 7.0.19-1+0~20170522122642.31+stretch~1.gbpfcdab8 all [installed]
php7.0-zip/unknown,now 7.0.19-1+0~20170522122642.31+stretch~1.gbpfcdab8 amd64 [installed,automatic]
php7.1/unknown,unknown,now 7.1.5-1+0~20170513113444.24+stretch~1.gbpe4bc94 all [installed,automatic]
php7.1-bz2/unknown,now 7.1.5-1+0~20170513113444.24+stretch~1.gbpe4bc94 amd64 [installed,automatic]
php7.1-cli/unknown,now 7.1.5-1+0~20170513113444.24+stretch~1.gbpe4bc94 amd64 [installed,automatic]
php7.1-common/unknown,now 7.1.5-1+0~20170513113444.24+stretch~1.gbpe4bc94 amd64 [installed,automatic]
php7.1-curl/unknown,now 7.1.5-1+0~20170513113444.24+stretch~1.gbpe4bc94 amd64 [installed,automatic]
php7.1-gd/unknown,now 7.1.5-1+0~20170513113444.24+stretch~1.gbpe4bc94 amd64 [installed,automatic]
php7.1-json/unknown,now 7.1.5-1+0~20170513113444.24+stretch~1.gbpe4bc94 amd64 [installed,automatic]
php7.1-mbstring/unknown,now 7.1.5-1+0~20170513113444.24+stretch~1.gbpe4bc94 amd64 [installed,automatic]
php7.1-mysql/unknown,now 7.1.5-1+0~20170513113444.24+stretch~1.gbpe4bc94 amd64 [installed,automatic]
php7.1-opcache/unknown,now 7.1.5-1+0~20170513113444.24+stretch~1.gbpe4bc94 amd64 [installed,automatic]
php7.1-readline/unknown,now 7.1.5-1+0~20170513113444.24+stretch~1.gbpe4bc94 amd64 [installed,automatic]
php7.1-xml/unknown,now 7.1.5-1+0~20170513113444.24+stretch~1.gbpe4bc94 amd64 [installed,automatic]
php7.1-zip/unknown,now 7.1.5-1+0~20170513113444.24+stretch~1.gbpe4bc94 amd64 [installed,automatic]
Virtualmin system information:
Operating system Debian Linux 8
Webmin version 1.840
Virtualmin version 5.07
Theme version Authentic Theme 18.48
Time on system Monday, May 29, 2017 6:32 PM
Kernel and CPU Linux 4.9.15-x86_64-linode81 on x86_64
Processor information Intel® Xeon® CPU E5-2680 v2 @ 2.80GHz, 4 cores
Note the /etc/debian-version reports 9.0, not 8:
cat /etc/debian_version
9.0