0

I moved the wp-config to the hosting root and put it in a new directory and then I included it from the WordPress directory like so: include("../../my-fast-cars/fast-cars.php"); this gave me white screen of death on admin pages and some other pages, moving wp-config back to the WordPress directory immediately solved it. What could I be doing wrong?

BootUp
  • 25
  • 1
  • 5

2 Answers2

3

wp-config.php includes files, it's not just a config file, and WordPress isn't built to allow putting the file 2 levels up.

However, WordPress already supports loading wp-config.php from 1 level up.

With all of this in mind though, this is only really a protection if you're worried about mis-configuring your server. Unless PHP execution is turned off, which would be a major issue in of itself, wp-config.php won't leak any information.

this gave me white screen of death on admin pages and some other pages

A WSOD is a HTTP 500 error code, to see the real error message you have to look in the PHP error logs. It's the difference between a plane disappearing, and finding its flight recorder/black box.

Tom J Nowell
  • 61,323
  • 7
  • 79
  • 150
0

wp-config needs to be accessible to the public.. I'm guessing that 2 levels up means above the public_html folder (cpanel) at the /home level. If you found a work around to allow access to it at that level you're potentially compromising security. Best to leave it at the same, or only one level up.

orionsweb
  • 1
  • 1