Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mediawiki error: File upload not working

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.

like image 944
Prashant Vaidyanathan Avatar asked Jan 16 '15 02:01

Prashant Vaidyanathan


1 Answers

Try to set tmp directory:

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

And grant rights:

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

Also try to add global vars:

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

And if you use imagemagick:

$wgImageMagickTempDir = "/var/www/tmp/";
like image 168
Artem P Avatar answered Dec 06 '22 20:12

Artem P