Mediawiki error: File upload not working

Mediawiki error: File upload not working

我已经在我的 运行 RHEL7 服务器上安装了 Mediawiki v1.24.1。 我已经安装在 /var/www/foohelp/wiki 下。但是,当我尝试上传文件时,出现以下错误:

[f3eae72a] /foohelp/wiki/index.php/Special:Upload Exception from line 1871 of /var/www/foohelp/mediawiki-1.24.1/includes/filerepo/file/LocalFile.php: Could not acquire lock for 'User-default.png.'
Backtrace:
#0 /var/www/foohelp/mediawiki-1.24.1/includes/filerepo/file/LocalFile.php(1174): LocalFile->lock()
#1 /var/www/foohelp/mediawiki-1.24.1/includes/upload/UploadBase.php(738): LocalFile->upload(string, string, string, integer, array, boolean, User)
#2 /var/www/foohelp/mediawiki-1.24.1/includes/specials/SpecialUpload.php(467): UploadBase->performUpload(string, string, boolean, User)
#3 /var/www/foohelp/mediawiki-1.24.1/includes/specials/SpecialUpload.php(186): SpecialUpload->processUpload()
#4 /var/www/foohelp/mediawiki-1.24.1/includes/specialpage/SpecialPage.php(363): SpecialUpload->execute(NULL)
#5 /var/www/foohelp/mediawiki-1.24.1/includes/specialpage/SpecialPageFactory.php(584): SpecialPage->run(NULL)
#6 /var/www/foohelp/mediawiki-1.24.1/includes/MediaWiki.php(275): SpecialPageFactory::executePath(Title, RequestContext)
#7 /var/www/foohelp/mediawiki-1.24.1/includes/MediaWiki.php(584): MediaWiki->performRequest()
#8 /var/www/foohelp/mediawiki-1.24.1/includes/MediaWiki.php(435): MediaWiki->main()
#9 /var/www/foohelp/mediawiki-1.24.1/index.php(46): MediaWiki->run()
#10 {main}

如果我编辑 /includes/filebackend/FileBackendGroup.php 并将 LockManager 修改为

'lockManager' => 'fsLockManager',

并修改权限如下:

chown -R apache:apache images/
chown -R 755 images/

我收到以下错误:

(Could not create directory "mwstore://local-backend/local-public)

我已经尝试了大部分论坛,但没有任何解决方案似乎可以解决我的问题。任何帮助,将不胜感激。

尝试设置 tmp 目录:

$wgTmpDirectory = "/var/www/tmp/";

并授予权利:

chown -R apache:apache tmp/
chown -R 755 tmp/

同时尝试添加全局变量:

putenv("TMP=/var/www/tmp/");
putenv("HOME=/var/www");

如果你使用 imagemagick:

$wgImageMagickTempDir = "/var/www/tmp/";