The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Permissions, db or sql issue?
I realize this isn't a specific vbulletin issue, but I'm pulling my hair out trying to determine why I can't include global.php ouside of my forums directory.
I'm attempting to include global.php in my index (as well as a few other files) so I can load forum stats. This is my php: Code:
$curdir = getcwd (); $forumpath = './forums/'; chdir($forumpath); include('./global.php'); chdir ($curdir); Code:
ls -al forums/global.php -rw-r--r-- 1 www-data www-data 2071 Jan 2 05:56 forums/global.php Code:
$con = mysql_connect("localhost","user","pass"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("db", $con); |
#2
|
|||
|
|||
What happens exactly? Are you getting an error?
|
#3
|
|||
|
|||
No errors on the page, and I don't see anything in my logs.
|
#4
|
|||
|
|||
OK, but there must be some way that you know it isn't working.
|
#5
|
|||
|
|||
Yes, this was working 100% on another server, which is why I'm thinking it's something related to permissions or mysql. I don't think it's a php error as nothing has changed, except forum paths and database information.
|
#6
|
|||
|
|||
But you still haven't said exactly what's not working. Are you getting a white page? Just not getting the expected results somewhere?
It could be the cookie path settings. If your script isn't in the forum directory you need to set the cookie path to '/' or else your custom script won't see you as logged in. |
#7
|
|||
|
|||
The bridge is to post new topics/stats to the index. I have a seperate login bridge that is working fine.
I'm using a cron job to run a php script that grabs forum stats (new posts, hot posts, etc.), and writes them to a file to be included in the index (the files are writable). The index isn't updating where I'm including the stats, but if I manually change these files it shows on the index. So I can narrow it down to the php file called by cron. This is the problem: Access denied for user 'www-data'@'localhost' (using password: NO) It's using www-data because no connection is being made to the database. I figured if it was using global.php that would take care of the db connection right? |
#8
|
|||
|
|||
So you're saying that your script includes global.php, then tries to use the mysql_ php calls assuming the database connection has been setup? That does sound like it should work so I guess I'm not a lot of help. Did you compare the config.php settings with the server that works?
|
#9
|
|||
|
|||
Quote:
I appreciate you trying to help. I've searched everywhere I can think of for the solution, and nobody seems to have any idea. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|