[solved] Mediawi Image uploads succeed, but can't view images

I’m having a trouble with a new, clean install of Mediawiki 1.15 (advanced one-click method). Images can be successfully uploaded, but they are not usable in wiki pages: attempting to click and view the just-uploaded image yields an Internal Server Error (404).

On a wiki page where the image is embedded, the image simply doesn’t display- instead I just see the image title. How can I fix this and make uploads usable on wiki pages?

Possibly helpful info:

  • Turning off short URLs does not fix this problem- it just clarifies that the internal error is a 404.
  • ImageMagick has been disabled (per other forum threads). If I re-enable it, the problem still happens.
  • Via SFTP, I can download the image (and thumbnails). The files aren’t corrupt. (Mediawiki even reads the image metadata correctly- it just doesn’t display the image!)
  • The permissions on the “images” directory (and subfolders) are drwxr-xr-x, the default setting. A quick forum search suggests that this should be ok.
  • Hashed upload directories are in use (the default setting)

The file size is 1.12 MB, well below the upload limit. (it’s a full-page scan of some handwritten notes) A smaller image gives the same problem.

Offhand, I’d guess you have $wgUploadPath (or $wgScriptPath, from which it’s derived) set wrong.

Thanks for the reply. This is a fairly default install, which means that my $wgUploadPath value is just the “images” subdirectory- that seems to be the default. And indeed, the directory exists (with the permissions mentioned before).

Just to check, I then set $wgUploadPath manually, and confirmed that the wiki is looking for the image URL in what should be the right place. Unfortunately, the problem persists.

EDIT: Found the problem! Apparently, some previous work early on resulted in an incorrect HTACCESS file in this folder. Removing that allowed uploads to work as expected. Thanks again!

One helpful piece of information: the error message is actually an error “500 internal error”- the 404 message simply referred to a problem locating an error document. The error document is pasted below:

[quote='500 internal error page]
Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, x@y.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.[/quote]


ive been setting up a mediawiki 1.28-2 server to migrate an old out of date installation and this was bogging me down for 2 or 3 days. removed the bad .htaccess file in …/mediawiki/images and suddenly the pictures appeared!

I’m new here, I signed up just to say thanks :slight_smile: