1

I am unable to upload files (images) to my mediawiki install. I think it may have something to do with it is being hosted as http secure(HTTPS). I followed carefully the instructions here.

I updated write permissions to the /images/ dir

drwxrwxrwx 2 apache apache 4096 Apr 13 19:04 images

php.ini

file_uploads = On

In LocalSettings.php

$wgEnableUploads = true;
$wgFileExtensions = array('png','jpg','jpeg','gif'); 

When I try to upload it quickly refreshes the page without any errors or any indication anything went wrong, other than how fast it refreshed. When I navigate to the history of uploads it is empty. How can I troubleshoot this. Is it related to the secure http?

zac
  • 131
  • 1
  • 1
  • 5

2 Answers2

2

You're barking up the wrong tree. I have SSL enabled on my mediawiki install and uploads work fine with no additional modifications.

You should look elsewhere, like what extensions are allowed to be uploaded, for example.

You also say "I updated my write permissions to the /images/". I hope that this is just poorly worded. Your permissions to /images don't matter, the web server (Apache?) user is the one doing the writing to that directory. Try using su to become the apache user and see if you can write to that directory if you're unsure about your permissions.

MDMarra
  • 100,734
  • 32
  • 197
  • 329
  • Thanks MDMarra I do have `$wgFileExtensions = array('png','jpg','jpeg','gif');` in my LocalSettings.php as well so I dont think that is the problem. And I did `su` when I ran `chmod` is that what you mean? – zac Apr 14 '12 at 01:57
  • That's not what I mean. `su` can be used to do more than change to root, you can use it to change to any other account on the system. You should use it to switch user to your apache user and see if you can write to the /images directory if you're unsure about your permissions. – MDMarra Apr 14 '12 at 02:01
  • 1
    Oh, yes I can write as apache user. Here is what `ls -l` returns `drwxrwxrwx 2 apache apache 4096 Apr 13 19:04 images` – zac Apr 14 '12 at 02:05
  • 2
    @zac May not want to run the perm as `777`. – jscott Apr 14 '12 at 02:23
  • @jscott Agreed, I am just trying everything... I will set it back to `755` – zac Apr 14 '12 at 02:25
2

I resolved this. I had to edit in LocalSettings.php and change

$wgServer = "http://www.mywiki.com";

to

$wgServer = "https://www.mywiki.com";

zac
  • 131
  • 1
  • 1
  • 5