cakephp 在 Windows 7 中烘焙
我是 cakephp 的新手,所以刚刚读完这本说明书,现在正在读 Apress 的“从新手到专业人士的 CakePHP 入门”。我已经阅读了本书的 Bake 部分,但我似乎无法在 Windows 7 中使用它。
我已将路径添加到“环境变量”,因此我不必导航到 cake.bat 的位置但我似乎无法让烘焙工作。
我输入 cake cake -app C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\testBlog\app\ 并得到:
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\Poncho>cake bake -app C:\Program Files (x86)\Apache Software Foundation
\Apache2.2\htdocs\testBlog\app\
♀
Welcome to CakePHP v1.3.3 Console
---------------------------------------------------------------
App : Program
Path: C:\\Program
---------------------------------------------------------------
Bake Project
Skel Directory: C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdo
cs\testBlog\cake\console\templates\skel
Will be copied to: C:\\Program\Files
---------------------------------------------------------------
Look okay? (y/n/q)
[y] >
如果我输入 'y' (不带引号)它运行一些内容,然后询问我数据库配置,我将所有信息放入其中,它完成保存数据库配置信息,然后结束。当我再次尝试蛋糕烘焙时,我只是再次看到上面的屏幕,每次我尝试它似乎都不明白我之前已经设置了它,复制了 Skel 目录并配置了数据库信息。
知道可能出什么问题吗?
提前致谢。
PS
我的应用程序位置位于:C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\testBlog\
好吧,这就是所有 cakephp 东西所在的位置。我应该将 cakephp 核心与每个应用程序文件夹分开吗?或者每个应用程序都应该有自己的 cakephp 东西吗?
例如,我应该将 cakephp 文件和文件夹(cake、插件、供应商等)放在 C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\ 中,然后每个应用程序都在自己的文件夹中,如 testBlog/app
中,或者我是如何做到的?
谢谢大家,
英菲尼迪菲兹
I'm new to cakephp so have just been working through the cookbook and am now working through "Beginning CakePHP from Novice to Professional" by Apress. I have got to the Bake section of the book but I can't seem to get it working in windows 7.
I have added the path to my "Environment Variables" so I don't have to navigate to the location of cake.bat but I can't seem to get baking to work.
I type cake bake -app C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\testBlog\app\
and get:
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\Poncho>cake bake -app C:\Program Files (x86)\Apache Software Foundation
\Apache2.2\htdocs\testBlog\app\
♀
Welcome to CakePHP v1.3.3 Console
---------------------------------------------------------------
App : Program
Path: C:\\Program
---------------------------------------------------------------
Bake Project
Skel Directory: C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdo
cs\testBlog\cake\console\templates\skel
Will be copied to: C:\\Program\Files
---------------------------------------------------------------
Look okay? (y/n/q)
[y] >
If I type 'y' (without quotes) it runs through some stuff then asks me for the db config, I put all the info in and it finishes saving the db config info and then ends. When I try cake bake
again, I just get the above screen again, everytime I try it seems to not understand I've set it up before with the Skel Directory being copied and the db info being configured.
Any idea what could be wrong?
Thanks in advance.
P.S.
My app location is at: C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\testBlog\
well thats where all the cakephp stuff is. Should I have the cakephp core seperate from each app folder? Or should each app have its own cakephp stuff?
For example, should I have my cakephp files and folders (cake, plugins, vendors, etc.) in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\
and then each app in its own folder as in testBlog/app
or is how I've done it okay?
Thanks All,
Infiniti Fizz
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
从
bake
工具的输出来看,路径中的空格似乎使其失效。尝试将 htdocs 目录移动到没有空格的位置,例如c:\htdocs
并查看是否有帮助。要告诉 Apache
htdocs
目录的位置已更改,请找到httpd.conf
文件(它应该位于 Apache2.2 目录下的某个位置)并更改>DocumentRoot
和
到新位置。确保保留尾部斜杠,然后重新启动 Apache。至于将 CakePHP 文件与应用程序分离,您可以采用任何一种方法。我喜欢将 CakePHP 文件和应用程序保存在一个存储库中,这样我就可以检查该项目并立即使其运行。将核心文件与应用程序分开可以在更新 CakePHP 时节省您的时间,尤其是在您有许多应用程序的情况下。如果我开始使用 CakePHP,我会使用前一种方法并专注于熟悉该框架。
Judging by the output of the
bake
tool, spaces in the path seem to throw it off. Try moving your htdocs directory to a location without spaces, e.g.c:\htdocs
and see if that helps.To tell Apache that the location of the
htdocs
directory has changed, find thehttpd.conf
file (it should be somewhere under your Apache2.2 directory) and change theDocumentRoot
and<Directory ... >
to the new location. Make sure to keep the trailing slash, then restart Apache.As for separating CakePHP files from your application, you can do it either way. I like to keep CakePHP files and the app in a single repository, so I can check out the project and get it working right away. Keeping the core files separate from your applications could save you time when updating CakePHP, especially if you have many apps. If I were starting out with CakePHP, I'd use the former method and focus on becoming familiar with the framework.
我想,您不需要真正移动您的应用程序文件夹。只需将 -app 参数放在引号中即可。 cake cake -app "C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\testBlog\app\"
I guess, you don't need to really move your app folder. Just give the -app param in quotes.
cake bake -app "C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\testBlog\app\"