Creating the wp-config.php file

One of the steps in the WordPress installation process is creating the wp-config file. Once you download the file package from you need to unzip the package and extract the files to your hard drive. The package will be contained inside a worpress folder. Directly inside that wordpress folder is a file named wp-config-sample.php, open that file in your favorite text editor. Yes you have to make some changes to the code but they are very easy to make.

In a previous video tutorial, Creating A MySQL Database in cPanel, we created the Database Name, Database User and Database Password. We need to add those credentials to the Sample Config file. Look at the screenshot below and you should be able to correlate the three items ( db name, db user, password ) that need to be input.. if not post a comment and I’ll try and walk you through it.

Creating a WP Config File

The one tricky item in the wp-config file is the DB_Host line from the above screenshot. Different hosting companies have different protocols due to the way their servers are configured. If you are using a hosting platform that uses cPanel or Plesk the DB_Host will almost always be ‘localhost’ like it is in the screenshot. If you are hosting at GoDaddy you will have to use a path that leads to your hosting account… localhost will not work. I believe you will have to get database location from the db panel inside the hosting control panel.

Finally there are the Authentication Unique Keys and Salts. Simply go to the WordPress Salts API Page, copy the codes that were dynamically generated and paste them over the top of the place holder keys in the wp-config file.

That’s all you have to update, now click file > save as > and rename the file to wp-config.php. Make sure you save back in inside the WordPress folder you downloaded.

Post Comments, Questions and Feedback