Why do all my browsers show error that the phpmyadmin config.js file is forbidden? - linux

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?

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.

Related

ddev launch command returns "File not found."

My organization is establishing a ddev-pantheon setup on Windows 10. Successful "ddev pull pantheon" commands have executed. 403 errors arose after running ddev start and clicking the project links; this error disappeared after establishing the folder with "index.php" as the docroot folder in my "config.yaml" file. However, now "File not found." is being displayed after clicking both project links (those returned after a "ddev start" or "ddev restart" command). Could it be that some file in the repo linked to the index.php file is having trouble locating another file - how do I get rid of this message and view the site?
If anyone is willing to help me establish a functional connection, then I would appreciate it. It will also be helpful to know where ddev users usually clone their git repositories and how I can locate the files downloaded following a "ddev pull pantheon" command. Could the presence of lando .yml files cause issues? Any help is appreciated. Thank you.
Moving the "index.php" file (and those referenced by it) into the initial docroot folder did not get rid of the "File not found." message. Neither did deleting the repo, redownloading it, and establishing the new repo folder as the docroot folder in the "config.yaml" file resolve this issue.
As you discovered, the most common reason to get a 403 is that your docroot is set wrong (or that there is no index.php or index.html in your docroot). This happens enough that there's an FAQ for it, https://ddev.readthedocs.io/en/latest/users/basics/faq/#why-do-i-get-a-403-or-404-on-my-project-after-ddev-launch
Please look at your .ddev/config.yaml and see what's there for docroot when you're having this problem, and use ddev ssh to inspect what's inside the container.
ddev logs may help you understand why the 403 is happening.
You don't say whether you're using mutagen or not.
ddev pull pantheon should have nothing to do with your 403 problem; it's not clear why you mention ddev pull pantheon. I supposed you could have a really messed up pantheon.yaml that could do it, or that you could be downloading a broken database. Are you saying that your project is only broken after you do a pull? If so, ddev delete -Oy will get you back to where you started, so you can demonstrate that. You can also do ddev pull pantheon --skip-files or ddev pull pantheon --skip-db as part of your debugging process.
The way things should be working:
You should have checked out your git repo that has the code for your project.
On most project types you would have done a ddev composer install after that.
Then a ddev pull pantheon would load your database with the upstream database. You can see the contents of the database with ddev mysql or by using the PhpMyAdmin UI (ddev launch -p).
The files from Pantheon will be put into your upload_dir. For example, this would be web/sites/default/files on a standard Drupal project.
BTW, the recommended environment on Windows is WSL2, you'll like it a lot in the long run.
This sort of problem would be easier to sort out in a more interactive environment, so you're invited to the DDEV Discord at https://discord.gg/hCZFfAMc5k .

permission error when trying to run node server in godaddy

im trying to run a nodejs server on godaddy using the cpanel thing. i followed this tutorial, and got to the part where you run the server file. however, the server gives me a permission error.
there may be something wrong with my file structure, or the tutorial may be out of date, as my file structure differed from that in the tutorial. ex: tutorial said to go to /home/username/public_html, but my public_html folder is located on the root folder.
Update:
i just found that i could change file permissions, and enable the execute option on the node file. i'm now getting a segmentation fault error
if you need any extra information, let me know.

Linking in localhost(LAMP)

I am newly(about 1 month) started using LAMP and Bootstrap.
I developed a web-site that worked perfectly until I reinstalled LAMP.
Here my progress:
0. reinstalled LAMP
1. moved my "backup-ed" file to my "localhost" direction
2. I run "chmod 777 *" to each dir and file
3. When I write "localhost" to my browser(firefox) the "index.html" is running
4. When I click the link(say: index)
The browser responds:
http://localhost/undefined
Not Found
The requested URL /undefined was not found on this server.
Apache/2.4.7 (Ubuntu) Server at localhost Port 80
Is there any way to fix this, by the way it's working(linking) perfectly when I write file:///var/www/html/index.html.
The reason why I want to use LAMP is add .php files to handle form.
Thanks
What happens when you do hit http://localhost ?
What exactly do you see?? Tried http://localhost/html
What is exactly your document root as per apache conf?
You might need to check that you are placing your files in the root directoy. It should be in the "htdocs" foler.
/opt/lampp/htdocs/
If all else fails, you can try using xampp which is another free alternative to lamp.
I get this a lot, when your browser looks for a file that is not in htaccess you get a forbidden or unfound error. The way to fix this is to make sure the link you click goes to an accessible URL. Try finding if other links in the page or scripts are overwriting your link.
Finally check if you can access it from another browser, or try to demonstrate the security of your machine. From a public library you can request an Ubuntu CD from canonical, and while you're waiting, you can visually inspect your machine for tampering.

Logging wordpress errors on AWS AMI server

so I have a basic out of the box wordpress installation setup on my instance of a ec2 AMI server. I want to set up wordpress logging. I checked that logging is set to true in my wp-config.php file, and I am expecting a standard debug.log file to show up in wp-content. However this is not happening. Are the errors being piped somewhere else? Could it be that that I am missing some small configuration detail (that usually is the case.) I'm not sure what is wrong. Thank you for your time and help.
Edit: so now I can see that the PHP error log is in the logs folder, accessible from the root directory by default. However, what is still confusing is that I want to be able to route my wordpress errors to the logs that exist, or perhaps just set up my own debug.log file in the existing log directory. I'm reviewing wordpress logging and PHP ini stuff, but I cannot generate a log file. Any help would be greatly appreciated.
I use this plugin in all Wordpress developments. You simply create a file called php-error.log in the root of your Wordpress install, set a few lines in wp-config (instructions after activating plugin in dashboard), and your log will also automatically appear in the dashboard.
http://wordpress.org/plugins/error-log-monitor/

MODx 500 Server Error When Trying to Edit a Resource in Manager

I'm running MODx Revolution 2.0.8-pl (traditional) and get a blank page (500 Server Error) when trying to edit most resources in the Manager. The frontend and other Manager functions are all working fine.
I first noticed the issue after adding ~600 new resources to the site. (Unfortunately, I get the error on both new and old resources)
You should really just post this on the MODX forum... I bet there's more people with knowledge there, lol.
Server 500 errors are often caused by wrong permissions, for example files that are set to 777 while your server set up only allows 755.
Just faced this same issue and it ended up being that I uninstalled TinyMCE but the plugin file was still enabled.
I had to re-install TinyMCE in the most recent version after my MODX upgrade.
I increased the PHP memory limit to 64MB and the problem disappeared.
In my case, my MODX website works but /manager throws a 500 error.
It happened after I've removed /www/core/cache/*
First of all, I check logs:
sudo tail -100 /var/log/apache2/error.log
I see this error:
Smarty: unable to create directory /var/www/html/core/cache/mgr/smarty/default
So to fix this I added permissions:
sudo chown -R www-data:www-data /var/www/*

Resources