20 October 2011 ~ 4 Comments

Cannot redeclare class Zend_Loader

I have been struggeling with a simple issue with Zend Frameworks Zend Loader this evening that I thought was worth mentioning, this might help someone else out there.

I downloaded the latest version of Zend Framework, installed it, setup my project and crated the database. But, when I was going to use Zend Frameworks command line tool and create the models using:

$ zf.sh create dbtable.from-database

I got the following error message:

Fatal error: Cannot redeclare class Zend_Loader in /mylocation/library/Zend/Loader.php on line 31

I had not touched a single thing. Everything was a default Zend Framework install.

What turned out to be the solution was to edit the application/config/application.ini file and comment out the following line:

includePaths.library = APPLICATION_PATH "/../library"

Or completely remove it.

Hope this helps someone. 🙂

4 Responses to “Cannot redeclare class Zend_Loader”

  1. Ivan Jouikov 8 December 2011 at 06:06 Permalink

    Hi Nils,

    I follow your blog and I recently started my own on ExtJS, and I was wondering if you’d be interested in link exchange. Please let me know!

    Thank you,


  2. Ivan Jouikov 8 December 2011 at 06:06 Permalink

    My blog is by the way: WhatIsExtJS.com

  3. eiad 24 July 2013 at 03:23 Permalink

    may be I’m a little bit late for figuring out and visit you lovely blog
    I solved this problem with couple steps:
    1# as you know you should have zend folder pasted in your application/library just copy it from {zend framework path}\library to {your application path}\library and paste it this will include all frame work required modules to your application
    2# open config.ini and then just update
    includePaths.library = APPLICATION_PATH "/../library"

    includePaths.library = APPLICATION_PATH "/../library/zend"
    that’s it 🙂
    best regards

  4. I’ll fix it!

Leave a Reply