Zend Framework - 从数据库创建数据库表 - 错误
我这样做之后:
zf -p create dbtable.from-database
我得到:
无法重新声明类 Zend_Loader /home/user/public_html/proj.dev/library/Zend/Loader.php 第 31 行
如果我们更改生成的 application.ini 文件,并评论以下行:
;includePaths.library = APPLICATION_PATH "/../library"
这似乎有效,并且由于我们已经在您的 public/index.php 文件中添加了此内容,因此似乎可以发表评论。
但是,我不明白提供的错误与幸运的解决方案之间有什么关系。
有人知道为什么会发生这种情况吗?
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 ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
通常当
include_path
设置两次时会发生此错误!您已经在其他地方设置了include_path
。Usually this error occurs when
include_path
is set twice! You have set theinclude_path
somewhere else already.当我尝试运行
zf create dbtable.from-database
时遇到同样的错误,找出问题所在。我的 zf 命令是从
/usr/local/zend/share/ZendFramework/library/Zend
运行的,但我的项目有自己的 Zend 框架,位于/Applications/MAMP/htdocs/NPT2/ library/Zend
我修复错误的方法是删除项目库文件夹中的 Zend 文件夹,然后将 php.ini 文件中的 include_path 设置为指向 /usr/local/zend/share/ZendFramework/library
看看这是否适合你。
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.