Current time: 06-01-2024, 09:40 AM Hello There, Guest! (LoginRegister)


Post Reply 
[SOLVED]White screen instead of login page? Problem with making database connection?
Author Message
pgentoo Offline
Member
*****
Dev Team

Posts: 326
Joined: Mar 2007
Reputation: 0
Post: #1
[SOLVED]White screen instead of login page? Problem with making database connection?
I've done a clean install of last nights SVN, and everything went perfectly, however when i launch the login page I get a white screen instead of the login. I've tried this with both mod_php5 and fcgid/php5. I've confirmed that php is working, by creating a page with a phpinfo() call, and it is working as expected.

I've traced down the error to the include/sql.php file to this line:

Code:
@$sql = Database::connect(Config::get('DB_USER'), Config::get('DB_PASS'), Config::get('DB_TYPE'), Config::get('DB_HOST'), Config::get('DB_NAME'))
        or system_message('ERROR: Unable to connect to SQL server !<br>SQL returned: ' . $sql->ErrorMsg());

If i put a debug message right before it, it works. But if i put something after it, it doesn't. It seems that it is unable to connect to the db (for some unknown reason, as my db seems to be functioning normally), but it doesn't log any messages, put anything to the screen, etc.

It seems that the problem is inside the class.database.php... Anyone have the same problems?
(This post was last modified: 08-02-2008 10:29 AM by pgentoo.)
07-19-2008 03:12 AM
Find all posts by this user Quote this message in a reply
pgentoo Offline
Member
*****
Dev Team

Posts: 326
Joined: Mar 2007
Reputation: 0
Post: #2
RE: White screen instead of login page? Problem with making database connection?
I've created a test php script, which is able to connect to my db, use ispcp database, and query a table... So my php/mysql installations are working fine...

Code:
<?php
       mysql_connect("localhost", "root", "notmyrealpassword") or die("unable to connect to db");
       mysql_select_db("ispcp") or die("Unable to select ispcp database");

      $result = mysql_query("select * from admin");
      $array = mysql_fetch_array($result);
      print_r($array);
?>

this executes and shows me the contents of the admin table...

Any ideas?
07-19-2008 10:37 AM
Find all posts by this user Quote this message in a reply
sci2tech Away
Senior Member
****

Posts: 1,285
Joined: Jan 2007
Reputation: 23
Post: #3
RE: White screen instead of login page? Problem with making database connection?
It must be a problem with the template page. Check if the page required exists in theme folder.
07-19-2008 05:29 PM
Visit this user's website Find all posts by this user Quote this message in a reply
pgentoo Offline
Member
*****
Dev Team

Posts: 326
Joined: Mar 2007
Reputation: 0
Post: #4
RE: White screen instead of login page? Problem with making database connection?
index.tpl exists in the template directory... looks good to me. Any other ideas?
07-19-2008 05:36 PM
Find all posts by this user Quote this message in a reply
pgentoo Offline
Member
*****
Dev Team

Posts: 326
Joined: Mar 2007
Reputation: 0
Post: #5
RE: White screen instead of login page? Problem with making database connection?
Last night i took a clean image install of Gentoo 64bit, and did the prerequisite install from scratch. I then did the ispcp install from current SVN.

I'm still getting the same exact issue. It is not an issue with my mysql database, or php/apache, as i'm able to run phpmyadmin from http://myipaddresshere/tools/pma/ and login and manage my databases fine. I show that the ispcp database has only 32 records in it total, for a default install without awstats. Does this sound right?

I find this particularly interesting... If I load up the ispcp site (well, try to), it creates one session file with 0 bytes. If i load up phpmyadmin, then it creates another session file and is able to use it properly. When i examine the differences between these session files i see the following:

Code:
ispcp phptmp # ls -la
total 28
drwxrwxr-x  3 vu10000 apache  4096 Aug  1 14:13 .
dr-xr-xr-x 12 vu10000 apache  4096 Aug  1 13:29 ..
drwxrwxr-x  6 vu10000 apache  4096 Aug  1 12:00 .svn
-rw-------  1 apache  apache 13996 Aug  1 14:13 sess_0b4bc712acf94981bb487976e9376d7709423310
-rw-------  1 apache  apache     0 Aug  1 14:05 sess_378a782f16856623b37d9887594c4879


notice that the name of the one that is broken (ispcp) is way shorter than the other. Is it possible the session filename is getting truncated, so when it goes to use it it can't find a match?

Any ideas on how to fix this?
08-02-2008 07:18 AM
Find all posts by this user Quote this message in a reply
pgentoo Offline
Member
*****
Dev Team

Posts: 326
Joined: Mar 2007
Reputation: 0
Post: #6
RE: White screen instead of login page? Problem with making database connection?
It is still dying at the Database connection. I've modified include/sql.php to do:

Code:
echo("About to connect to the database");

@$sql = Database::connect(Config::get('DB_USER'), Config::get('DB_PASS'), Config
::get('DB_TYPE'), Config::get('DB_HOST'), Config::get('DB_NAME'))
        or system_message('ERROR: Unable to connect to SQL server !<br>SQL retur
ned: ' . $sql->ErrorMsg());

echo("Just connected to the database");

I simply get: "About to connect to the database" written to the screen.


Note: I've tried echo'ing out all the config settings being used to connect, and they all show correct values.
(This post was last modified: 08-02-2008 08:21 AM by pgentoo.)
08-02-2008 08:02 AM
Find all posts by this user Quote this message in a reply
pgentoo Offline
Member
*****
Dev Team

Posts: 326
Joined: Mar 2007
Reputation: 0
Post: #7
RE: White screen instead of login page? Problem with making database connection?
Problem Solved. It turns out PHP on gentoo defaults to having PDO support turned off. Maybe there was a switch to PDO as part of vacancy's UI updates? Anyway, it works now! I had to add quite a few use flags in when compared to the ones listed in the current Gentoo installation wiki.

I'll update the gentoo instructions to support current RC6/SVN code base, but only after I do another clean install to ensure I didn't forget to document something. Smile
08-02-2008 10:29 AM
Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)