4

Typing the command "cake" in console shows no output, no errors or anything like that. It just prints about 4 blank lines.
Has anyone else experience this problem before and how did you fix it?

C:\xampp\htdocs\project\app>cake



C:\xampp\htdocs\project\app>
antoniovassell
  • 1,012
  • 14
  • 24

6 Answers6

3

I have had similar problem a moment ago and I found the solution. the problem was not the path for me. I have turn on the debug from 0 to 2. and it shows some error instead of empty output and I try to fix the error (which was in the core.php) and it works now.

So try to debug it like me and fix the error.

Hope it helps.

Miheretab Alemu
  • 956
  • 2
  • 20
  • 43
1

cake is not directly available in app - while you are in the right folder you still need to call the cake command relative from there:

\app>.\Console\cake

Note that this syntax is unique to Windows

For UNIX use

\app>Console/cake

In case you are using an old app version or didnt bake your application with the Console folder (which you should, though), you can also call the cake core version of it relatively from the APP dir:

\app>..\lib\Cake\Console\cake

(WIN)

\app>../lib/Cake/Console/cake

(UNIX)

Either way the cake file needs to have sufficient execution rights (UNIX mainly) and PHP must be in the system env path. Then it will all work out of the box.

mark
  • 21,691
  • 3
  • 49
  • 71
  • 1
    No its not the folder, I added cake to my path, but even when I run the command in that folder, its the same thing. – antoniovassell May 07 '14 at 09:08
  • cake doesnt (and shouldnt be added to your path). What I just posted definitely works on windows! Note that I updated the answer as I made a typo. – mark May 07 '14 at 10:33
  • 1
    And am saying its not the folder that's the issue, I removed it from the path, same result. I run cake directly from the folder, same result. This was working all along, and just stopped for some reason, not giving "any" output. – antoniovassell May 07 '14 at 11:25
  • Also, did you bake your application and is there a Console folder in your APP dir (as it should be)? – mark May 07 '14 at 19:14
0

Run this command in Cake/Console folder. I think you are not running it in the right folder.

prabhat
  • 620
  • 5
  • 18
0

In this directory:

  C:\xampp\htdocs\project\app>

type this command:

 php Console/cake.php

which will output:

 Current Paths:

-app: app
-working: C:\xampp\htdocs\project\app
-root: C:\xampp\htdocs\project
-core: C:\xampp\htdocs\project\lib

Changing Paths:

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

 ....
decodingpanda
  • 594
  • 9
  • 18
0

Similar issue encountered where Console wasn't outputting anything after installing Cake via Composer instead of git clone - no error, just returning a blank line. To solve it I made a backup of app/ (mv app/ app.bak/) and then used vendor/bin/cake -app app bake to bake a brand new app/ folder. Once that process was complete running Console from app/Console/cake started working again. Then just moved my app.bak/ code back in place. I'm assuming over time the paths present or code in app/Console had become unworkable.

Bringing back in the old code I was able to narrow down the issue to using Apc as a cache engine. Reverting to $engine = 'File'; in core.php and bootstrap.php solved the problem and Console worked as expected.

chopstik
  • 363
  • 2
  • 10
0

I guess you are using a composer powered cakephp which has console command in Vendor folder. If so, try this ;

AppRoot/Vendor/bin/cake

or you may try with full path to fw;

PATH_TO_APP\Vendor\cakephp\cakephp\lib\Cake\Console\cake.bat
Erdinç Çorbacı
  • 1,187
  • 14
  • 17