localhost phpmyadmin displaying only codes [duplicate]
Matthew Barrera
I have installed apache2 , php7.2.5 and mysql-server and also install phpmyadmin. Apache2 , php and mysql are running well. But when i try to run phpmyadmin , it displays a bunch of code in the browser. Looks like this:
<?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/common.inc.php';
/** * display Git revision if requested */
require_once 'libraries/display_git_revision.lib.php';
require_once 'libraries/Template.class.php';
/** * pass variables to child pages */
$drops = array( 'lang', 'server', 'collation_connection', 'db', 'table'
);
foreach ($drops as $each_drop) { if (array_key_exists($each_drop, $_GET)) { unset($_GET[$each_drop]); }
}
unset($drops, $each_drop);Help me to fix this problem.
Thanks
1 Answer
I had the same problem and I used the following command:
sudo apt-get install libapache2-mod-phpIf it doesn't resolve your problem, uninstall php and everything associated with it as described in this answer, using the command:
sudo apt-get purge 'php*'after that reinstall php with the command:
sudo apt-get install php