When it comes to wordpress, the most important file is the wp-config.php. Messing with it could possibly break your site and fixing it would be very difficult, that it until now. In this post I am going to write about how you can easily fix your website if it is something related to the wp-config.php file. In case you’re not sure, you better ask me here in the comments before doing anything. Be warned, this method will only help you in case the configuration in wp-config.php is wrong or some how the file is empty.
- First of all take a back up of your current wp-config.php and keep it somewhere safe.
- Now before you begin, I assume you have access to the website files, that is via, cpanel/direct admin/ftp or by any means. Also you should have access to the databases of your hosting.
- Now take a note of your database name, the associated username and password.
- Now login to the phpmyadmin and take a note of the Database charset and Database Collate from it. In case you’re in doubt please ask your host support about this and they will let you know.
- Now you will need to know where you database server is located. Most probably it will be one your hosting server only. Otherwise you will have to ask your host to find out the ip address of your database server. In case if its the same server, the database host is “localhost” without the quotes otherise it will be an ip given by your host.
- Now goto this webpage and fillin your details over there: http://generatewp.com/wp-config/ and click on “Update Code” button.
- Now copy the content of wp-config.php from below that button and goto the filemanager or ftp of your host.
- Now delete the wp-config.php from there(I hope you have already taken a back up) and create a new file with the name wp-config.php.
- Put the content you copied from the link http://generatewp.com/wp-config/ after clicking on the update button.
- Save the file and try connecting to your website. It will be working alright.
Now in most cases this works without any issues. In case you run into any issues, you can ask me using the comment section. If you have any feebacks or anything else to say feel free to comment too.