the other side of the firewall

October 17, 2005

file uploading problem with mediaWiki

Filed under: Hacks, Blogging

I am using MediaWiki (the Wikipedia wiki) for some internal work.

Today one of our users had some trouble uploading a large PDF file.
I checked the wiki code and I could find any file size restriction.

It turns out that the problem does not come from MediaWiki but from the underlying PHP engine.
After googling for a bit, I discovered the existence of a magic file called php.ini with some magic variables such as memory_limit, post_max_size, upload_max_filesize.
See here for instance.

Creating the php.ini file is easy. Making Apache and PHP find it is not.
After a couple of unsuccessful attempts, here is the best way to do it:

  • create a php.ini file under /etc
  • create a info.php file in the root of your mediawiki, next to index.php
  • restart Apache (yes, you have to)
  • go to info.php and it will tell you where Apache/PHP is looking for the php.ini file
  • create a symbolic link from /etc/php.ini to this folder
  • restart Apache (you know the drill now)

PS: if you are like me and never remember where and how Apache was started on your machine, try this:
ps -A -o uid,comm,args | grep httpd

PPS: here is the code for info.php.

<html>
<head>
<title>PHP Test</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
</meta></head>
<body>
<h1>PHP Information</h1>
<p>
< ?php phpinfo(); ?>
</p>
</body>
</html>

Comments »

The URI to TrackBack this entry is: http://sahuguet.blogsome.com/2005/10/17/file-uploading-problem-with-mediawiki/trackback/

No comments yet.

RSS feed for comments on this post.

Leave a comment

Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>























Get free blog up and running in minutes with Blogsome | Theme designs available here