解析失敗 (MathML 使用 SVG 或 PNG 備用 (建議用於現代瀏覽器與輔助工具):從伺服器 "http://api.formulasearchengine.com/v1/" 收到無效的回應 ("Math extension cannot connect to Restbase.")。)
http://api.formulasearchengine.com/v1/ is error so many times.
解析失敗 (MathML 使用 SVG 或 PNG 備用 (建議用於現代瀏覽器與輔助工具):從伺服器 "http://api.formulasearchengine.com/v1/" 收到無效的回應 ("Math extension cannot connect to Restbase.")。)
http://api.formulasearchengine.com/v1/ is error so many times.
http://api.formulasearchengine.com/v1/ seems don't work. also to me.
i got error messege like this.
Math extension cannot connect to Restbase.
I'm using en.wikipedia rest api now.
https://en.wikipedia.org/api/rest_v1/
$wgMathFullRestbaseURL= 'https://en.wikipedia.org/api/rest_';
We almost always get this error, for example https://www.heurekaslu.se/wiki/Climate_Model. Sometimes it works so there is no error in the formulas. Have tried each of the following
$wgMathFullRestbaseURL= 'https://en.wikipedia.org/api/rest_';
$wgMathFullRestbaseURL= 'http://api.formulasearchengine.com/v1/'; and
$wgMathFullRestbaseURL= 'https://api.formulasearchengine.com/v1/'; and
I was having the same problem, but by changing a line in LocalSettings.php to
$wgMathFullRestbaseURL= 'https://en.wikipedia.org/api/rest_';
and running "php update.php", the problem went away. So I think the above statement "This extension seems dead" is not the definitive word.
Pointing $wgMathFullRestbaseURL to wikipedia doesn't seem to work since MediaWiki 1.30
I later discovered it doesn't work when you have RestBase installed and configured for Visual Editor. Otherwise it should work.
Has anyone had this problem again recently because it's suddenly occurred on my wiki? I tried the alternate Restbase Urls but nothing has worked.
We also observed following Math/LaTex rendering to PNG issue while upgraded from MediaWiki 1.30.0 to MediaWiki 1.31.1. But, it's not the issue in earlier version (1.30.0)
(Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle \sigma_1^\prime} and Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":):
We were not using Mathoid Server as a service in earlier MediaWiki v1.30.0. hence the Math/LaTex rendering to PNG was just working fine with LaTex/DVI libs.
but, when we upgraded to this MediaWiki v 1.31.1, the above issue is occurred in the same server environment.
Hence, could you let know how we can bypass the Mathoid Server dependency in this LTS version(MediaWiki 1.31.1) and still we can make Math render working as it's working in MediaWiki 1.30.0 ?
If you do not install mathoid (and RESTBase), you may use wikipedia's RESTBase, which is what it's using now by default. However, you must ensure PHP is able to connect to wikipedia, which is probably blocked by one of your firewalls or SELinux and that's the error message you're getting
There is security restrictions to connect from our corporate network to the internet. so I unable to test wiki's Restbase
Hence, I have install for the 'methoid' webservice in our local RHEL7 server. I have opted for the dev-config available in the Mathoid package. Now the daemon is running with following pid. But, I see the listening server IP indicates 0.0.0.0:10044
{"name":"mathoid","hostname":"domainname.com","pid":23788,"level":30,"levelPath":"info","msg":"Worker 23788 listening on 0.0.0.0:10044","time":"2019-06-06T11:21:19.871Z","v":0}
Could you let know how can we get the appropriate IP that need to configure with below parameters for Math in LocalSettings.php ? I have already checked with 'domainname:port' is still not working for following configuration in LocalSettings.php
wfLoadExtension( 'Math' );
$wgDefaultUserOptions['math'] = 'mathml';
$wgMathMathMLUrl = 'https://domainname.com:10044/';
I think you also need RESTBase, or at least this is how I have configured (what would be the purpose of RESTBase, after all?). Then $wgMathMathMLUrl points to RESTBase, and you enable the math endpoint in RESTBase to point to mathoid daemon.
Actually RESTBase server implementation along with Mathoid server is required only when you are running such a Huge WIKI.
But for small enterprise wiki with limited memory to render math formulae, we need to install/setup/configure the Mathoid server for WIKI locally in the RHEL7 server followed with below steps.
** First Install Mathoid server pre-requisites packages dependency in RHEL7 server.
# yum update -y [required when need to update latest packages available in the server]
# yum install -y epel-release
# yum install -y gcc-c++ nodejs npm mocha librsvg2-devel pkgconfig git
# yum groupinstall -y 'Development Tools'
** Second, Install Mathoid server in the desired server location.
# cd /var/data/wiki/
# git clone https://github.com/wikimedia/mathoid/
# chown -R apache:wikiadm mathoid
# cd mathoid
# chmod 775 server.js cli.js
** Third, Run the Mathoid server and test
# npm install
# npm test
** Fourth, Add below lines under LocalSettings.php to map mathoid server with mediawiki
$wgMathoidCli = ['/var/data/wiki/mathoid/cli.js', '-c', '/var/data/wiki/mathoid/config.yaml'];
# Below lines required to add in LocalSettings.php to Opt Mathoid server test-config as dependency
[Note. Ensure you already got installed below Math extension compatible with the MediaWiki version]
wfLoadExtension( 'Math' );
$wgMathValidModes[] = 'mathml';
$wgDefaultUserOptions['math'] = 'mathml';
$wgMathMathMLUrl = 'http://12.23.34.45:10044/';
** Fifth, Change below line is the api interface for MediaWiki in Mathoid server config.yaml
uri: https://Template:Domain/api.php
Restart HTTPD server : # systemctl restart httpd
You are all DONE !
The math formula should render to desired formats in .png !
Can anyone provide a simple php_curl request that Math could make to wiki's Restbase, in order to test whether this is a problem of the code or a problem of the web host?
Thank you!
I tried connecting to both the Wikimedia and Wikipedia Restbases with the same problem (MediaWiki 1.32). The issue in my case was with how the MediaWiki core handles HTTP responses. I haven't seen anyone else mention it, so here's my other comment on the issue with two hacks.
I used one of Johanngan's hacks above and it works!
See that thread I will post some more details
This suddenly started happening on my MediaWiki1.28 install. Johanngan's second hack worked perfectly. Many thanks!