Cakephp 3 bin / cake bake - 未定义变量:argv [英] Cakephp 3 bin/cake bake - Undefined variable: argv

查看:381
本文介绍了Cakephp 3 bin / cake bake - 未定义变量:argv的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在较早的时候使用过Cakephp 2.x,现在想要与新版本3.0.0联系。

I've used Cakephp 2.x in earlier times and now I want to get in touch with the new Version 3.0.0

我在Cakephp over composer上安装了Cakephp 2.x,所有工作正常。我改变了Salt和配置的数据库设置。

I installed Cakephp over composer, all worked fine. I've changed the Salt and configured database settings.

当尝试运行bin / cake时,我收到以下错误:

When trying to run bin/cake I'm getting the following error:

Welcome to CakePHP v3.0.0 Console
---------------------------------------------------------------
App : src
Path: /html/APP/myapp/src/
---------------------------------------------------------------
Current Paths:

* app:  src
* root: /html/APP/myapp
* core: /html/APP/myapp/vendor/cakephp/cakephp

Available Shells:

[Migrations] migrations

[CORE] i18n, orm_cache, plugin, server

[app] console

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`

X-Powered-By: PHP/5.6.5
Content-type: text/html; charset=UTF-8

<pre class="cake-error"><a href="javascript:void(0);" onclick="document.getElementById('cakeErr551ffb72d6447-trace').style.display = (document.getElementById('cakeErr551ffb72d6447-trace').style.display == 'none' ? '' : 'none');"><b>Notice</b> (8)</a>: Undefined variable: argv [<b>ROOT/bin/cake.php</b>, line <b>19</b>]<div     id="cakeErr551ffb72d6447-trace" class="cake-stack-trace" style="display: none;"><a href="javascript:void(0);" onclick="document.getElementById('cakeErr551ffb72d6447-code').style.display = (document.getElementById('cakeErr551ffb72d6447-code').style.display == 'none' ? '' : 'none')">Code</a> <a href="javascript:void(0);"     onclick="document.getElementById('cakeErr551ffb72d6447-context').style.display = (document.getElementById('cakeErr551ffb72d6447-context').style.display == 'none' ? '' : 'none')">Context</a><pre id="</span></span></code>code" class="cake-code-dump" style="display: none;"><code><span style="color: #000000"><span style="color:     #0000BB">&nbsp;</span><span style="color: #007700">*/
<span class="code-highlight"><code><span style="color: #000000"><span style="color: #0000BB"></span><span style="color: #007700">include&nbsp;</span><span style="color: #0000BB">dirname</span><span style="color: #007700">(</span><span style="color: #0000BB">__DIR__</span><span sty</span></span></code></span>&nbsp;</span><span     style="color: #DD0000">'/config/bootstrap.php'</span><span style="color: #007700">;
</span></span></code></pre><pre id="cakeErr551ffb72d6447-context" class="cake-context" style="display: none;">$_GET = [
    &#039;/html/APP/myapp/bin/cake_php&#039; =&gt; &#039;&#039;,
    &#039;bake&#039; =&gt; &#039;&#039;
]
$_POST = []
$_COOKIE = []
$_FILES = []
$_SERVER = [
    &#039;SHELL&#039; =&gt; &#039;/bin/bash&#039;,
    &#039;TERM&#039; =&gt; &#039;linux&#039;,
    &#039;SSH_CLIENT&#039; =&gt; &#039;213.188.119.235 53953 22&#039;,
    &#039;SSH_TTY&#039; =&gt; &#039;/dev/pts/1&#039;,
    &#039;LC_ALL&#039; =&gt; &#039;de_DE.utf8&#039;,
    &#039;USER&#039; =&gt; &#039;p252938&#039;,
    &#039;PATH&#039; =&gt; &#039;/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/html/APP/lib/Cake/Console&#039;,
    &#039;MAIL&#039; =&gt; &#039;/var/mail/p252938&#039;,
    &#039;PWD&#039; =&gt; &#039;/html/APP/myapp&#039;,
    &#039;EDITOR&#039; =&gt; &#039;vi&#039;,
    &#039;LANG&#039; =&gt; &#039;de_DE.utf8&#039;,
    &#039;HOME&#039; =&gt; &#039;/home/www/p252938/./&#039;,
    &#039;SHLVL&#039; =&gt; &#039;1&#039;,
    &#039;LOGNAME&#039; =&gt; &#039;p252938&#039;,
    &#039;SSH_CONNECTION&#039; =&gt; &#039;213.188.119.235 53953 172.16.39.19 22&#039;,
    &#039;PHP_SELF&#039; =&gt; &#039;&#039;,
    &#039;REQUEST_TIME_FLOAT&#039; =&gt; (float) 1428159346.8385,
    &#039;REQUEST_TIME&#039; =&gt; (int) 1428159346
]
$_ENV = []
$isCli = false</pre><pre class="stack-trace">[main] - ROOT/bin/cake.php, line 19</pre></div></pre>

出了什么问题?

推荐答案

AS @ndm提到:将register_argc_argv设置为On解决问题。但比我有壳类的Bake无法找到。添加

AS @ndm mentioned: setting register_argc_argv to On solved the Problem. But than I got Shell Class for "Bake" could not be found. Adding

Plugin::load('Bake');

到boostrap.php帮助

to boostrap.php helped

这篇关于Cakephp 3 bin / cake bake - 未定义变量:argv的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆