Step-by-Step Troubleshooting Guide
Check Apache Configuration
Ensure that the phpMyAdmin configuration is correctly included in Apache's configuration file.
sudo nano /etc/apache2/apache2.conf
Ensure the following line is present at the end of the file:
apache
Include /etc/phpmyadmin/apache.conf
Save and close the file (Ctrl+X, Y, Enter).
Set Correct Permissions
Ensure that the phpMyAdmin directory has the correct permissions.
sudo chown -R www-data:www-data /usr/share/phpmyadmin
sudo chmod -R 755 /usr/share/phpmyadmin
Enable Required Apache Modules
Ensure that the necessary Apache modules are enabled.
sudo a2enmod rewrite
sudo a2enmod php7.4
Restart Apache
Restart the Apache service to apply the changes.
sudo systemctl restart apache2
Check Apache Error Logs
If you still encounter issues, check the Apache error logs for more information about the "Forbidden" error.
sudo tail -f /var/log/apache2/error.log
Additional Apache Configuration
If the issue persists, you may need to add a specific configuration block for phpMyAdmin in your Apache configuration file:
Edit Apache Configuration File
sudo nano /etc/apache2/sites-available/000-default.conf
Add Directory Block for phpMyAdmin
Add the following block within the <VirtualHost> block:
apache
<Directory /usr/share/phpmyadmin>
Options Indexes FollowSymLinks
DirectoryIndex index.php
AllowOverride All
Require all granted
</Directory>
Save and close the file (Ctrl+X, Y, Enter).
Restart Apache Again
sudo systemctl restart apache2
0 More Answers