CakePHP立ち上げエラー[DebugKit is not installed. It will help you inspect and debug different aspects of your application. You can install it from GitHub]

CakePHP立ち上げエラー[DebugKit is not installed. It will help you inspect and debug different aspects of your application. You can install it from GitHub]

cakephp_error2

↑CakePHPのデバッグキットをインストールしてほしいようです。

DebugKit is not installed. It will help you inspect and debug different aspects of your application.
You can install it from GitHub

CakePHP debug kit インストール

「GitHub」のリンクをクリックして更に「2.2 branch.」をクリックすると

Install the plugin with Composer from the directory, where your project's composer.json is located:

php composer.phar require cakephp/debug_kit "^2.2.0"

とあるのでcomposer.jsonにrequire で cakephp/debug_kit を バージョン “^2.2.0” で指定すれば良さそうです。

そもそも、バージョン依存管理が出来るComposerがインストールされていなかったので導入しておきました。以下記事参照。

https://normalblog.net/system/composer/install_settings/

 

CakePHPのディレクトリ直下にあったcomposer.jsonを見てみました。

$ vim composer.json

{
 "name": "cakephp/cakephp",
 "description": "The CakePHP framework",
 "type": "library",
 "keywords": ["framework"],
 "homepage": "http://cakephp.org",
 "license": "MIT",
 "authors": [
 {
 "name": "CakePHP Community",
 "homepage": "https://github.com/cakephp/cakephp/graphs/contributors"
 }
 ],
 "support": {
 "issues": "https://github.com/cakephp/cakephp/issues",
 "forum": "http://stackoverflow.com/tags/cakephp",
 "irc": "irc://irc.freenode.org/cakephp",
 "source": "https://github.com/cakephp/cakephp"
 },
 "require": {
 "php": ">=5.2.8",
 "ext-mcrypt": "*"
 },
 "require-dev": {
 "phpunit/phpunit": "3.7.*",
 "cakephp/debug_kit" : "2.2.*"
 },
 "bin": [
 "lib/Cake/Console/cake"
 ]
}

CakePHP2.6をインストールした際のcomposer.jsonに最初から「”cakephp/debug_kit” : “2.2.*”」と記載がありました。

このままcomposerを使用してインストールすればdebug kitも入りそうでしたので以下コマンドを実行しました。

# composer install

これでインストールまで出来ました。

※実はここで1日はまりました。その際に出ていたエラー対応は以下に記録しています。

https://normalblog.net/system/composer/cakephp2-x_debug_kit_install_error/

CakePHP debug kit 設定

app/Config/bootstrap.php に以下を追記。コメントになっていました。

CakePlugin::load(‘DebugKit’);

app/Controller/AppController.php に以下を追記。

class AppController extends Controller {
 var $components = array('DebugKit.Toolbar');   // ここだけ追記
}

これでリロードすると以下のように緑になりました。

debugkit_plugin_is_present

※ここで実はエラーが出たのですが、それは以下記事参照してください。

https://normalblog.net/system/cakephp/debug_kit_load_error/

Comments

No comments yet. Why don’t you start the discussion?

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です