cakephpcakephp-2.2

Baking in cakePHP 2 in windows 7


I am new to the cakePHP and first starting to bake so I face this problem when following a tutorial and do the following:

  1. Add paths to php and cakePHP
  2. Run the CMD and type "cake" and get the following message:
Welcome to CakePHP v2.2.3 Console
---------------------------------------------------------------
App : C:
Path: C:\
---------------------------------------------------------------
Current Paths:

 -app: C:
 -working: C:
 -root: C:
 -core: C:\xampp\cake\lib

Changing Paths:

Your working path should be the same as your application path to change your pat
h use the '-app' param.
Example: -app relative/path/to/myapp or -app /absolute/path/to/myapp

Available Shells:

[CORE] acl, api, bake, command_list, console, i18n, schema, test, testsuite, upg
rade

To run an app or core command, type cake shell_name [args]
To run a plugin command, type cake Plugin.shell_name [args]
To get help on a specific command, type cake shell_name --help

3.I type in the path where the app that's being developed is saved, that is:

C:\xampp\htcdocs\blog
I have tried to add all possible paths like C:...blog\app, C:...blog\app\console, C:...blog\lib\cake\console, but I still get the message that the system cannot find the path specified.

I have been looking for the solution for couple of hours now and could only find it for the previous versions of cakePHP or any other OS but Windows 7.


Solution

  • You may want to set your path to folder/app/console of your project. Also to the folder where php.exe resides. This is the way i've set mine and works for me.

    Try typing cake help in cmd, it should show cake help file.

    edit: i have change this answer so everyone can have cake configured ok!

    C:\xampp\htdocs\proyecto\app>set PATH=C:\Program Files\Common Files\Microsoft Sh
    ared\Windows Live;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\win
    dows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Windows Live\Shared;C:\Pr
    ogram Files\TortoiseSVN\bin;C:\xampp\htdocs\proyecto\app\Console;C:\xampp\php;
    

    then from your "project" folder (in my case "proyecto") go to app in a cmd window and type "cake help" it should show something like:

    Welcome to CakePHP v2.2.1 Console


    App : app Path: C:\xampp\htdocs\proyecto\app\


    Current Paths:

    -app: app

    -working: C:\xampp\htdocs\proyecto\app

    -root: C:\xampp\htdocs\proyecto

    -core: C:\xampp\htdocs\proyecto\lib

    wich means, everything is good to go!