I am in the process of integrating wordpress with opencart.
I have succesfully installed wordpress at mydomain.com/wp , it works fine and I can access everything as needed.
I have this, placed just before the start of my opencart header tag on a specific page.
<?php
/* Short and sweet */
define('WP_USE_THEMES', false);
require('wp/wp-blog-header.php');
?>
and I am receiving an “Error Establishing a Database Connection” error, clearly it is finding wp-blog-header, wordpress at mydomain.com/wp is also working fine and thus connecting to the DB which is why I am confused as to what the problem is. I have a feeling it could be related to this specifically the FILE in wp-config but I am not sure?
if ( !defined('ABSPATH') )
define('ABSPATH', dirname(__FILE__) . '/');
The problem is that the DB_PASSWORD conflicts with one that OpenCart apparently uses this. Changing DB_PASSWORD to DP_WPPASSWD (or a name of your choosing) solves the error. However I now have another error.
Fatal error: Call to a member function main() on a non-object in /xxx/wp/wp-includes/functions.php on line 779