我已经在运行 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)
我已经尝试了大多数论坛,但似乎没有解决方案可以解决我的问题。任何帮助,将不胜感激。
答案1
您需要设置正确的安全上下文类型,以便 SELinux 停止抱怨。
sudo chcon -R -t httpd_sys_script_rw_t /var/www/mediawiki123/images/
不要忘记将目录设置回正确的权限。
sudo chmod 755 /var/www/mediawiki123/images/
对于您所有的 SELinux 需求,请浏览这里。