CodeIgniter Forums
__autoload error : - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: __autoload error : (/showthread.php?tid=20052)



__autoload error : - El Forum - 06-26-2009

[eluser]Unknown[/eluser]
Hi,

I am trying to setup my project on a linux server. After doing everything, I am getting the error as mentioned below. I have put the statement:

Code:
echo "<br>class is $class";

in the 'load_class()' in codeigniter/Common.php file.

[output]
class is Benchmark
class is Exceptions
Fatal error: Cannot redeclare __autoload() (previously declared in SERVER_BASE_PATH/system/application/config/config.php:345) in SERVER_BASE_PATH/system/application/config/config.php on line 357
[/output]

I read various posts which mentioned about dompdf, using spl, but that didn't help. Can someone help as to what is the issue here?

:IgniterGuru


__autoload error : - El Forum - 06-26-2009

[eluser]TheFuzzy0ne[/eluser]
Welcome to the CodeIgniter forums.

...So what's the code on lines 345 and 357 of your config.php?


__autoload error : - El Forum - 06-26-2009

[eluser]Phil Sturgeon[/eluser]
Looks like your config.php is being loaded twice. You could use if(!function_exists('__autoload')) around your autoload function, but I would be more concerned about why your config is loading twice in the first place.


__autoload error : - El Forum - 06-26-2009

[eluser]Dam1an[/eluser]
To test if it is as Phil said, just put an echo at the top of your config file, if it appears twice, then that is the problem, otherwise, we need to do some more head scratching