Only phpMyAdmin displays php code instead of executing it

5 posts / 0 new
Last post
#1 Sat, 03/09/2019 - 14:15
DanielStonek

Only phpMyAdmin displays php code instead of executing it

Fresh Centos 7 install. Virtualmin install.
Added a VH testing.com (php 7.0); (use noip.com)
SSL cert from Let's Encrypt via Virtualmin option
Forced http -> https
Followed instruction tu upgrade php 5.4 to php7.2 https://www.virtualmin.com/node/48280
So now I have php 7.0 and 7.2
Installed phpMyAdmin from Webmin Software Packages
Changed /etc/httpd/conf.d/phpMyAdmin.conf

Require all granted
#Require ip 127.0.0.1
#Require ip ::1

https://testing.com/index.php and info.php display the correct output but https://testing.com/phpmyadmin displays php code
phpmyadmin.conf is included in httpd/conf.d
How can I solve this?
Thanks

Sat, 03/09/2019 - 14:31
noseboy

Ran into something similar a while ago. Is the php version set properly for the phpmyadmin directory under server config -> web options?

Sat, 03/09/2019 - 16:07 (Reply to #2)
DanielStonek

After installing from Webmin followed instructions from here
https://linuxize.com/post/how-to-install-and-secure-phpmyadmin-with-apac...
after "Configuring and Securing phpMyAdmin" line

testing.com/phpmyadmin displays the php code
phpmyadmin is installed at /usr/share/phpMyAdmin

I added some directives in /etc/httpd/conf.d/phpMyAdmin inside Directory /usr/share/phpMyAdmin/>
AddDefaultCharset UTF-8
Options +FollowSymLinks +Multiviews +Indexes
AllowOverride None
AuthType basic
AuthName "Authentication Required"
AuthUserFile /etc/phpMyAdmin/.htpasswd
Require valid-user

phpMyAdmin doesn't have a Virtualmin Virtual Host to manage 'web options' or php version from panel

Wed, 05/01/2019 - 14:07
anahata
anahata's picture

I'm having a similar problem with Debian Stretch, Virtualmin 6.06 and Webmin 1.9, fresh install trying out Webmin for the first time. I note this message at end of phpmyadmin install:

NOTICE: Not enabling PHP 7.0 FPM by default.
NOTICE: To enable PHP 7.0 FPM in Apache2 do:
NOTICE: a2enmod proxy_fcgi setenvif
NOTICE: a2enconf php7.0-fpm
NOTICE: You are seeing this message because you have apache2 package installed.

Those modules are enabled, but I'm getting PHP code sent to my browser instead of executed.
PHP on a virtual server site works fine.
I've found similar reports in the forum but the explanations seem to focus on specific problems with Centos and other distributions, that don't seem to apply to Debian.

Anahata www.treewind.co.uk West Yorkshire, UK

Wed, 05/01/2019 - 14:30
anahata
anahata's picture

Progress! This might help if your problem follows a PHP5 - PHP7 upgrade: The file /etc/apache2/mods-available/phpmyadmin contains two identical blocks of code preceded by

<IfModule mod_php5.c>

and

<IfModule mod_php.c>

I copied and pasted a third copy of the same block headed with

<IfModule mod_php7.c>

And I now get a PHPMyadmin login screen.
(It's not accepting the MySQL root password, but that's a different problem!)

Anahata www.treewind.co.uk West Yorkshire, UK

Topic locked