Fatal error: Class not found

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ratroutus
Forum Newbie
Posts: 2
Joined: Fri Jun 13, 2008 6:43 am

Fatal error: Class not found

Post by ratroutus »

Dear all,
i'm getting this error Fatal error: Class not found while trying to run my page.
i'm using php5.
any ideas please?
i found many topics over the net but none is solved.
Thanks for your help.
User avatar
Frozenlight777
Forum Commoner
Posts: 75
Joined: Wed May 28, 2008 12:59 pm

Re: Fatal error: Class not found

Post by Frozenlight777 »

sounds like you're trying to use methods or properties from an outside class and you don't have the class itself included. I don't know though because there's no code to look at.
ratroutus
Forum Newbie
Posts: 2
Joined: Fri Jun 13, 2008 6:43 am

Re: Fatal error: Class not found

Post by ratroutus »

Hey,

my code is the following:
require($DOCUMENT_ROOT."/unilog/library/hIniFileReader.inc");
$ini = new IniFileReader($DOCUMENT_ROOT."/unilog/config.ini");

when i run my page i get the following message:
Fatal error: Class 'IniFileReader' not found ...

it works well over php4 over a pc, i copied the website over another pc where php5 is installed. while running my website i get this error.

thanks for your help.
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Re: Fatal error: Class not found

Post by superdezign »

Try echoing $DOCUMENT_ROOT. It is possible that you were using register_globals on the former website, and $DOCUMENT_ROOT was created as a result of it.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Re: Fatal error: Class not found

Post by RobertGonzalez »

Also, for good measure, you should never try to hit a file without checking if the file_exists() first.
Post Reply