I'm not sure this is a problem in the server or in MediaWiki.
I have an extension which calls a bash script with wfShellExec. The bash file consists essentially of
touch $1.A latex $1 dvipng $1 touch $1.B
The touch'es are just to see if the bash file is run. And indeed it's. However, neither .dvi nor .log files are created (which are the result of running latex). However, when running the script from the command line everything is ok.
This extension is based on WikiTeX.php, and the lines calling the script are:
$cmd = wfEscapeShellArg( $wfTexConvert, $tempName, $dpi, "$storedir/$hash" ); wfProfileIn( "TeX-shellexec" ); $convtext = trim( wfShellExec( $cmd ) ); wfProfileOut( "TeX-shellexec" );
Any ideas about what's wrong? Perhaps some permission not set?
By the way, TeX is TeXLive2012, installed separately, and the site is www.wikilengua.org .
Javier
Hi Javier,
you might want to have a look at the math extension.
https://git.wikimedia.org/blob/mediawiki%2Fextensions%2FMath/39c785dc30edc04...
There you see how it's done for calling texvc. You might also want to consider to use LaTeXML instead of shelling out. LaTeXML covers a wide range of LaTeX (including citations) and can be runs as web-service, that produces MathML.
https://www.mediawiki.org/wiki/Extension:Math#LaTeXML
Best Moritz
On Mon, Oct 7, 2013 at 3:14 AM, Javier Bezos jbezos@fundeu.es wrote:
I'm not sure this is a problem in the server or in MediaWiki.
I have an extension which calls a bash script with wfShellExec. The bash file consists essentially of
touch $1.A latex $1 dvipng $1 touch $1.B
The touch'es are just to see if the bash file is run. And indeed it's. However, neither .dvi nor .log files are created (which are the result of running latex). However, when running the script from the command line everything is ok.
This extension is based on WikiTeX.php, and the lines calling the script are:
$cmd = wfEscapeShellArg( $wfTexConvert, $tempName, $dpi, "$storedir/$hash" ); wfProfileIn( "TeX-shellexec" ); $convtext = trim( wfShellExec( $cmd ) ); wfProfileOut( "TeX-shellexec" );
Any ideas about what's wrong? Perhaps some permission not set?
By the way, TeX is TeXLive2012, installed separately, and the site is www.wikilengua.org .
Javier
-- ______________________________
Javier Bezos López T. 34 913 467 440 www.fundeu.es www.wikilengua.org www.manualdeestilo.com Twitter http://www.twitter.com/fundeu, Facebookhttp://www.facebook.com/fundeu, YouTube http://www.youtube.com/user/fundeuy Google+< http://gplus.to/fundeu%3E _______________________________________________ MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Javier Bezos jbezos@fundeu.es wrote:
The touch'es are just to see if the bash file is run. And indeed it's. However, neither .dvi nor .log files are created (which are the result of running latex). However, when running the script from the command line everything is ok.
Most probably this is related to file access permissions. Keep in mind that the script is executed as the webserver user ("www", "apache", "nobody", ....) which is probably different than the user you are logged as when trying it from the command line.
First, I would figure out ("pwd > /tmp/whereami" from the script) where your script ends up running (and in which directory it attempts to create files), and then check permissions on that directory.
//Saper
mediawiki-l@lists.wikimedia.org