Page MenuHomePhabricator

PNG is not created
Closed, ResolvedPublic

Description

Author: christof.spies

Description:
MW Version: 1.23.1
Math Version: git master 084718af14d8597092337759b1b3ad95ec5be53f (current)
Server: Debian wheezy

What i did:
<pre>
cd wiki_path/extensions/
git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/Math.git

cd wiki_path/extensions/Math/texvcheck
make

cd wiki_path/extensions/Math/math
make

vim wiki_path/LocalSettings.php

  1. Math
  2. http://www.mediawiki.org/wiki/Extension:Math

require_once "$IP/extensions/Math/Math.php";
$wgMathDisableTexFilter = true;
// ensure MW_MATH_MATHML; is added to the $wgMathValidModes array;
$wgMathValidModes[] = MW_MATH_MATHML;

Set Mathoid as default rendering option;
$wgDefaultUserOptions['math'] = MW_MATH_MATHML;
$wgMathValidModes[] = MW_MATH_LATEXML;
adding LaTeXML as rendering option

// Set LaTeXML as default rendering option;
$wgDefaultUserOptions['math'] = MW_MATH_LATEXML;

$wgDebugLogFile = "/tmp/wiki.log";
//EOF

php wiki_path/maintenance/update.php --quick
</pre>

What i got:

  • formula is working with MathML
  • formula is working with SVG fallback
  • formula is not working with PNG fallback

The fallback link for PNG is pointing to "index.php?title=Spezial:MathShowImage&hash=903286ede01eb3c73938de7eb75fb295&mode=0".
This page is showing the error message "Fehler beim Parsen (PNG-Konvertierung fehlgeschlagen. Bitte die korrekte Installation von LaTeX und dvipng überprüfen (oder dvips + gs + convert)): \int\limits_a^x f(\frac{\alpha}{2}\,)\,dxx".
The log file contains:
<pre>
Start request GET /index.php?title=Spezial:MathShowImage&hash=903286ede01eb3c73938de7eb75fb295&mode= 0
HTTP HEADERS:
HOST: example.com
USER-AGENT: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0
ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
ACCEPT-LANGUAGE: de,en-US;q=0.7,en;q=0.3
ACCEPT-ENCODING: gzip, deflate
COOKIE: xyz_wikiUserName=username; xyz_wikiUserID=1; xyz_wikiToken=801a8770d53e5b929e427efb13abbf0c; xyz_wiki_session=kdgr2o6r4eqaen24cnt7o1g3i2; s5slide=4%3A3
CONNECTION: keep-alive
CACHE-CONTROL: max-age=0
[caches] main: APCBagOStuff, message: APCBagOStuff, parser: APCBagOStuff
[caches] LocalisationCache: using store LCStoreDB
Connected to database 0 at localhost
Fully initialised
User: got user 1 from cache
User: loading options for user 1 from override cache.
User: logged in from session
[Math] start rendering $\int\limits_a^x f(\frac{\alpha}{2}\,)\,dxx$ in mode 0
[Math] TeX: /var/www/xyz-wiki/htdocs/mediawiki-1.23.2/extensions/Math/math/texvc '/tmp' '/tmp' '\int\limits_a^x f(\frac{\alpha}{2}\,)\,dxx' 'UTF-8' 'transparent'
[texvc] Executing '/var/www/xyz-wiki/htdocs/mediawiki-1.23.2/extensions/Math/math/texvc '/tmp' '/tmp' '\int\limits_a^x f(\frac{\alpha}{2}\,)\,dxx' 'UTF-8' 'transparent''.
wfShellExec: /bin/bash '/var/www/xyz-wiki/htdocs/mediawiki-1.23.2/includes/limit.sh' '/var/www/xyz-wiki/htdocs/mediawiki-1.23.2/extensions/Math/math/texvc '\''/tmp'\'' '\''/tmp'\'' '\''\int\limits_a^x f(\frac{\alpha}{2}\,)\,dxx'\'' '\''UTF-8'\'' '\''transparent'\''' 'MW_INCLUDE_STDERR=;MW_CPU_LIMIT=180; MW_CGROUP='\'''\''; MW_MEM_LIMIT=307200; MW_FILE_SIZE_LIMIT=102400; MW_WALL_CLOCK_LIMIT=180; MW_USE_LOG_PIPE=yes'
[Math] TeX output:

+15c8be621d90f691eb449a4699e14e87-

MessageCache::load: Loading de... got from global cache
LoadBalancer::reuseConnection: this connection was not opened as a foreign connection
Request ended normally
#EOF

ls -al /tmp/ | grep tex
-rw-r--r-- 1 xyz-wiki xyz-wiki 172 Aug 18 14:45 17724_15c8be621d90f691eb449a4699e14e87.tex

/bin/bash '/var/www/xyz-wiki/htdocs/mediawiki-1.23.2/includes/limit.sh' '/var/www/xyz-wiki/htdocs/mediawiki-1.23.2/extensions/Math/math/texvc '\''/tmp'\'' '\''/tmp'\'' '\''\int\limits_a^x f(\frac{\alpha}{2}\,)\,dxx'\'' '\''UTF-8'\'' '\''transparent'\''' 'MW_INCLUDE_STDERR=;MW_CPU_LIMIT=180; MW_CGROUP='\'''\''; MW_MEM_LIMIT=307200; MW_FILE_SIZE_LIMIT=102400; MW_WALL_CLOCK_LIMIT=180; MW_USE_LOG_PIPE=yes'

ls -al /tmp/ | grep tex
-rw-r--r-- 1 xyz-wiki xyz-wiki 172 Aug 18 14:45 17724_15c8be621d90f691eb449a4699e14e87.tex
-rw-r--r-- 1 xyz-wiki xyz-wiki 898 Aug 18 14:55 15c8be621d90f691eb449a4699e14e87.png
</pre>

Why is the png file only created when i run the command in the shell?
Why is the folder /tmp and not a folder inside the wiki_path?
Any idea why no PNGs are created via the Webserver?


Version: master
Severity: normal
OS: Linux
Platform: PC

Details

Reference
bz69693

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:40 AM
bzimport added a project: Math.
bzimport set Reference to bz69693.
bzimport added a subscriber: Unknown Object (MLST).

physik wrote:

Hi Christof,

thanks for your excellent BUG report.
The underlining problem is that currently Mathoid does not produce PNG images.
So you have to create them locally on your system which requires to install texvc.
This is a bad thing and should be changed.
Did you follow the guide on
https://www.mediawiki.org/wiki/Texvc

There might be an issue with the file permissions?

Change 156195 had a related patch set uploaded by Physikerwelt:
Prevent Special:MathShowImage from showing bad content

https://gerrit.wikimedia.org/r/156195

Change 156195 merged by Frédéric Wang:
Prevent Special:MathShowImage from showing bad content

https://gerrit.wikimedia.org/r/156195

physik wrote:

Patch got merged. Let's assume that this has solved he problem.