Auto loader not working properly

Topics: Developer Forum, User Forum
Jan 6, 2011 at 5:33 PM


I developed a PHP app thet uses PHPExcel to create excel files. I used windows for development and the PHPExcel works great but when I moved the files into my production environment (linux / PHP 5.3.0) the autoload function doesn´t work as some classes seem to be not found. I've included some echo traces in the autoload tyo see whats going on ad found that the require function only loads one php file, the rest are not found and not readable:

status: ok

status: not found
status: not readable

Fatal error: Class 'PHPExcel_Shared_String' not found in /home/munduslc/public_html/mundus/lib/phpexcel/Classes/PHPExcel/Autoloader.php on line 34

I've checked file permissions and file locations and everything seems to be right but hte require() statement fails to open the stream to this files for some reason.

Please help... it's urgent



Jan 6, 2011 at 7:47 PM

Hi EveryBody I got in touch with my hosting service and it seems it was something related to the PHP versión under which the app was running the issue was present in version 5.3.0 and we moved the version to 5.2.0 and it works perfectly.

Apr 21, 2011 at 8:19 AM

the same question,my php is 5.2.10

Apr 21, 2011 at 10:36 PM

Ensure that the autoloader doesn't clash with the autoloader for any framework that you might be using, or any other libraries that use their own autoloader. There is an entry about this in the FAQ: see this thread for details... while the thread talks about the Joomla autoloader, the same principles may still apply. PHPExcel uses spl_autoload_register, which should allow it to work cleanly with any other libraries/frameworks that also use spl_autoload_register; but isn't guaranteed to work with proprietary autoload functions.