News:

Wondering if this will always be free?  See why free is better.

Main Menu

Trying to Use SSI With WordPress

Started by Eris Siva, November 05, 2004, 02:13:52 PM

Previous topic - Next topic

Eris Siva

I would really like to use SSI on my homepage to show some quick info about my forum and such, but I use WordPress for my homepage.

WordPress already uses a require:

<?php require('./wp-blog-header.php'); ?>


Is there some way to have 2 requires at once?
The thing is that WP uses a very basic templating process, so it's basically all run from the CSS file.
It's not to hard to get around for editing.

But, that require is necessary, because it calls most every other function.
I tried including the 2 "require"s (one for SMF, one for WP), but it just gave me errors for both files.
Said that the data couldn't be found.

As soon as I remove the SMF require, it goes back to working perfectly fine.
When I put in the the SMF one and take out the WP require, the entire thing crashes - but it's supposed to. The page won't display without that data.


So, is there an easy fix in order to have the two requires on the front page?

[Unknown]

Try putting the SMF one above the Wordpress one.  What errors do you get?

-[Unknown]

Eris Siva

I'm getting this error, which is wierd because it doesn't even make sense....

Quote
Database Error: Table 'local_blog.smf_sessions' doesn't exist
File: /home/*/public_html/community/Sources/Load.php
Line: 1250
Warning: Unknown(): A session is active. You cannot change the session module's ini settings at this time. in Unknown on line 0

That's wierd, because that's not even the right database....
I have the SMF install in a completely different database. What it's listing above is the blog database with a table that doesn't exist.
Wha????

[Unknown]

Okay.... I'm afraid you're going to have to use DIFFERENT users/MySQL accounts for each software.

For example, SMF may be using "onlyAccount" and Wordpress may be using "onlyAccount".  You'll need to create another account ("AnotherAccount" :P) for one of them... this way, they will both hang on to their connections separately.

Or do they already use separate accounts?

-[Unknown]

Christian A. Herrnboeck

I think he is using different ones :S Shot in the dark: Instead of using require(); use include(); or even @include(); (to suppress the warnings) I'm thinking this is because both peices of software are trying to make a session at the same time, and one is conflicting with the other :P

Christian


Farmers:Producing food for the world!

[Unknown]

Quote from: fm-2 on November 05, 2004, 07:26:51 PM
I think he is using different ones :S Shot in the dark: Instead of using require(); use include(); or even @include(); (to suppress the warnings) I'm thinking this is because both peices of software are trying to make a session at the same time, and one is conflicting with the other :P

Christian

No, here's why I'm saying what I'm saying:

The problem is being caused by SSI loading a database-driven session manager.  In itself, this is not a problem - it's a good thing!  However, because they are using the same account, when Wordpress issues a mysql_select_db call, it changes the SAME connection's active database name.  Doing this means that when the database driven session handler closes (which happens at the exit of the script) it will try to access the wrong database.

Putting a @ to supress errors will not help at all.  That's ignoring the problem that's still there, which won't solve anything. (also note that sessions will not work at all if you do that.)

If you want to "give in" to a "quick fix", turn off database driven sessions.  However, if you do this, none of the functions (like ssi_boardNews()) will work, but you at least sessions will.

My post was, indeed, not a shot in the dark.  It came from analysis of the error message, and possible causes of it.  The most likely (by far) is what I mentioned.

-[Unknown]

Eris Siva

Yay! It worked.

Seems it was because of the same database user.
Thanks for the help, [Unknown].
;D

Advertisement: