Manual:$wgTmpDirectory/ko
| Server URLs and file paths: $wgTmpDirectory | |
|---|---|
| The path of the temporary directory. |
|
| 이 변수가 소개된 버전: | 1.1.0 이전 |
| 이 변수가 사라진 버전: | 계속해서 쓰이고 있음 |
| 허용값: | (absolute path) |
| 기본값: | false (1.9+)
|
| 기타 설정: 알파벳 순 | 기능별 순 | |
Details
| 미디어위키 버전: | ≥ 1.20 |
The local filesystem path to a temporary directory. This is required to be writable. It shouldn't be accessible from the web, so try to place it outside of the document root (recommended) or at least deny any access from the web via .htaccess or webserver configuration. Having files from this folder accessible from the web can be a security risk.
$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 - used for chunked uploading, some transformations, and various parts of the file backend code
- 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
The solution is to set $wgTmpDirectory to a folder, which actually is writable by the webserver user.
Sometimes it is useful to have separate directories for the web server and CLI user, if they require different permissions. For example:
$wgTmpDirectory = $IP . '/images/tmp-' . php_sapi_name();
See T126736 for more information!
Usage in unsupported MediaWiki versions
| 미디어위키 버전: | ≤ 1.19 |
The path to the temporary directory.
When using CACHE_DBA as your $wgMainCacheType, this allows you to select which directory is used.
References
같이 보기
- Manual:$wgCacheDirectory - Directory for caching interface messages in the local filesystem.