Typing the command “cake” in console shows no output

大兔子大兔子 提交于 2019-12-10 19:32:39

问题


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>

回答1:


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.




回答2:


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.




回答3:


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




回答4:


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

 ....



回答5:


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.




回答6:


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


来源:https://stackoverflow.com/questions/23508973/typing-the-command-cake-in-console-shows-no-output

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!