Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other Page outside of WordPress won’t connect to the database

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #34954
    dcp3450
    Participant

    I have a page that must reside outside of my WordPress installation (long story). Using Chris’s example and a few other 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 if fine.

    Any ideas?

    #89862
    dcp3450
    Participant

    The other page/folder is 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.

    #89878
    dcp3450
    Participant

    using the wp-load.php it includes the config file already.

    #89881
    timdesain
    Member

    change wp-load.php with wp-blog-header.php

    require(dirname(CABSPATH).’/wp-blog-header.php’);

    #89897
    dcp3450
    Participant

    turns out what I needed to pull is set via a cookie by wordpress.

Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘Other’ is closed to new topics and replies.