• Resolved OldCorkonian

    (@josullivanc)


    Hi there,

    Quick question – I am pulling content to a child theme using my own DB, separate from the WP DB.

    Is it safe to place my custom db_connect.php file in htdocs? ie. Is this folder readable via the Web?

    Thanks in advance!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    Shouldn’t be, only the public_html structure should be accessible. It depends on your specific server configuration though, you’d need to ask your host to be sure.

    That said, since the credentials are in a PHP file, assuming the server is properly configured, they are safe even in public_html. PHP code should never be visible to the public, only what is explicitly echoed out. Look at the default location for wp-config.php. It contains DB credentials and resides in a publicly accessible folder.

    Thread Starter OldCorkonian

    (@josullivanc)

    With thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Where to place db_connect.php’ is closed to new replies.