Phpmyadmin installed via virtualmin install scripts tool does show up a page of php code instead of the application

Hello everyone, thank you in advance for the help.
I installed virtualmin using the script on a fresh Centos 7, so far all seems to go fine except phpmyadmin.
I installed it via virtualmin “install scripts” tool, got no errors and a link to http://mydomain/phpmyadmin
going to that address however does not output Phpmyadmin GUI but a text page showing php code, I do post here below the beginning of it.
I tried to uninstall the script, got OK message, but going to http://mydomain/phpmyadmin the PHP code text page seems to be steady stuck there, won’t go away no matter what ( and do not see where is the phpmyadmin folder).
How can i fix this?
Thank you

<?php /* vim: set expandtab sw=4 ts=4 sts=4: */ /** * Main loader script * * @package PhpMyAdmin */ /** * Gets some core libraries and displays a top message if required */ require_once 'libraries/'; /** * display Git revision if requested */ require_once 'libraries/display_git_revision.lib.php'; /** * pass variables to child pages */ $drops = array( 'lang', 'server', 'collation_connection', 'db', 'table' );


Is it possible that some third party repos were enabled, and that a non-default PHP version is installed? That’s a common cause of what you’re seeing there. Details on how to troubleshoot/resolve that issue can be seen here:

Hi Andrey

I confess I am not already so fond about managing a Centos box VPS to tell if the OS was installed all using default repos and default packages.
I ordered a VPS choosing a preconfigured setup declared by the hosting company to be a Centos 7 + LAMP + Webmin ready to go solution, on top of that I used your official script to add virtualmin, I launched it with --verbose option and as far as I could understand from the messages given during the process your script does take care to exclude third parties non default repositories.

I will check how to remove third parties repositories, have no idea how to check and do that right now.

Did not try to use FTP yet, will test it as soon as possible.

As virtualmin supports PHP-FPM for this first domain I am testing on I needed to choose php 7, PHP versions 5.4.16 and 7.0.27 were installed by you sh script, I do not know how to tell if are the default packages virtualmin needs.

I read the page you linked, I checked all configuration files in /etc/httpd/conf.d and nowhere could find an uncommented “SetHandler application/x-httpd-php” line. In particular I noticed that in the php.conf file all lines are commented.
Apparently this php.conf file is not used, I do not know where to look what is done by Apache/php.

What should I further check in order to solve this?

I searched for phpmyadmin files and found over 50 of them, they are despite virtualmin does tell that phpmyadmin script is removed (by virtualmin iteself)

One thing I recall now is that when I saw the trouble of plain text php code output in phpmyadmin page I removed it using vrtualmin, and trying to resinstall it I noticed that the default version selected by virtualmin itself I installed in first instance was a development version, so form the dropdown menu I did choose the stable version in order to try to reinstall it, but nothing changed, same error was observed, tehn removed the stable version and got stuck with the error there as if was not removed (in both cases, first removed the development version and checked that teh error was still there, then reinstalled the stable, still seeing same error, then removed it still seeing same error).

Not sure about what to do now, if possible I would like to avoid to simply reinstall it all.

Thank you so far.

as follows:

here below the php.conf file content, for some reason here the comment tag # at the beginning of the lines are automatically removed, however the original file is all commented out , from top to bottom, no one line is read by the system:

Cause the PHP interpreter to handle files with a .php extension.

#<FilesMatch .php$>

SetHandler application/x-httpd-php


Allow php to handle Multiviews

#AddType text/html .php

Add index.php to the list of files that will be served as directory


#DirectoryIndex index.php

Uncomment the following lines to allow PHP to pretty-print .phps

files as PHP source code:

#<FilesMatch .phps$>

SetHandler application/x-httpd-php-source


Apache specific PHP configuration options

those can be override in each configured vhost

#php_value session.save_handler “files”
#php_value session.save_path “/var/lib/php/session”

I checked which repositories are used, not being fond of Centos I am not sure if third parties repos are present, here is the list:

yum repolist enabled

Loaded plugins: fastestmirror

Loading mirror speeds from cached hostfile

repo id___________________repo name______________________________________status

Webmin_________________Webmin Distribution Neutral____________________126


centos-sclo-rh/x86_64____CentOS-7 - SCLo rh______________________________7857

centos-sclo-sclo/x86_64__CentOS-7 - SCLo sclo_____________________________724

epel/x86_64______________Extra Packages for Enterprise Linux 7 - x86_64___12851

extras/7/x86_64__________CentOS-7 - Extras________________________________321


virtualmin/7/x86_64______RHEL/CentOS 7 - x86_64 - Virtualmin_____________41

virtualmin-universal______Virtualmin Distribution Neutral Packages________46

repolist: 32610

Maybe Epel is not a default repository? However I think I read in the output messages of virtualmin’s that Epel was excluded during installation (not sure about that btw, I think to have read something like that…)
Any wrong repo in this list?
Thank you


I tried out this, I created a simple hello.php file and placed it in the html folder of the virtual domain created with virtualmin, then called it with the web browser, instead of showing the page the browser prompted me to download the file, thus I tried to call the index.php page of the test application I installed in it and again the browser prompted me to download it instead of showing me the front page of the website.
All of this while simply calling the main website address everything looks alike normal, the website is shown and seems to work fine everywhere…

Do not know if this can help to debug this mangle.
Thank you

stuck on this with a new fresh install, spin a Centos 7, install webmin, install phpmyadmin via script and do amendmends to be able to access it from my ip, and boom! Its shows text instead of run php :frowning: if i create file in home directory for vhost - its shows correctly so php is working, just something wrong with installation? Tryed update php to version 7.3 - still same result :confused: