1

After I do:

zf -p create dbtable.from-database

I get:

Cannot redeclare class Zend_Loader in /home/user/public_html/proj.dev/library/Zend/Loader.php on line 31

If we change the application.ini file generated and we commented the following line:

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

This seemed to work, and since we already have this on your public/index.php file, it seems that this is ok to comment.

However, I do not understand what is the relation between the provided error, and the lucky solution.

Does anyone know why this happened ?

MEM
  • 30,529
  • 42
  • 121
  • 191
  • The same is to say. Go learn, and be a master. Go on profound study for 10 years, and keep always updated. Go to seminars, buy books, practice every day. At the end, you will have your answer. Well... I know that. Still, stackoverflow exists. :) – MEM May 02 '11 at 00:07

2 Answers2

1

Usually this error occurs when include_path is set twice! You have set the include_path somewhere else already.

DarkLeafyGreen
  • 69,338
  • 131
  • 383
  • 601
  • This seems to be a zend_tool cli miss implementation then. I've never have added a include on neither of those places and I've only used zend tool to build this structure. Somewhere during the process either the generated index file or the generated application.ini file are creating an include path that they shouldn't. I presume this will happen often when other ppl start to use zend tool cli often. – MEM May 03 '11 at 16:47
1

I got the same error when I tried to run zf create dbtable.from-database

Found out what the issue was. My zf command was being run from /usr/local/zend/share/ZendFramework/library/Zend but my project had it's own Zend Framework located at /Applications/MAMP/htdocs/NPT2/library/Zend

What I did to fix the error was remove the Zend folder in my project's library folder, and then set include_path in my php.ini file to point to /usr/local/zend/share/ZendFramework/library

See if that works for you.

Chris O'Connell
  • 363
  • 2
  • 11
  • Hi, why do you say "remove the Zend folder in my project's library folder, and then set include_path in my php.ini file to point to /usr/local/zend/share/ZendFramework/library" when the Quick Start tutorial in the Zend Framework docs states differently? When is the docs correct then? http://framework.zend.com/manual/en/learning.quickstart.create-project.html#learning.quickstart.create-project.create-project – marienke May 23 '12 at 08:32
  • @Enke The point is to have only one install of Zend framework. You could also remove the one at /usr/local/zend/share/ZendFramework/library and only have one in your project library folder. Don't know if one is better then the other. I like having just one centrally located install, that way if I update it, then every Zend app I have gets the latest version. Locating it in your project's library folder is simpler to setup however, which is prob why the Quick Start guide suggests it. – Chris O'Connell Jun 03 '12 at 02:30