• Uncategorized

About linux : Why-do-all-my-browsers-show-error-that-the-phpmyadmin-configjs-file-is-forbidden

Question Detail

  • Ubuntu 20.04
  • Apache 2.4.41
  • phpmyadmin 4.9.5deb2

I can log in to phpmyadmin and see the main page where the databases are listed in the left-hand panel. But I get an error message. Using F12, I see the following error:

Failed to load resource: the server responded with a status of 403 (Forbidden) config.js:1

There is a config.js file under /usr/share/phpmyadmin/js. There are other js files in that folder that are included in the sources listed in the browser (again, using F12).

I confirmed that the config.js file has read permissions set for everyone. All the js files in that folder have the same permissions set.

I also confirmed that /etc/apache2/conf_enabled/phpmyadmin.conf links to /etc/apache2/conf_available/phpmyadmin.conf and that links to /etc/phpmyadmin/apache.conf. Neither this apache.conf nor /etc/apache2/apache2.conf deny access to config.js.

When I delete config.js, I do not get the error BUT I get other errors concerning functions that are contained in that config.js (like “Uncaught ReferenceError: isStorageSupported is not defined.”). This tells me that the forbidden file is indeed this file. I renamed it and created a new empty config.js – still get the same forbidden error(fwiw).

We’ve been using phpmyadmin on this server since April. The error has cropped up in the last couple weeks. When I ssh’d into the server this week, it displayed a message that it needed restarted to make updates. I did not know there were auto-updates going on. I restarted, which did not help the problem. Then I updated and upgraded everything but still no help. I uninstalled (remove and purge) and installed phpmyadmin, but still no help.

My next step would be to upgrade phpmyadmin to the latest stable using a different repository (the debian repo is a little behind). But I thought I’d ask here because I have a feeling that might not help either.

I’m thinking that something changed in the server stack that isn’t allowing the config.js file to be read; I just have no idea what that would be. Has anyone else seen this or something similar?

Question Answer

I implemented a band-aid: I copied the /usr/share/phpmyadmin/js/config.js file to config.1.js. I edited the code in /usr/share/phpmyadmin/libraries/classes/Header.php to use config.1.js instead of config.js.

No error now!

But I don’t like this answer because it doesn’t tell me what the original source of the problem is and how to keep it from happening again.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.