![]() ![]() The first step I do is to update the linux: sudo apt upgradeĪnd then reboot the linux to make sure the update is properly applied. In cases where I had my own VPS or dedicated server or when testing on localhost, sometimes this error comes up all of sudden. Once fixed, my WordPress got back to its original state and working good again. This error “sudo: unable to resolve host ip-xx-xx-xx-xx: Temporary failure in name resolution” at first looks like a small error.įixed this and the detailed steps I have instructed here: AWS error – sudo: unable to resolve host ip-xx-xx-xx-xx: Temporary failure in name resolution WordPress: Error establishing a database connection 2 Closing the file with Ctrl + X command showed me a surprise error. I tried to open the wp-config.php file with the following command: sudo nano wp-config.phpĬhecking all the credentials look good. This came as a surprise for me when I tried logging into the AWS EC2 instance when faced with this error. Checking that the database credentials in your wp-config.php file are right is a great first step in troubleshooting database link errors. These credentials are saved in the wp-config.php file in your WordPress installation. You would have been prompted to enter a database hostname, database name, database username, and password when installing WordPress. A few things that will help you to solve this error are listed here. One of my sites running good and suddenly one day I found that it started showing this error. It’s the most annoying type of error as well. Here's what the original /etc/hosts file off of the Macintosh looks like in case you ever lost it: Īlso, make sure you have a separate database, user for the database, and folder in the htdocs folder for each website you run on MAMP.The most common type of error and very vague type of error in WordPress is Error establishing a database connection. Here is the website I use since I forget command-line in order to edit the /etc/hosts file and the steps I presented to you in more detail: Once you make these changes to the nf file, make sure to reboot your MAMP, as the Apache server needs to take these changes into effect. You then add virtual hosts to the bottom of the file, with code like this, modifying the name examplesite.local to, again, whatever you want the URL to display in the browser: NameVirtualHost *ĭocumentRoot "/Applications/MAMP/htdocs/examplesitename" You save those changes to the /etc/hosts file, then going to the nf in your Apache folder (the location of the file being in Applications/MAMP/conf/apache/nf). You can name examplesite.local however you want, this is the URL which will display your website in the browser. # localhost is used to configure the loopback interface You type your new virtual host below that line, the /etc/hosts file looking similar to this: # ![]() You shouldn't modify anything beyond the fe80::1%lo0 localhost, as it would mess up the way the hosting is read on your computer. I have multiple websites running on my MAMP machine, and have found it easiest to use the default Apache and MAMP settings.Īnd you don't want to specify MAMP porting in this way through the config-file, instead modifying your /etc/hosts file on your main Macintosh computer. ![]()
0 Comments
Leave a Reply. |