Topic on Project:Support desk

Curl 7 Error - VisualEditor Extension

7
Vijacrat (talkcontribs)

System: 14.04 Ubuntu + Mediawiki 1.26 on Hyper-V. I'm trying to install the Visual Editor extension so that using the wiki is easier.

Error Code when I hit "edit" in my localwiki on Main_Page:

localwiki says:

Error loading data from server: (curl error: 7) Couldn't connect to server: parsoidserver-http-error:(curl error: 7) Couldn't connect to server. Would you like to retry?

I have curl, php5, and php5-curl installed. /var/log/parsoid/parsoid.log is empty. Visual Editor part of LocalSettings.php:

require_once "$IP/extensions/VisualEditor/VisualEditor.php";

$wgDefaultUserOptions['visualeditor-enable'] = 1;

$wgHiddenPrefs[] = 'visualeditor-enable';

$wgVisualEditorParsoidURL = 'http://localhost:8142';

$wgVirtualRestConfig['modules']['parsoid'] = array(

'url' => 'http://localhost:8142',

'domain' => 'localhost',

'prefix' => 'localhost'

I haven't changed /etc/mediawiki/parsoid/settings.js except for this line:

parsoidConfig.setMwApi({ uri: 'https://localhost/api.php', prefix: 'localhost', domain: 'localhost' });

Using (https://github.com/wikimedia/parsoid/tree/master/guides/setup), I did 'npm install' in /var/www/html/extensions/parsoid, but when I get to 'node bin/server', I get

Error while reading config file: Error: ENOENT, open '/var/www/html/extensions/parsoid/config.yaml'

I think it's a problem with the parsoid server. Any help is appreciated.

129.67.90.252 (talkcontribs)

have you solved this yet?

NitaiDas (talkcontribs)

It could be that Curl is not running or parsoid is not running, check both.

Wargo (talkcontribs)

Have you "/var/www/html/extensions/parsoid/config.yaml"?

NitaiDas (talkcontribs)

Yes, I finally got it. The following are a few things that helped me.

  1. config.yaml is indentation sensitive. Running tail /var/log/parsoid/parsoid.log helped to check that after a parsoid (failed) start. In words, parsoid will not start if the indentation in config.yaml is wrong.
  2. The domain can actually be any word, as long as config.yaml and LocalSettings.php match.
  3. The uri in mycase was 'http://en.domain.com:8142/api.php'
  4. This page also helped > Parsoid/Troubleshooting
  5. Exact setup for Parsoid/Setup#Multiple wikis sharing the same parsoid service
Fakeologist (talkcontribs)

I'm new to mediawiki, and I've just received this error.

Where should I start?

Denagelinde (talkcontribs)

I found a solution!

Same problem, error that the curl extension was not installed, while it was. I compared different LocalSettings.php and config.yaml file one from mediawiki where visualeditor was working to mine where Visualeditor wasn't working.

First check if both your URLS in LocalSettings.php and config.yaml are working.

The URL in LocalSettings.php should give (under "wgVirtualRestConfig" ):

"Welcome to the Parsoid web service.

See the API documentation on mediawiki.org."

And the URL from config.yaml (under "MwApis:"):

"MediaWiki API help

This is an auto-generated MediaWiki API documentation page.

Documentation and examples: https://www.mediawiki.org/wiki/API" etc

If those both generate a working page (just to check if we haven't entered a wrong url) follow this guide:

https://www.joomlashine.com/blog/how-to-enable-curl-in-php.html

basically open your php.ini file in /etc/php/7.0/apache2/php.ini and uncomment (remove the semicolon at the beginning of the line) and save the file.

Restart apache2 service:

sudo /etc/init.d/apache2 restart

And restart parsoid service:

sudo /etc/init.d/parsoid restart

Open your wiki and click on "edit" and it should work!

Regards,