Sublime directory Surf the web anonymous Pagerank Monitor


Fatal error: Cannot instantiate non-existent class: access_user

utstephens
Wed 14 March 2007, 05:15 pm GMT +0100
I have tried for weeks now to make the access_user class work on my server.  I used an older version (1.72) of the class for one of my other websites (on a different host) and it worked perfectly.  No problems whatsoever.  Once I tried to use the new version of Access_user (1.96) on my website hosted on Yahoo! it does not work!  I have gotten a whole slew of errors in trying to troubleshoot the problem, but nothing will fix it.  I have been reading through this forum to find an answer but haven't found anything yet.

It started off as a problem with my mysql database.  I fixed all of the hostname, username and password problems.  Then it found out there was a problem with the DOCUMENT_ROOT, it was only printing out "/" and not the whole rootname.  So i had to re-link all of those to my full domain address (in all the files mind you).  Still no go.  I am not at a dead end with this error:

Fatal error: Cannot instantiate non-existent class: access_user in /myfamily/login.php on line 5

Any suggestions where to start troubleshooting from here?

Thanks
Chris Stephens

Nikolas
Wed 14 March 2007, 05:25 pm GMT +0100
Quote
Fatal error: Cannot instantiate non-existent class: access_user in /myfamily/login.php on line 5

This is probably because the class file is not included by the login.php. I guess this has to do with the DOCUMENT_ROOT problem.

utstephens
Wed 14 March 2007, 05:30 pm GMT +0100
Well ya, that is what I thought at first too.  However when I write some obscure code in the 'access_user_class.php' such as:

echo "blah!";

It prints it on the page!  I seriously get this error:

blah!
Fatal error: Cannot instantiate non-existent class: access_user in /myfamily/login.php on line 6

It doesn't make sense.  It must either have something to do with a setting somewhere or some incompatability with my host server.

olaf
Wed 14 March 2007, 06:30 pm GMT +0100
Well ya, that is what I thought at first too.  However when I write some obscure code in the 'access_user_class.php' such as:

echo "blah!";

It prints it on the page!  I seriously get this error:

blah!
Fatal error: Cannot instantiate non-existent class: access_user in /myfamily/login.php on line 6

It doesn't make sense.  It must either have something to do with a setting somewhere or some incompatability with my host server.

try the script as provided
with this structure and tell us if the error still exists:

this is the default dir structure

your_root/classes/access_user/

place all files there an try it again

utstephens
Wed 14 March 2007, 06:54 pm GMT +0100
Holy cow, Olaf you are amazing!  That completely fixed the problem. 

Ok here is what I did for all those who have the same problem.  I though that my server/host was not going to work using the 'DOCUMENT_ROOT' server definition because it only came up with "/" when called upon.  If document root does not for some reason work for you, just use the basic directory link like Olaf mentioned above.  Here is what I changed to make it work:

VERSION THAT DID NOT WORK:
---------------------------------------------------------------------------------------------------
<?php
ini_set ( "display_errors" , 1 );
include("http://www.mywebsite.com/myfamily/classes/access_user/access_user_class.php");

$my_access = new Access_user(false);

// NOTICE HOW I HAD THE FULL WWW?  THAT DIDNT WORK
---------------------------------------------------------------------------------------------------

VERSION THAT DID WORK:
---------------------------------------------------------------------------------------------------
<?php
ini_set ( "display_errors" , 1 );
include("/myfamily/classes/access_user/access_user_class.php");

$my_access = new Access_user(false);

---------------------------------------------------------------------------------------------------

I hope this helps anybody else with the same problem.  And thank you Olaf for the help!

Chris Stephens

olaf
Wed 14 March 2007, 06:57 pm GMT +0100
yeah that has to do with some security settings in PHP ;)

Archive for SMF v1.00 by N.P. Valid XHTML 1.0 Transitional