Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 7 Jan 2011 18:40:02 GMT
From:      Alexander Wittig <alexander@wittig.name>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/153770: www/mediawiki LaTeX math plugin search path issues
Message-ID:  <201101071840.p07Ie2dL020672@red.freebsd.org>
Resent-Message-ID: <201101071850.p07Io5rk050763@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         153770
>Category:       ports
>Synopsis:       www/mediawiki LaTeX math plugin search path issues
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jan 07 18:50:05 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Alexander Wittig
>Release:        8.2-PRERELEASE
>Organization:
Michigan State University
>Environment:
FreeBSD bt.pa.msu.edu 8.2-PRERELEASE FreeBSD 8.2-PRERELEASE #0: Fri Dec 10 13:08:44 EST 2010     root@bt.pa.msu.edu:/usr/obj/usr/src/sys/ALEX  i386

>Description:
When installing mediawiki with the automatic LaTeX typesetting plugin (selected from options), things do not work. Whenever a LaTeX equation is inserted in the Wiki, the texvc process exits with an error.

The problem is that in the OCAML source of texvc, the LaTeX tools are hard coded to be called only by their name, assuming they are in the current search path. However, on my system that does not seem to be the case, as the PATH environment PHP (and thus texvc) runs in only contains /(s)bin and /usr/(s)bin, but not /usr/local/bin, where the ports install latex, convert, dvips, etc. I don't recall changing PATH explicitly, so I don't think it is a problem with my configuration, but rather the default.
>How-To-Repeat:
Install Apache 2.2, PHP 5.3 and Mediawiki.
Enable the math plugin
Try to enter LaTeX into the Wiki (e.g. \sqrt{a^2+b^2}=c)

>Fix:
There are several ways to fix this I tried on my system.

I think the cleanest would be to actually patch the file "math/render.ml" in the MediaWiki source tree. The first few lines define the commands that are called to actually render the LaTeX, and they should be prefixed with the absolute path from PREFIX.
Unfortunately, my make-fu is not sufficient to write a patch that does this nicely (i.e. without hard coding the path into the patch but actually using PREFIX).

Alternatively, one can change line 75 in "includes/Math.php" to explicitly set the PATH environment to the correct value (e.g. putenv( "PATH=".getenv('PATH').":/usr/local/bin" );). But this is a crude hack and I'd prefer the first version.

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201101071840.p07Ie2dL020672>