# Topic on Extension talk:Math

## Math extension cannot connect to Restbase.

22

http://api.formulasearchengine.com/v1/ is error so many times.

This extension seems dead.

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

It works for me with MediaWiki 1.30 and LAMP on Ubuntu 18.04 machine

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/":):

Looks like a problem with wikipedia servers...

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

$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]

$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

Restart HTTPD server : # systemctl restart httpd

You are all DONE !

The math formula should render to desired formats in .png !

Any ideas? Same problem here.

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!

This post was hidden by Anu8791 (history)

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

Reply to "Math extension cannot connect to Restbase."