Out of the box, the MediaWiki configuration has used wfTempDir() since 99fdc6e8 to store temporary files.
The CDB l10n_cache-en.cdb file is stored in this temporary directory.
If several MediaWiki installations run on the same machine, tihs means they will each update this cache, which has two different undesired effect:
- If the content to cache diverges, the content of one wiki will overwrite the content of another
- If the two wikis are run by different user accounts (e.g. two different php-fpm pools), an exception will be thrown as it's not possible to overwrite the file.
Warning: rename(/tmp/l10n_cache-en.cdb.tmp.1665604027,/tmp/l10n_cache-en.cdb): Operation not permitted in .../vendor/wikimedia/cdb/src/Writer/PHP.php on line 89 [...] Fatal Error: Uncaught exception 'Cdb\Exception' with message 'Error writing to CDB file '/tmp/l10n_cache-en.cdb.tmp.1665604027'.' in .../vendor/wikimedia/cdb/src/Writer/PHP.php:239 Stack trace: #0 .../vendor/wikimedia/cdb/src/Writer/PHP.php(102): Cdb\Writer\PHP->throwException('Error writing t...') #1 .../vendor/wikimedia/cdb/src/Writer/PHP.php(215): Cdb\Writer\PHP->write('\x00\f\xD1\xB6\xB6\xC1\x02\x00') #2 .../vendor/wikimedia/cdb/src/Writer/PHP.php(82): Cdb\Writer\PHP->finish() #3 .../vendor/wikimedia/cdb/src/Writer.php(88): Cdb\Writer\PHP->close() #4 [internal function]: Cdb\Writer->__destruct() #5 {main} thrown in <b>.../vendor/wikimedia/cdb/src/Writer/PHP.php</b> on line <b>239</b><br />
We could perhaps mitigate this creating a subdirectory mw-<random value> in wfTempDir().