Manual:$wgShowSQLErrors

From MediaWiki.org
Jump to: navigation, search
This page is a translated version of the page Manual:$wgShowSQLErrors and the translation is 38% complete.

Other languages:
English • ‎français • ‎日本語 • ‎polski
Debug/logging: $wgShowSQLErrors
「we're sorry, but there has been a database error」ページに SQL エラーを表示するかどうか。
導入されたバージョン: 1.4.0 (r7376)
除去されたバージョン: 使用中
可能な値: 真偽値
既定値: false
他の設定: アルファベット順 | 機能順

When set to false (default) any database error message will also say "(SQL query hidden)" rather than showing the SQL which caused the error. 「データベース クエリのエラーが発生しました。 これはソフトウェアのバグである可能性があります。」のみが表示されます。 Set $wgShowSQLErrors to true to see the actual query, which caused the error.

詳細[edit]

Clearly showing the SQL will aid in debugging in the event of a database error, however...

  • Showing SQL to all users, will give crackers some clues about the database structure of your website, and might help them find security weaknesses.
  • SQL database errors are not supposed to occur during any normal MediaWiki operation, and so with luck you will never need to improve the error information
  • If you receive the error internal_api_error_DBQueryError from the API, enabling this setting will display a more descriptive error message in the info field than the default Database query error.

If you do see an error including "(SQL query hidden)", it can be useful to set this to $wgShowSQLErrors = true; temporarily.

This variable replaces $wgIgnoreSQLErrorsManual:$wgIgnoreSQLErrors, which should no longer be used.