「デバッグ」の版間の差分
Mitsuhiro Yoshida (トーク | 投稿記録) |
Mitsuhiro Yoshida (トーク | 投稿記録) |
||
21行目: | 21行目: | ||
あなたが開発者である場合は強くお勧めしますが、それ以外、「DEVELOPER」を使用するメリットはほとんどありません。 | あなたが開発者である場合は強くお勧めしますが、それ以外、「DEVELOPER」を使用するメリットはほとんどありません。 | ||
あなたがエラーメッセージを入手した場合、メモ帳等にコピー&ペーストしてください。HIGHLY RECOMMENDED to turn Debug back to NONE. Debug messages can give clues to a hacker as to the setup of your site. | |||
===デバッグメッセージを表示する=== | ===デバッグメッセージを表示する=== |
2013年5月28日 (火) 18:53時点における版
作成中です - Mitsuhiro Yoshida
デバッグメッセージは「管理 > サイト管理 > 開発 > デバッグ」にて、管理者によって有効にすることができます。
デバッグメッセージは、問題 (トラブル) の分析およびMoodle開発者のサポートを目的としています。あなたのMoodleサイトに問題が発生して、moodle.orgに助けを求める場合、問題箇所を特定するため、開発者はデバッグメッセージを有効にすることを求めることでしょう。デフォルトでは、Moodleはエラーメッセージを一切表示しません。あなたが問題に遭遇した場合 (例 空白画面または不完全な画面)、通常、まず最初にデバッグを有効にしてください。
デバッグ設定
以下、デバッグページの設定です:
デバッグメッセージ
デフォルトは「NONE」です。あなたの選択肢は下記のとおりです:
- NONE
- デバッグ情報を表示しない
- MINIMAL
- 致命的なエラーのみ表示する
- NORMAL
- エラー、警告および注意を表示する
- ALL
- すべての妥当なPHPデバッグメッセージを表示する
- DEVELOPER
- 開発者のための特別Moodleデバッグメッセージ
あなたが開発者である場合は強くお勧めしますが、それ以外、「DEVELOPER」を使用するメリットはほとんどありません。
あなたがエラーメッセージを入手した場合、メモ帳等にコピー&ペーストしてください。HIGHLY RECOMMENDED to turn Debug back to NONE. Debug messages can give clues to a hacker as to the setup of your site.
デバッグメッセージを表示する
There is an option to choose whether to display error messages or simply record them in the server logs.
デバックメール送信
Determines whether or not to enable verbose debug information during sending of email messages to SMTP server.
パフォーマンス情報
The Performance info option determines whether performance info will be included in the footer of the standard theme (and some other themes). Performance info includes the time for the page to load, the amount of memory used to generate the page, cpu usage, load, and the record cache hit/miss ration.
If you add
define('MDL_PERF', true);
define('MDL_PERFDB', true);
define('MDL_PERFTOLOG', true);
define('MDL_PERFTOFOOT', true);
to your config.php file, then it will also count database queries. (This has to be in config.php, because Moodle starts doing DB queries before it loads the config information in the database!
言語ストリングのオリジンを表示する
Helps translators.
バリデータリンクを表示する
Be careful, read the warning.
ページ情報を表示する
To show page information printed in the page footer.
あなたが管理画面にアクセスできない場合の対処方法
If the error is stopping you even getting to the admin screens to turn on debugging, then you can set the debugging setting manually.
URIを直接入力する
The debug settings are at the URL http://.../admin/settings.php?section=debugging
on your server. Sometimes that URL will work, even though the pages you need to go to to get there (for example the site front page) do not. So it is worth trying to enter that URL directly.
config.phpにおいて
In config.php you can add the lines:
$CFG->debug = 2047;
$CFG->debugdisplay = 1;
Or even more debugging messages:
$CFG->debug = 6143;
$CFG->debugdisplay = 1;
Possible settings are as follows:
// Force a debugging mode regardless the settings in the site administration
// @error_reporting(1023); // NOT FOR PRODUCTION SERVERS!
@ini_set('display_errors', '1'); // NOT FOR PRODUCTION SERVERS!
$CFG->debug = 32767; // DEBUG_DEVELOPER // NOT FOR PRODUCTION SERVERS!
// for Moodle 2.0 - 2.2, use: $CFG->debug = 38911;
$CFG->debugdisplay = true; // NOT FOR PRODUCTION SERVERS!
// You can specify a comma separated list of user ids that that always see
// debug messages, this overrides the debug flag in $CFG->debug and $CFG->debugdisplay
// for these users only.
$CFG->debugusers = '2';
Remember to remove those lines again when you have finished diagnosing your problem.
データベースにおいて
Using a tool like phpMyAdmin, execute the following SQL commands:
UPDATE mdl_config SET value = 2047 WHERE name = 'debug';
UPDATE mdl_config SET value = 1 WHERE name = 'debugdisplay';
To turn it back off, use the admin screens, or the commands:
UPDATE mdl_config SET value = 0 WHERE name = 'debug';
UPDATE mdl_config SET value = 0 WHERE name = 'debugdisplay';
(If you use a different database prefix, you will need to adjust those commands accordingly.)
関連情報
- Developers can also use XDEBUG (Installed as a module on the Apache server) to further dig into the code, step by step using an XDEBUG client application. Probably, as part of their favorite IDE. For example: NetBeans, phpStorm or...