1
NoSalt
Wordpress Module Database Connection Error
  • 2006/7/13 14:52

  • NoSalt

  • Just popping in

  • Posts: 8

  • Since: 2006/7/13


Hello all,

First, the requisite information:

XOOPS Version: 2.0.14
Module Name/Version: WordpressME / 0.3.3
PHP Version: 4.3.9
MySQL Version: 4.1.12
Web Server Software (Apache/IIS/Other): Apache v2
Operating System: RedHat Enterprise Linux 4
Theme you are using: default
Custom template: (Yes/No) No
A full description of the issue:

I successfully installed XOOPS and the base installation works great. My problem started when I attempted to add the WordpressME module. I downloaded the module from the repository page and unpacked it into the directory "/var/www/html/xoops/modules/wordpress/". I logged into XOOPS as admin and went to the "modules" page. I used the "install" button to install Wordpress and it looked as if everything went well. I used phpMyAdmin to look at the XOOPS database and it went from 31 tables to 43 tables (all have the wp prefix for wordpress). The modules page shows that the Wordpress module is active. I went to the main page and clicked the Wordpress button and I get the following error:

"Error establishing the database connection! This probably means that the connection information in your wp-config.php file is incorrect. Double check it and try again."

I looked in the file "/var/www/html/xoops/modules/wordpress/wp-config.php" and the following 4 lines:

define('xoops', XOOPS_DB_NAME);
define('xoops_admin', XOOPS_DB_USER);
define('*****', XOOPS_DB_PASS);
define('localhost', XOOPS_DB_HOST);

Everything looks correct but I keep getting this error.

Any help that anybody can provide will be greatly appreciated.

Thanks in advance for reading

2
NoSalt
Re: Wordpress Module Database Connection Error
  • 2006/7/13 19:44

  • NoSalt

  • Just popping in

  • Posts: 8

  • Since: 2006/7/13


Okay ... there are some new developments.

I modified the /var/www/html/xoops/modules/wordpress/wp-includes/wp-db.php file. Specifically the following two lines:

$this -> dbh = @mysql_connect($dbhost,$dbuser,$dbpassword);

and

$this -> select($dbname);

In place of those two lines I put:

$this -> dbh = @mysql_connect('localhost','xoops_admin','*****');

and

$this -> select('xoops');

After I made those changes everything worked like it was supposed to. I looked further down in that file and found the following line:

$wpdb = new wpdb(WP_DB_USER,WP_DB_PASSWORD,WP_DB_NAME,WP_DB_HOST);

Those variables do not jive with the "XOOPS_DB_XXXX" from the wp-config.php file.

Somehow, those variables aren't getting transfered across the application.

Does anybody have any suggestions for where to make some changes???

Thanks again

3
NoSalt
Re: Wordpress Module Database Connection Error
  • 2006/7/13 20:15

  • NoSalt

  • Just popping in

  • Posts: 8

  • Since: 2006/7/13


Okay ... WHEW!!!

I finally fixed the problem. After copious amounts of grepping I came to realise that the file "wp-config.php" CANNOT BE CHANGED!!!

There were define statements in the file that assigned the "XOOPS_DB_values" to their respective "WP_DB_values". I am so used to modifying the config files for applications that I entered my database information first thing when I didn't even need to.

The WordPress module just inherits the values from the already installed XOOPS application.

So ... a word to the wise ... slow down and DO NOT modify the wp-config.php file.

Have a good one ...

Login

Who's Online

188 user(s) are online (60 user(s) are browsing Support Forums)


Members: 0


Guests: 188


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits