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__) . '/');
ABSPATH
to point directly to a WP installation, likedefine('ABSPATH', '/my/webroot/path/wp/');
- hmm? It then should use this defined and do not re-define theABSPATH
after wp-config is included...dirname(__FILE__)
will return the absolute path to the concrete (current) file, that means to Your header file (I do not know whether it is a controller or template file...).__FILE__
is in mysite.com/wp/wp-config.php , not my header which is mysite.com/blog