Title: Installing on Localhost
Last modified: August 18, 2016

---

# Installing on Localhost

 *  [thenetherlands](https://wordpress.org/support/users/thenetherlands/)
 * (@thenetherlands)
 * [20 years, 8 months ago](https://wordpress.org/support/topic/installing-on-localhost-2/)
 * Trying to get the weblog running on localhost but can’t figure out how to get
   the wp-config.php right.
    Name of the DB = news
 * got this but doesn’t run.
 * // ** MySQL settings ** //
    define(‘DB_NAME’, ‘wordpress’); // news define(‘DB_USER’,‘
   username’); // root define(‘DB_PASSWORD’, ‘password’); // define(‘DB_HOST’, ‘
   localhost’); //

Viewing 7 replies - 1 through 7 (of 7 total)

 *  [moshu](https://wordpress.org/support/users/moshu/)
 * (@moshu)
 * [20 years, 8 months ago](https://wordpress.org/support/topic/installing-on-localhost-2/#post-257124)
 * If the name of DB is “news” then:
    `/ ** MySQL settings ** // define('DB_NAME','
   news'); //  define('DB_USER', 'root'); //  define('DB_PASSWORD', '*****'); //
   define('DB_HOST', 'localhost'); //
 *  Thread Starter [thenetherlands](https://wordpress.org/support/users/thenetherlands/)
 * (@thenetherlands)
 * [20 years, 8 months ago](https://wordpress.org/support/topic/installing-on-localhost-2/#post-257126)
 * Done it but it gives me the following error:
 * Parse error: parse error in C:\Program Files\xampp\htdocs\news\wp-config.php 
   on line 2
 *  [moshu](https://wordpress.org/support/users/moshu/)
 * (@moshu)
 * [20 years, 8 months ago](https://wordpress.org/support/topic/installing-on-localhost-2/#post-257129)
 * Probably you messed it up during your trials. I’d delete the file and take the
   sample-config file as it is untouched(!), save it as config and do NOT change
   anything else, just put the DB name and username and pw as I showed above.
 *  Thread Starter [thenetherlands](https://wordpress.org/support/users/thenetherlands/)
 * (@thenetherlands)
 * [20 years, 8 months ago](https://wordpress.org/support/topic/installing-on-localhost-2/#post-257132)
 * Could it be becouse I didn’t delete the old file after I renamed it and saved
   it?
 *  [moshu](https://wordpress.org/support/users/moshu/)
 * (@moshu)
 * [20 years, 8 months ago](https://wordpress.org/support/topic/installing-on-localhost-2/#post-257134)
 * What old file?
 *  [Beel](https://wordpress.org/support/users/beel/)
 * (@beel)
 * [20 years, 8 months ago](https://wordpress.org/support/topic/installing-on-localhost-2/#post-257137)
 * No, not if you renamed it. Moshu is likely correct, there is an error in your
   config file that needs to be fixed. Whether your set-up runs correctly after 
   the error is fixed, well, that is another story.
 *  [Neil Mickelson](https://wordpress.org/support/users/mickelsn1/)
 * (@mickelsn1)
 * [20 years, 8 months ago](https://wordpress.org/support/topic/installing-on-localhost-2/#post-257155)
 * I had similar errors on my actual web host. If I recall, the problem was editing
   the file with pico; for some reason, it was inserting newlines into the comments
   after the DB variables. When I corrected this, the “blanks” error went away. 
   If the suggestion of carefully modifying the default wp-config_sample.php file
   doesn’t work, I’d do a very careful cut-and-paste of the PHP code into a new 
   wp-config.php file and delete all comments and extraneous newlines. Using a text
   editor that shows newline markings (kinda like Word’s “Show/Hide Para” function)
   might also help you find the problem.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Installing on Localhost’ is closed to new replies.

## Tags

 * [installing](https://wordpress.org/support/topic-tag/installing/)

 * In: [Installing WordPress](https://wordpress.org/support/forum/installation/)
 * 7 replies
 * 4 participants
 * Last reply from: [Neil Mickelson](https://wordpress.org/support/users/mickelsn1/)
 * Last activity: [20 years, 8 months ago](https://wordpress.org/support/topic/installing-on-localhost-2/#post-257155)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
