Manual:$wgTmpDirectory
| サーバー URL とファイル パス: $wgTmpDirectory | |
|---|---|
| 一時的なディレクトリのパス。 |
|
| 導入されたバージョン: | 1.1.0 未満 |
| 除去されたバージョン: | 使用中 |
| 許容される値: | (絶対パス) |
| 既定値: | false (1.9+)
|
| その他の設定: アルファベット順 | 機能順 | |
詳細
| MediaWiki バージョン: | ≧ 1.20 |
一時ディレクトリへのローカル ファイルシステムのパスです。このディレクトリには書き込める必要があります。 ウェブからアクセスできないように、ドキュメントルートの外側に配置するか(推奨)、少なくとも.htaccessやウェブサーバーの設定によってウェブからのアクセスを拒否するようにしてください。 このフォルダーのファイルをウェブからアクセスできるようにすることは、セキュリティ上のリスクとなる可能性があります。
$wgTmpDirectory is used to determine the directory name returned by wfTempDir().
If $wgTmpDirectory is false, wfTempDir() will try to determine a suitable temporary directory name based on the environment variables TMPDIR, TMP or TEMP, or call to sys_get_temp_dir(), or similar fallback mechanisms.
The directory name returned by wfTempDir() controls where MediaWiki writes temporary files to, including:
- Old and new tempfiles for external executable based external diff engines configured by $wgExternalDiffEngine
- TempFSFile - チャンクアップロード、いくつかの変換、およびファイルバックエンドコードのさまざまな部分に使用されます。
- UID Generator node and lock files.
- Upload from URL
- The directory in which a CACHE_DBA cache places its DBA database file.
Can be overridden using $wgObjectCaches[CACHE_DBA]['dir']. (1.23 で除去)
- Importing uploads from XML dumps
- SvgHandler - used for SVG transformation
- ...
Common pitfalls
If you are getting this error, an incorrect setting for $wgTmpDirectory often is the cause:
Warning: rename(/tmp/l10n_cache-en.cdb.tmp.335721450,/tmp/l10n_cache-en.cdb): Operation not permitted in /.../vendor/wikimedia/cdb/src/Writer/DBA.php on line 59 Fatal exception of type MWException: Warning: dba_close(): supplied resource is not a valid DBA identifier resource in /.../vendor/wikimedia/cdb/src/Writer/DBA.php on line 54 Fatal error: Uncaught Cdb\Exception: Unable to move the new CDB file into place. in /.../vendor/wikimedia/cdb/src/Writer/DBA.php:60
解決策は、$wgTmpDirectory フォルダーにウェブ サーバーのユーザーによって実際に書き込めるように設定することです。
Web サーバーと CLI 利用者で異なるパーミッションが必要な場合、別々のディレクトリを用意すると便利な場合があります。例えば:
$wgTmpDirectory = $IP . '/images/tmp-' . php_sapi_name();
詳細情報はT126736を参照してください。
サポートされていないMediaWikiのバージョンでの使用方法
| MediaWiki バージョン: | ≦ 1.19 |
The path to the temporary directory.
When using CACHE_DBA as your $wgMainCacheType, this allows you to select which directory is used.
参考資料
関連項目
- Manual:$wgCacheDirectory - インターフェイスメッセージをローカルファイルシステムにキャッシュするためのディレクトリ。