Page 1 of 1

Fatal error: Class not found

Posted: Fri Jun 13, 2008 6:47 am
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.

Re: Fatal error: Class not found

Posted: Fri Jun 13, 2008 7:25 am
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.

Re: Fatal error: Class not found

Posted: Fri Jun 13, 2008 7:45 am
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.

Re: Fatal error: Class not found

Posted: Fri Jun 13, 2008 7:47 am
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.

Re: Fatal error: Class not found

Posted: Fri Jun 13, 2008 1:29 pm
by RobertGonzalez
Also, for good measure, you should never try to hit a file without checking if the file_exists() first.