Title: Cannot retrieve WP database credentials
Last modified: August 22, 2016

---

# Cannot retrieve WP database credentials

 *  Resolved [Michael](https://wordpress.org/support/users/mkalina/)
 * (@mkalina)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/cannot-retrieve-wp-database-credentials/)
 * I recently upgraded NinjaFirewall to
 *     ```
       Firewall 		Enabled
       PHP hook 		Enabled
       PHP SAPI 	  	CGI-FCGI
       Engine version 	  	1.2.6
       Rules version 	  	20140810
       ```
   
 * Yet I keep getting this error message:
 * > NinjaFirewall fatal error : cannot retrieve WordPress database credentials.
   > Please review your installation. Your site is not protected.
 * How can I help to debug this?
 * [https://wordpress.org/plugins/ninjafirewall/](https://wordpress.org/plugins/ninjafirewall/)

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

 *  Plugin Author [nintechnet](https://wordpress.org/support/users/nintechnet/)
 * (@nintechnet)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/cannot-retrieve-wp-database-credentials/#post-5247350)
 * Hi,
 * This usually means you made changes to the wp-config.php (DB_NAME, DB_USER, DB_PASSWORD,
   DB_HOST or $table_prefix) and the firewall cannot parse it.
 * You can debug it with [this PHP script](http://nintechnet.com/ninjadbcheck_php.txt)
   and paste the results here.
 *  Thread Starter [Michael](https://wordpress.org/support/users/mkalina/)
 * (@mkalina)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/cannot-retrieve-wp-database-credentials/#post-5247355)
 * Hi,
 * Thank you for the fast feedback. The result from the script is
 *     ```
       cannot read DB_NAME
       cannot read DB_USER
       cannot read DB_PASSWORD
       cannot read DB_HOST
       cannot read table_prefix
       ```
   
 * which is odd, as I have not changed anything except adding these lines right 
   in front of “That’s all, stop editing! Happy blogging.”:
 *     ```
       define( 'SD_HIDE_MARKDOWN_BOX', true );
       define('FORCE_SSL_ADMIN', true);
       define('DISALLOW_FILE_EDIT', true);
       ```
   
 * What is the next step for debugging/finding the error?
 *  Plugin Author [nintechnet](https://wordpress.org/support/users/nintechnet/)
 * (@nintechnet)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/cannot-retrieve-wp-database-credentials/#post-5247357)
 * Is the $table_prefix value using single quotes (‘) and not double-quotes(“) ?
 * $table_prefix = ‘whatever’; < will be okay
    $table_prefix = “whatever”; < will
   not be okay
 *  Thread Starter [Michael](https://wordpress.org/support/users/mkalina/)
 * (@mkalina)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/cannot-retrieve-wp-database-credentials/#post-5247358)
 * All values are in single quotes.
 *  Plugin Author [nintechnet](https://wordpress.org/support/users/nintechnet/)
 * (@nintechnet)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/cannot-retrieve-wp-database-credentials/#post-5247360)
 * Can you mask the DB name, username and password and send me a copy of your wp-
   config.php to contact-at-nintechnet.com ?
 *  Thread Starter [Michael](https://wordpress.org/support/users/mkalina/)
 * (@mkalina)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/cannot-retrieve-wp-database-credentials/#post-5247371)
 * Done.
 *  Plugin Author [nintechnet](https://wordpress.org/support/users/nintechnet/)
 * (@nintechnet)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/cannot-retrieve-wp-database-credentials/#post-5247390)
 * I did not receive it yet.
 *  Plugin Author [nintechnet](https://wordpress.org/support/users/nintechnet/)
 * (@nintechnet)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/cannot-retrieve-wp-database-credentials/#post-5247431)
 * I received it. But if I run the test script, it works:
 *     ```
       DB_NAME: OK
       DB_USER: OK
       DB_PASSWORD: OK
       DB_HOST: OK
       table_prefix: OK
       ```
   
 * Do you have an encoding issue with the original file? I can see, for instance,
   it is using CR/LF (Windows format) rather than LF.
 *  Thread Starter [Michael](https://wordpress.org/support/users/mkalina/)
 * (@mkalina)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/cannot-retrieve-wp-database-credentials/#post-5247565)
 * Hi, here is an update. On a completely different server, I have exactly the same
   problem except that when running your debug-script, everything is okay. Also,
   there is no additional variables configured in wp-config.php.
 * This time, however, it is WordPress 4.0 and 1.2.6/20140810.
 *  Plugin Author [nintechnet](https://wordpress.org/support/users/nintechnet/)
 * (@nintechnet)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/cannot-retrieve-wp-database-credentials/#post-5247566)
 * Hi,
 * I just cannot find out what the problem is.
    Do you have a wp-config file that
   works with NinjaFirewall ? You could try to copy it to the server where you have
   the problem, and simply edit the DB_NAME, DB_USER, DB_PASSWORD, DB_HOST and $
   table_prefix, then check if that works ? I am thinking about a possible encoding
   issue. Or maybe ensure that you uploaded it via FTP using ASCII mode rather than
   binary ?

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

The topic ‘Cannot retrieve WP database credentials’ is closed to new replies.

 * ![](https://ps.w.org/ninjafirewall/assets/icon-256x256.png?rev=976137)
 * [NinjaFirewall (WP Edition) - Advanced Security Plugin and Firewall](https://wordpress.org/plugins/ninjafirewall/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ninjafirewall/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ninjafirewall/)
 * [Active Topics](https://wordpress.org/support/plugin/ninjafirewall/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ninjafirewall/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ninjafirewall/reviews/)

## Tags

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

 * 10 replies
 * 2 participants
 * Last reply from: [nintechnet](https://wordpress.org/support/users/nintechnet/)
 * Last activity: [11 years, 9 months ago](https://wordpress.org/support/topic/cannot-retrieve-wp-database-credentials/#post-5247566)
 * Status: resolved