views:

175

answers:

2

Hi,

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

+1  A: 

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 the httpd.conf file (it should be somewhere under your Apache2.2 directory) and change the DocumentRoot 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.

Mike
A: 

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\"