Support » Plugins » Hacks » Page outside of WordPress won't connect to the database

  • I have a page that must reside outside of my WordPress installation (long story). Using a few examples I got the connection to the files set:

    define('WP_USE_THEMES', false);
    define( 'CABSPATH', dirname(__FILE__)); //CABSPATH used to go down one folder
    require(dirname(CABSPATH).'/wp-load.php');

    When I go to the page I get the “Error establishing a database connection” error. The main install of wordpress is fine.

    The other page/folder in on the same server just outside of the wordpress installation folders. I’ve found examples of people who have done this but not anyone who had this problem.

    Any ideas?

Viewing 2 replies - 1 through 2 (of 2 total)
  • What happens if you instead include the wp-config.php file? (i.e. the one with all the database connection details). You can include the file then print out those variables just to ensure that they are correct.

    Thread Starter David Powell

    (@dcp3450)

    I can see the wp-config file and those variables are correct. The wordpress driven site connects fine.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Page outside of WordPress won't connect to the database’ is closed to new replies.