How to Make a WordPress wp-config.php File

How to Make a WordPress wp-config.php FileIf you follow my How to Manually Install WordPress Step by Step Tutorial and you complete all the steps up to Step 23 and for some reason the installer tells you that it can’t create a configuration file you can manually create one.

The following information will be based on cPanel web hosting along with screenshots.

It would be wise to try the tutorial mentioned above first because usually you do not have to manually create a wp-config.php file with cPanel hosting.

If for some reason that you do need to, or you just want to learn the steps involved hopefully this will help guide you.

This assumes you have performed all the steps prior to Step 23 in the How to Manually Install WordPress Step by Step Tutorial, which involves creating a database, database user, and database password. As well as uploaded the file, extracted it, and you have moved all the files and folders to the public_html (main part) of your web space.

For this example we will be using the following database credentials from the previous tutorial.

  • Database Name: telescop_wpress
  • Database User: telescop_wpress
  • Database password: bK.9)-75Zzh(-n5a1


Step 1
Login to cPanel if you are not already and open the “File Manager”.

Find and click on wp-config-sample.php and choose “Edit” near the top of the page.

Step1 Edit wp-config-sample.php


Step 2
If you see a window like, this choose the “Edit” button.

Step2 Continue Text Editor


Step 3
Find the MySQL settings area within the file.

It looks like this:

Step3 wp-config Database Details


Step 4
Copy and paste your database name, database user, and database password into the appropriate locations as pictured here:

Step4 wp-config Database Details Updated


Step 5
Scroll down a little more until you find the “Authentication Unique Keys and Salts area.”

Step5 Authentication Keys Details


Step 6
Goto the following address to generate your unique authentication keys:

They are randomly generated and unique.

They look like this:

Step6 Generate Authentication Keys


Step 7
Copy and paste each unique key from the page into the wp-config-sample.php file in the appropriate location.

Do not refresh the page, and make sure you copy them all.

You need all the characters between the single quotes.

Click the “Save Changes” button and then the “Close” button:

Step7 Authentication Keys Details Updated


Step 8
Return to the cPanel File Manager if the “Close” button in the previous step didn’t do so.

Find and click on the “wp-config-sample.php” to highlight it.

Then, click on “Rename” near the top of the page.

Step8 Rename wp-config-sample


Step 9
Change it to wp-config.php and then click the “Rename File” button.

You are just removing the -sample part of the file name.

Step9 Rename wp-config-sample Done


Step 10
Now open a web browser tab or window and navigate to your website:

Fill in:
Site Title
Password twice
Your E-mail
Privacy/Allow search engines to index this site

Be sure to write your Username and Password down so you don’t forget you will need them to login to the WordPress Admin Dashboard.

Click the “Install WordPress” button to continue.

Step10 WordPress Installer


Step 11
If you followed these instructions you should see a Success! page.

You can click on the “Log in” button to go to the WordPress login page.

Step11 WordPress Installer Success


Step 12
Enter your Username and Password you created in Step 10 to login to the WordPress Administration Dashboard.

Step12 WordPress Installer Log In


That’s it!

If your host happens to use something other than localhost as the database host you may need to contact them and ask them what you need to use instead of the standard localhost.

Once you have that information you can find in the wp-config.php file the following line in the MySQL settings area:
/** MySQL hostname */
define (‘DB_HOST’, ‘localhost‘);

Then, change it to reflect the information they give you.

For example:
/** MySQL hostname */
define (‘DB_HOST’, ‘‘);

Be sure to see my full WordPress install tutorial, which also includes a step by step video here:
How to Manually Install WordPress Step by Step Tutorial

About: Jeremy LeSarge - AKA: Ray (209 Posts)

I am the site owner and administrator of I provide help and tips for Boonex Dolphin on the main part of this website where you will also find an assortment of other resources. Here, on the blog I write about a variety of topics surrounding WordPress, technology, social media/networking, SEO, and webmaster resources.