MediaWiki LaTeX bleg
Apr. 19th, 2008 05:03 pmI have installed texvc and told MediaWiki to use TeX. But I get the following error message, right on my page:
To check whether texvc was executable, I tested it in the shell: inside /home/htdocs/wiki/math, I ran:
the output file contains:
Cdaa63ef966cc412541190bc8794731de<i>y</i> = <i>x</i> + 2^@<mi>y</mi><mo>=</mo><mi>x</mi><mo>+</mo><mn>2</mn>-
or, rendered as HTML:
Cdaa63ef966cc412541190bc8794731dey = x + 2^@y = x + 2 -
So it is executing.
Just in case, I did a chmod 777, but that didn't help.
latex and dvipng are both installed.
Here is the README:
------------------------------------------------------
== About texvc ==
texvc takes LaTeX-compatible equations and produces formatted output in
HTML, MathML, and (via LaTeX/dvipng) rasterized PNG images.
Input data is parsed and scrutinized for safety, and the output includes
an estimate of whether the code is simple enough that HTML rendering will
look acceptable.
The program was written by Tomasz Wegrzanowski for use with MediaWiki;
it's included as part of the MediaWiki package (http://wikipedia.sf.net)
and is under the GPL license.
Please report bugs at: http://bugzilla.wikimedia.org/ (under "MediaWiki")
== Setup ==
=== Requirements ===
OCaml 3.06 or later is required to compile texvc; this can be acquired
from http://caml.inria.fr/ if your system doesn't have it available.
The makefile requires GNU make.
Rasterization is done via LaTeX, dvipng. These need
to be installed and in the PATH: latex, dvipng
AMS* packages for LaTeX also need to be installed. Without AMS* some
equations will render correctly while others won't render.
Most distributions of TeX already contain AMS*.
In Debian/Ubuntu you need to install tetex-extra.
To work properly with rendering non-ASCII Unicode characters, a
supplemental TeX package is needed (cjk-latex in Debian)
=== Installation ===
Run 'make' (or 'gmake' if GNU make is not your default make). This should
produce the texvc executable.
If you're using MediaWiki's install.php and have enabled $wgUseTeX in your
LocalSettings.php, the installer will try to copy texvc into place, in the
'math' subdirectory under where wiki.phtml is installed.
== Usage ==
Normally texvc is called from MediaWiki's Math.php modules and everything
Just Works. It can be run manually for testing or for use in another app.
=== Command-line parameters ===
texvc
Failed to parse (Missing texvc executable; please see math/README to configure.): 0
To check whether texvc was executable, I tested it in the shell: inside /home/htdocs/wiki/math, I ran:
./texvc /home/htdocs/wiki/tmp /home/htdocs/wiki/math "y=x+2" iso-8859-1 > tex-out2
the output file contains:
Cdaa63ef966cc412541190bc8794731de<i>y</i> = <i>x</i> + 2^@<mi>y</mi><mo>=</mo><mi>x</mi><mo>+</mo><mn>2</mn>-
or, rendered as HTML:
Cdaa63ef966cc412541190bc8794731dey = x + 2^@
So it is executing.
Just in case, I did a chmod 777, but that didn't help.
latex and dvipng are both installed.
Here is the README:
------------------------------------------------------
== About texvc ==
texvc takes LaTeX-compatible equations and produces formatted output in
HTML, MathML, and (via LaTeX/dvipng) rasterized PNG images.
Input data is parsed and scrutinized for safety, and the output includes
an estimate of whether the code is simple enough that HTML rendering will
look acceptable.
The program was written by Tomasz Wegrzanowski for use with MediaWiki;
it's included as part of the MediaWiki package (http://wikipedia.sf.net)
and is under the GPL license.
Please report bugs at: http://bugzilla.wikimedia.org/ (under "MediaWiki")
== Setup ==
=== Requirements ===
OCaml 3.06 or later is required to compile texvc; this can be acquired
from http://caml.inria.fr/ if your system doesn't have it available.
The makefile requires GNU make.
Rasterization is done via LaTeX, dvipng. These need
to be installed and in the PATH: latex, dvipng
AMS* packages for LaTeX also need to be installed. Without AMS* some
equations will render correctly while others won't render.
Most distributions of TeX already contain AMS*.
In Debian/Ubuntu you need to install tetex-extra.
To work properly with rendering non-ASCII Unicode characters, a
supplemental TeX package is needed (cjk-latex in Debian)
=== Installation ===
Run 'make' (or 'gmake' if GNU make is not your default make). This should
produce the texvc executable.
If you're using MediaWiki's install.php and have enabled $wgUseTeX in your
LocalSettings.php, the installer will try to copy texvc into place, in the
'math' subdirectory under where wiki.phtml is installed.
== Usage ==
Normally texvc is called from MediaWiki's Math.php modules and everything
Just Works. It can be run manually for testing or for use in another app.
=== Command-line parameters ===
texvc
(no subject)
Date: 2008-04-19 10:09 pm (UTC)http://meta.wikimedia.org/wiki/LaTex_on_a_shared_host
(no subject)
Date: 2008-04-19 10:17 pm (UTC)$wgTmpDirectory = "{$wgScriptPath}/tmp";
the message changed to:
Failed to parse (Can't write to or create math temp directory): 0
One bad side-effect is that this now appears at the top of every article:
Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/wiki/tmp) is not within the allowed path(s): (/nfsn/content/optimizelife:/nfsn/apps/php5/lib/php:/nfsn/apps/php/lib/php:/nfsn/content/content/nfsn) in /nfsn/content/optimizelife/public/wiki/includes/Math.php on line 47
(no subject)
Date: 2008-04-19 10:22 pm (UTC)(no subject)
Date: 2008-04-19 10:27 pm (UTC)(no subject)
Date: 2008-04-19 10:45 pm (UTC)(no subject)
Date: 2008-04-21 03:51 pm (UTC)Make sure the directory texvc is in is on your path with something like
export PATH = ($PATH /home/htdocs/wiki/math)then restart mediawiki.
If that does not work,
cd /home/htdocs/wikiln -s math/texvc .
then restart mediawiki.
Yeah, I know you probably already tried all this.
(no subject)
Date: 2008-04-22 04:47 am (UTC)Now I need to figure out how to restart MediaWiki.
(no subject)
Date: 2008-04-22 05:05 am (UTC)$wgTexvc = "{$wgScriptPath}/math/texvc";
I get:
Warning: is_executable() [function.is-executable]: open_basedir restriction in effect. File(/wiki/math/texvc) is not within the allowed path(s): (/nfsn/content/optimizelife:/nfsn/apps/php5/lib/php:/nfsn/apps/php/lib/php:/nfsn/content/content/nfsn) in /nfsn/content/optimizelife/public/wiki/includes/Math.php on line 55
(no subject)
Date: 2008-04-22 05:18 am (UTC)suggests that MediaWiki doesn't have the needed permissions. But /math and texvc are both 777.
(no subject)
Date: 2008-04-23 07:50 pm (UTC)Instead of specifying a relative path in your virtual host:
/wiki/math/texvc
you should have the absolute location of the binary:
/nfsn/content/optimizelife/wiki/math/texvc
(no subject)
Date: 2008-04-26 05:27 pm (UTC)$wgTexvc = "/nfsn/content/optimizelife/wiki/math/texvc";
the disallowed error disappears, but LaTeX still doesn't work.
What's weird is I can make up directories, and they are "allowed":
$wgTexvc = "mathg";
(no subject)
Date: 2008-04-26 05:40 pm (UTC)(no subject)
Date: 2008-04-26 05:45 pm (UTC)Failed to parse (Missing texvc executable; please see math/README to configure.): 0
(no subject)
Date: 2008-04-26 06:30 pm (UTC)(no subject)
Date: 2008-04-26 07:17 pm (UTC)(no subject)
Date: 2008-04-27 01:37 am (UTC)(no subject)
Date: 2008-04-27 02:03 am (UTC)< gusl > darkcode: hmm... how can I find out which paths are allowed?
< darkcode > php -i | grep open_basedir
< gusl > open_basedir => no value => no value