when i try to access the phpmyadmin page i receive the following error:
<?php
declare(strict_types=1);
use PhpMyAdminRouting;
if (! defined('ROOT_PATH')) {
// phpcs:disable PSR1.Files.SideEffects
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
// phpcs:enable
}
global $route, $containerBuilder;
require_once ROOT_PATH . 'libraries/common.inc.php';
$dispatcher = Routing::getDispatcher();
Routing::callControllerForRoute($route, $dispatcher, $containerBuilder);
couldn’t find a solution to this on any pixel of the internet, any help would be appreciated.
5
Answers
You can try to remove my php with
apt-get --purge remove php-common
and download it back withapt-get install php7.4 php7.4-mysqli php7.4-xml
followed bysystemctl reload apache2
to restart apache.If the above does not work, I recommend you to re-download phpmyadmin
If you see php code in your browser it means that the PHP interpreter wasn’t used. This means the problem is not with PhpMyAdmin but with your php installation. I googled quickly this but you (or others) may find better tutorials.
When new to apache php and mysql/mariadb I recommend installing wampserver or mamp. They do take all the hard configuration work from you.
I was facing the same problem but solved it through the below command
Try this.
Step 1 – Install Apache and PHP
Once the installation is finished, enable and start the Apache web server.
Step 2 – Install phpMyAdmin on Ubuntu 22.04
Next, create tmp directory and set the proper permissions. This is a necessary step to make it work properly.
Step 3 – Configure phpMyAdmin
Now, you need to configure the web server to serve phpMyAdmin on the network. Create an Apache configuration file for phpMyAdmin and edit it in a text editor:
Add the below content to the file.###
After making all the changes, make sure to start the Apache service to reload all settings.
Step 4 – Adjusting FirewallD
The systems with enabled firewalls need to allow HTTP service from the firewall. Run the below commands to open a port for the webserver in the firewall.
If you don’t have firewall installed, run: