Welcome Guest, Not a member yet? Register   Sign In
__autoload error :
#1

[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
#2

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

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

[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.
#4

[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




Theme © iAndrew 2016 - Forum software by © MyBB