Texvc doesn't do latex math in Mediawiki
I have the Math extension installed in my MediaWiki 1.19. After I upgraded Ubuntu Server from 12.04 to 14.04 it looks like it messed it up and it stops working. Basically I get the following error when I try to display anything between tags <math>
and </math>
:
Failed to parse (PNG conversion failed; check for correct installation
of latex and dvipng (or dvips + gs + convert))
I tried the general troubleshooting found on the internet for this issue and recompiled texvc
to see if that fixed the problem. The executable texvc
in the directory extensions/Math/math
seems to do its job when called from the command line. I've obviously verified that all other executables ( latex
, dvipng
etc.) are working as they should.
When I try to display the math from my wiki, the corresponding *.tex
file is generated in images/tmp
with the correct latex code, but nothing else happens.
The problem appears to be related to texvc
causing the call problems latex
and dvipng
.
What could be causing this problem and how can I fix it?
source to share
Well, I figured it out. Basically, any shell command is passed by a security filter. Thus, in practice it texvc
is done via Mediawiki via bin/ulimit4.sh
:
#!/bin/bash
ulimit -t $1 -v $2 -f $3
eval "$4"
where $4
is the actual instruction texvc
and $2
is the amount of memory allowed for this process. The memory that comes in by default is 102400 KB (exactly 100 MB), which doesn't seem to be enough to get this process started. The amount of memory can be set to LocalSettings.php
variable $wgMaxShellMemory
. In my case, I set it to 300MB $wgMaxShellMemory = 307200;
, which seems to be enough.
Why this little png generation process takes so much memory that I don't know.
The reason that it stopped working after upgrading to Ubuntu 14.04, probably due to some kind of a new version of latex
, dvipng
, convert
etc., requires more memory than the version that came with Ubuntu 12.04.
source to share