phpmyadmin stops delivering html after installing virtualmin 5.07 stack from install script

i set up a new ubuntu 16 VM box and installed LAMP and phpmyadmin and confirmed it was all working.

after installing virtualmin stack phpmyadmin is no longer working. apache is delivering raw php instead of rendering it into html

/etc/phpmyadmin/apache.conf is the default one installed by pma. it was configured fine before installing virtualmin.
/etc/apache2/apache2.conf is modifed from install only to include /etc/phpmyadmin/apache.conf.

other useful facts:

  1. php from /var/www/html is still delivered as html after installation of virtualmin.

  2. serving phpmyadmin/index.php from the built in php test server works also so I think virtualmin/apache is causing the problem…

$ cd /usr/share/phpmyadmin
$ php -S localhost:9000

result: working phpmyadmin at localhost:9000…

im happy to send any other info that may help to resolve this issue.

this link refers to the exact same problem i am experiencing. https://github.com/phpmyadmin/phpmyadmin/issues/12177.

im posting it here in the hope it may offer a hint as to how virtualmin/apache has modified the installation.

thanks,

contents of /etc/phpmyadmin/apache.conf…

#phpMyAdmin default Apache configuration

Alias /phpmyadmin /usr/share/phpmyadmin

<Directory /usr/share/phpmyadmin>
Options SymLinksIfOwnerMatch
DirectoryIndex index.php

<IfModule mod_php5.c>
    <IfModule mod_mime.c>
        AddType application/x-httpd-php .php
    </IfModule>
    <FilesMatch ".+\.php$">
        SetHandler application/x-httpd-php
    </FilesMatch>

    php_value include_path .
    php_admin_value upload_tmp_dir /var/lib/phpmyadmin/tmp
    php_admin_value open_basedir /usr/share/phpmyadmin/:/etc/phpmyadmin/:/var/lib/phpmyadmin/:/usr/share/php/php-gettext/:/usr/share/php/php-php-gettext/:/usr/share/javascript/:/usr/share/php/tcpdf/:/usr/share/doc/phpmyadmin/:/usr/share/php/phpseclib/
    php_admin_value mbstring.func_overload 0
</IfModule>
<IfModule mod_php.c>
    <IfModule mod_mime.c>
        AddType application/x-httpd-php .php
    </IfModule>
    <FilesMatch ".+\.php$">
        SetHandler application/x-httpd-php
    </FilesMatch>

    php_value include_path .
    php_admin_value upload_tmp_dir /var/lib/phpmyadmin/tmp
    php_admin_value open_basedir /usr/share/phpmyadmin/:/etc/phpmyadmin/:/var/lib/phpmyadmin/:/usr/share/php/php-gettext/:/usr/share/php/php-gettext/:/usr/share/javascript/:/usr/share/php/tcpdf/:/usr/share/doc/phpmyadmin/:/usr/share/php/phpseclib/
    php_admin_value mbstring.func_overload 0
</IfModule>

Authorize for setup

<Directory /usr/share/phpmyadmin/setup>


AuthType Basic
AuthName “phpMyAdmin Setup”
AuthUserFile /etc/phpmyadmin/htpasswd.setup

Require valid-user

Disallow web access to directories that don’t need it

<Directory /usr/share/phpmyadmin/templates>
Require all denied

<Directory /usr/share/phpmyadmin/libraries>
Require all denied

<Directory /usr/share/phpmyadmin/setup/lib>
Require all denied

comment appended to first post… cant delete…

this isnt limited to phpmyadmin. problem exists with virtualmin install php/apache combo.

solution: apt-get purge apache* and php* and then reinstall. all working.

To avoid such problems Virtualmin or any other control panel should be installed on fresh/clean OS.

Howdy,

We’re glad you got it figured out!

Yeah unfortunately, the phpMyAdmin RPM/DEB package conflicts with the way Virtualmin does things.

Your solution of removing phpMyAdmin is the best one – what we’d recommend is to use the phpMyAdmin install script, and install that into one or more of your Virtual Servers.

-Eric