To fix php code error in PhpMyAdmin

If getting error like:

< ?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’;

… it is a libapache2-mod-php package error. The fix goes like:

sudo apt install libapache2-mod-php7 libapache2-mod-php

If that does not help, reinstall the next things

sudo systemctl stop mysql

sudo systemctl stop apache2

sudo apt purge php*

sudo apt install –reinstall apache2 libapache2-mod-php libapache2-mod-php7

sudo apt install –reinstall mysql-server

sudo apt install –reinstall phpmyadmin

….. and PhpMyAdmin should work.

http://localhost/phpmyadmin/

Read also: Apache and PhpMyAdminin installation in Ubuntu Mate 18 and Mint 19