June 10th, 2023
I recently migrated a Mediawiki Instance to a local environment for testing.
After reinstalling the MediaWiki instance I got the error:
Warning: fopen(/home/joeybab3/public_html/wiki/cache/l10n_cache-en.cdb.tmp.1476005176): Failed to open stream: Permission denied in /home/joeybab3/public_html/wiki/vendor/wikimedia/cdb/src/Writer/PHP.php on line 44
The fix was to chmod the cache directory to enable www-data access by running chmod 775 cache within the main directory where the wiki is installed.
From a terminal in your main install directory (the one with LocalSettings.php), run the following command:
chmod 775 cache