FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » FUDforum Suggestions » virtual hosts support
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: virtual hosts support [message #28066 is a reply to message #26585] Mon, 10 October 2005 04:47 Go to previous messageGo to previous message
ruzam is currently offline  ruzam   Canada
Messages: 44
Registered: July 2005
Karma:
Member
Yeh! Finally found more time to look at this.

Ok, so I have a modified GLOBALS.php that includes a new var $SITES_DIR. I have a modified core.inc that checks for the new global, and includes a GLOBALS over-ride file from the $SITES_DIR using some magic on the $_SERVER['HTTP_HOST'] to determine a domain name. This is good. I have one domain setup this way and FUD appears to be working OK.

So now I'm trying to re-create the FUD tables in a new database for a second domain. In sql/ I've created the 'create_virtual_site.php' script attached. Things are still a bit hard coded for the moment, but basically, given a site name (domain) and a password (SQL database password), it:
(a) sets DBHOST_USER, DBHOST_PASSWORD and DBHOST_DBNAME according to the site name and password (this DB, User and pass were previousely setup in MYSQL)
(b) Generates a new GLOBALS file in the $SITES_DIR for the domain using a reference template
(c) Finally, connects to the database and runs through every .tbl and .sql file in the sql/ directory to create and default the tables.

So far so good, with a few caveats:
- Running the .tbl and .sql files using PHP seems to get tripped up on the query end ';'. Is this a PHP thing or did I just code this wrong? I ended up coding it ot split the queries, strip the ending ';' and feed the queries on at a time.
- UNIX_TIMESTAMP (in def_forum.sql) needs to be specified as 'UNIX_TIMESTAMP()'. Again, is this a PHP thing or is this file incorrect?

So I've got all the tables created and defaulted. But when I attempt to run this forum it duffs with a 'Fatal error: SQL Error has occurred'. The same config file for the new domain can be made to work with an existing FUD database, so I'm pretty sure the initial config setup is correct. The new domain DB is setup exactly the same as the working DB setup, except that this DB was created and loaded from my script, and not from the standard FUD init script.

I don't know what the SQL error is. The sql_errors log file contains dated entries of the failure, but the error message is just garbage. In fact it's the exact same garbage for every line . Looking at my error file for the working forum domain, they are garbage as well. Very frustrating...

How do I find the real error messages?
Why are the error files reporting garbage?
Are the .tbl and .sql files in the sql directory correct or have they been lapsing in the development?
What must be done to correctly build the required tables from scratch for a working forum?
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: dont show catagories if they are invisible
Next Topic: default forum
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Nov 28 17:25:16 GMT 2024

Total time taken to generate the page: 0.03923 seconds