Topic on Project:Support desk

[RESOLVED] Trouble uploading after installation

24
173.85.173.42 (talkcontribs)

After installing to the latest version of mediawiki, I am unable to upload text files, and get the following messege: Could not open lock file for "mwstore://local-backend/local-public/d/dc"

How can I fix this?

173.85.173.42 (talkcontribs)

I fixed it. chmod 777 images directory.

86.184.214.101 (talkcontribs)

Hi,

I've got the same problem but it is not fixed by chmod 777 images.

Ive just upgraded to 1.19 and

  1. I cannot upload image files - getting the message Could not create directory "mwstore://local-backend/local-public/archive/d/d8".
    • I have made the mediawiki/images directory and all sub-directories writeable
    • I had added $wgFileExtensions = {'gif', 'png'); to LocalSettings.php
    • I have tried incuding $wgUploadPath = '/mediawiki/images'; to LocalSetting.php
  2. Current images files stored in the wiki
    1. are displayed correctly using [[Image:pic.gif]],
    2. but not if resized e.g. [[Image:pic.gif|640px]]

Amy suggestions appreciated

Kirby

86.184.214.101 (talkcontribs)
70.81.74.132 (talkcontribs)

le dossier mediawiki et tout son contenu devrait apartenir au même usager que celui utilisé par le service Apache... Dans mon cas, www-data... Alors j'ai fait "chown -R www-data: mediawiki" pour régler mon problème.

70.81.74.132 (talkcontribs)

... En passant, je ne pense pas que ce soit une bonne idée de tout le mettre en 777, ça peut causer une brèche de sécurité.

DHR (talkcontribs)

My french is rusty, but I think that I agree with you.

Setting 777 permissions is really a bad idea.

On my system, I had this problem too. I got here by googling the error message.

I fixed the problem by setting the image directory's owner to apache. And since nothing but a readme was in that directory, I didn't even need a recursive chown.

 chown apache. /var/www/mediawiki119/images

That was the path on my CentOS 6.3 system.

I wonder if there is an even less crude solution.

There is. Read Manual:Configuring file uploads

77.119.255.167 (talkcontribs)

In my case (ubuntu server 12.04) it was

me@someplace:/var/www/w$ sudo chown -R www-data images/

142.110.189.223 (talkcontribs)

sudo chown -R www-data:www-data images/

(also make sure permissions are proper)

sudo chmod -R 755 images/

174.137.113.68 (talkcontribs)

Setting www-data as the owner fixed this issue for me! (Ubuntu server 12.04) Thanks!

TiloWiki (talkcontribs)

copy that ran on Ubuntu 12.04.2 with MW 1.20:

sudo chown -R www-data /var/www/MyWikiName/images
MetalHellsAngel (talkcontribs)

In my case I had a virtual server with a public_html directory in my home folder so I added my user to the www-data group


sudo useradd -G www-data my-username

logged out and back in to have the new group permission take effect and then I did.

sudo chown -R /home/my-username/public_html www-data

and that fixed the problem for me.

71.184.94.103 (talkcontribs)

This worked for me also on Debian 6 AMD64

86.2.83.34 (talkcontribs)

Yup. Works on Raspbian too, so this should work for x86, x64 and ARM servers.

DHR (talkcontribs)
2001:480:10:160:0:0:0:3121 (talkcontribs)

check your "$wgFileExtensions = {'gif', 'png');" entry

you need to create an array, something like this:

$wgFileExtensions = array('gif','png');

89.103.184.112 (talkcontribs)

For me chmoding uploads, uploads/*, uploads/*/* uploads/*/*/* to 777 helped (but please check with someone mor wiki-security aware that this doesn't imply any threats). For you it may be images, images/*, ... as it seems our wiki has some special settings.

Bawolff (talkcontribs)

Making things 777 means any user can write to the directory, which means if anyone somehow gets access to your server (aka security vulnrability in something else), or if there are other users of your server, they can write stuff to the images directory. A better approach is to make the images folder either owned by the apache user, or in the apache's user's group, and only let the apache user have said permissions.

AceroChevalosta (talkcontribs)

Mi sukcesis per

# chown apache -R /path/to/your/wiki/
# chgrp apache -R /path/to/your/wiki/
Ogredeschnique~mediawikiwiki (talkcontribs)
Carlc888 (talkcontribs)

made the change [$sudo chmod 777 /etc/mediawiki/images] on Ubuntu 12.04, Mediawiki version 1.22.1

Boom problem gone

80.119.70.60 (talkcontribs)

Just an update after a few minutes trying to fix that problem on my Mac : I would had this step to solve the access problem :

- add a $wgTmpDirectory = "/Applications/XAMPP/xamppfiles/htdocs/your_wiki/images/temp"; OR whatever path you want... and do the chmod on this specific folder

[$sudo chmod 777 /Applications/XAMPP/xamppfiles/htdocs/your_wiki/images/temp]

Only then you know what the fu** the wiki is doing! ;)

Have fun.

5.115.21.230 (talkcontribs)

I have the same problem on windows and I have installed wiki under IIS .