PHP __autoload and auto_prepend_file issue

software development

#1

I run a custom php.ini file so I was able to use auto_prepend_file in the settings, and everything was working just fine until I decided to put an __autoload() function in the prepended file. When I did that PHP shot me an error about redeclaring an already declared function, even though it was only declared once.

Fatal error: Cannot redeclare __autoload() (previously declared in /home/username/php/globalvars.php:37) in /home/username/php/globalvars.php on line 40 Even odder is the fact that it says the next declaration is at the end of the closing brackets of the first declaration, directly after it. I’ve been normally including this file at the top of each file for a while now, and I thought this could make things easier…apparently not. Any ideas anyone? Thanks in advance.


#2

I have the same problem, and don´t find any clue searching all over internet…
Did you get it fixed yet?
Thanks a lot.