1

I've installed Mediawiki v1.24.1 on my server which is running RHEL7. I've installed it under /var/www/foohelp/wiki. However, when I try to upload a file, I get the following error:

[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}

If I edit /includes/filebackend/FileBackendGroup.php and modify LockManager to

'lockManager' => 'fsLockManager',

and modify permissions as follows:

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

I get the following error:

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

I've tried most of the forums and there is no solution that seems to fix my problem. Any help would be appreciated.

1 Answer 1

1

You need to set the proper security context type so that SELinux stops complaining.

sudo chcon -R -t httpd_sys_script_rw_t /var/www/mediawiki123/images/

Don't forget to set the directory back to the correct permissions.

sudo chmod 755 /var/www/mediawiki123/images/

For all of your SELinux needs, browse through here.

1
  • Also ensure SELinux boolean httpd_unified is set to true. It used to default to true, but since RHEL 7 defaults to false.
    – miken32
    May 8, 2019 at 23:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.