Baking with CakePhp in Windows Using Xampp

One of the many great things about CakePHP is the ability to use the in built "bake" script that will automatically create all your controllers and views files including all the source code.This article will begin by settingup everything you need to get "bake" working under windows.
I have read many books on CakePHP and it seems when it comes to baking in CakePHP, most authors have left the Windows guys in the dark.I have detailed the steps you will need to start.

First we need to setup windows so that it knows the location of PHP. Right click on "My Computer" and select "properties"
Select the "Advanced Tab"
Click the "Environment variables" button at the bottom
Under the :System variables" find the "Path" variable and click "edit"

Now add the full path of your PHP directory in your server e.g "C"\SERVER\php5\php"separared by a semi colon and the path to your application e.g C:\Xampp or Wamp\htdocs\cakeblog\cake\console.

You find the Path system variable and add your PHP (C:\wamp or xampp\php;) and cake console (C:\wamp or xampp\www or htdocs\cake\cake\console) paths, separated by semicolons.
Now follow the next steps:
1. Go to command promt
C:\Documents and Settings\your name here>cd\
2. Change your location to php path
C:\>cd C:\wamp\bin\php\php5.2.9-2
3 Start bake
C:\wamp\bin\php\php5.2.9-2>php.exe C:/wamp/www/cakephp/cake/console/cake.php bake
If everything went well you should be seeing the below screenshot.Hope this helps
Welcome to CakePHP v1.2.1.8004 Console
—————————————————————
App : app
Path: C:/wamp/www/cakephp/app
—————————————————————
Interactive Bake Shell
—————————————————————
[D]atabase Configuration
[M]odel
[V]iew [C]ontroller
[P]roject
[Q]uit
What would you like to Bake? (D/M/V/C/P/Q)
>
Share