Topic on Project:Support desk

Error message after installing html2wiki extension

9
Summary by AhmadF.Cheema

Various issues...

Bigfoot c (talkcontribs)

Dear all,

I am charged with testing some features of mediaWiki. I am running a fresh install of mw 1.29 on an xamp-server (OS is Win10). Having installed the extension html2wiki according to the steps mentioned at Extension:Html2Wiki , I get the following error message, which I have been unable to decipher. I could not find a proper description on the web either, at least not in context with the extension in question. The error message reads as follows:

Warning:  call_user_func() expects parameter 1 to be a valid callback, class 'Html2Wiki' not found in C:\xampp\htdocs\mediawiki\includes\registration\ExtensionRegistry.php on line 335

Also note that I used GitBash for installing the extension (as suggested). I also added the following lines to my LocalSettings.php:

[...]

#End of automatically generated settings. #Add more configuration options below.

$wgNamespacesWithSubpages[NS_MAIN] = true;

wfLoadExtension( 'Html2Wiki' );

Would be great if somebody could point out what this error signfies. I have currently no idea how to resolve the issue. Thanks for all help provided, it is much appreciated

Kind regards

Bigfoot_c

Osnard (talkcontribs)
Bigfoot c (talkcontribs)

Dear Osnard,

Thank you for your reply. I downloaded the extension via git as suggested on the webpage. I added composer to my PATH env and ran composer install in the extension directory. Unfortunately, the error message still occurs when launching my wiki. Please refer to the code below for suggestions should I have made a mistake during installation. Please note, I am using WIN10 and XAMP (not by choice though :=) )

Microsoft Windows [Version 10.0.15063] c:\xampp\htdocs\mediawiki\extensions>composer install No composer.json in current directory, do you want to use the one at C:\xampp\htdocs\mediawiki? [Y,n]? y > ComposerHookHandler::onPreUpdate Loading composer repositories with package information Updating dependencies (including require-dev) Package operations: 38 installs, 1 update, 15 removals

 - Removing symfony/process (v3.2.6)
 - Removing james-heinrich/getid3 (v1.9.14)
 - Removing pear/net_socket (v1.1.0)
 - Removing pear/pear-core-minimal (v1.10.3)
 - Removing pimple/pimple (v3.0.2)
 - Removing pear/net_smtp (1.7.3)
 - Removing wikimedia/textcat (1.2.0)
 - Removing stil/gd-text (v1.0.0)
 - Removing firebase/php-jwt (v4.0.0)
 - Removing ruflin/elastica (5.1.0)
 - Removing pear/mail (1.3.0)
 - Removing pear/mail_mime-decode (1.5.5.2)
 - Removing pear/mail_mime (1.10.0)
 - Removing pear/console_getopt (v1.4.1)
 - Removing pear/pear_exception (v1.0.0)
 - Updating justinrainbow/json-schema (5.2.0 => 3.0.1): Downloading (100%)
 - Installing composer/spdx-licenses (1.1.4): Downloading (100%)
 - Installing jakub-onderka/php-parallel-lint (v0.9.2): Downloading (100%)
 - Installing jetbrains/phpstorm-stubs (dev-master 1b99060): Cloning 1b9906084d
   Failed to download jetbrains/phpstorm-stubs from source: Failed to clone https://github.com/JetBrains/phpstorm-stubs.git, git was not found, check that it is installed and in your PATH env.
   Now trying to download from dist
 - Installing jetbrains/phpstorm-stubs (dev-master 1b99060): Downloading (100%)
 - Installing squizlabs/php_codesniffer (2.6.0): Downloading (100%)
 - Installing mediawiki/mediawiki-codesniffer (v0.7.2): Downloading (100%)
 - Installing symfony/yaml (v3.3.9): Downloading (100%)
 - Installing sebastian/version (1.0.6): Downloading (100%)
 - Installing sebastian/global-state (1.1.1): Downloading (100%)
 - Installing sebastian/recursion-context (1.0.5): Downloading (100%)
 - Installing sebastian/exporter (1.2.2): Downloading (100%)
 - Installing sebastian/environment (1.3.8): Downloading (100%)
 - Installing sebastian/diff (1.4.3): Downloading (100%)
 - Installing sebastian/comparator (1.2.4): Downloading (100%)
 - Installing doctrine/instantiator (1.1.0): Downloading (100%)
 - Installing phpunit/php-text-template (1.2.1): Downloading (100%)
 - Installing phpunit/phpunit-mock-objects (2.3.8): Downloading (100%)
 - Installing phpunit/php-timer (1.0.9): Downloading (100%)
 - Installing phpunit/php-file-iterator (1.4.2): Downloading (100%)
 - Installing phpunit/php-token-stream (1.4.11): Downloading (100%)
 - Installing phpunit/php-code-coverage (2.2.4): Downloading (100%)
 - Installing webmozart/assert (1.2.0): Downloading (100%)
 - Installing phpdocumentor/reflection-common (1.0.1): Downloading (100%)
 - Installing phpdocumentor/type-resolver (0.4.0): Downloading (100%)
 - Installing phpdocumentor/reflection-docblock (4.1.1): Downloading (100%)
 - Installing phpspec/prophecy (v1.7.2): Downloading (100%)
 - Installing phpunit/phpunit (4.8.35): Downloading (100%)
 - Installing jakub-onderka/php-console-color (0.1): Downloading (100%)
 - Installing jakub-onderka/php-console-highlighter (v0.3.2): Downloading (100%)
 - Installing dnoegel/php-xdg-base-dir (0.1): Downloading (100%)
 - Installing nikic/php-parser (v2.1.0): Downloading (100%)
 - Installing symfony/polyfill-mbstring (v1.5.0): Downloading (100%)
 - Installing symfony/var-dumper (v3.3.9): Downloading (100%)
 - Installing symfony/debug (v3.3.9): Downloading (100%)
 - Installing symfony/console (v3.3.9): Downloading (100%)
 - Installing psy/psysh (v0.8.5): Downloading (100%)
 - Installing wikimedia/testing-access-wrapper (1.0.0): Downloading (100%)
 - Installing hamcrest/hamcrest-php (v2.0.0): Downloading (100%)
 - Installing wmde/hamcrest-html-matchers (v0.1.1): Downloading (100%)

sebastian/global-state suggests installing ext-uopz (*) phpunit/phpunit-mock-objects suggests installing ext-soap (*) phpunit/php-code-coverage suggests installing ext-xdebug (>=2.2.1) phpunit/phpunit suggests installing phpunit/php-invoker (~1.1) symfony/var-dumper suggests installing ext-symfony_debug () symfony/console suggests installing symfony/event-dispatcher () symfony/console suggests installing symfony/filesystem () symfony/console suggests installing symfony/process () psy/psysh suggests installing ext-pcntl (Enabling the PCNTL extension makes PsySH a lot happier :)) psy/psysh suggests installing ext-posix (If you have PCNTL, you'll want the POSIX extension as well.) psy/psysh suggests installing ext-pdo-sqlite (The doc command requires SQLite to work.) psy/psysh suggests installing hoa/console (A pure PHP readline implementation. You'll want this if your PHP install doesn't already support readline or libedit.) Writing lock file Generating optimized autoload files c:\xampp\htdocs\mediawiki\extensions>

Am I right in the assumption that you would suggest removing the extension and trying to install it using the Extension Distributor? Please let me know if you could provide other hints about how to resolve the issues.

Thank you very much in advance for your support.

PS: Sorry for the formatting, I could not figure out why <code> did not display properly in this case. Help would be appreciated

Osnard (talkcontribs)

I've had a quick look at the source code. It looks like the master branch is not operational. The "Html2Wiki" class which provides the callback is not registered to the autoloader.

I'd suggest you try to download REL1_29 from Special:ExtensionDistributor.

Bigfoot c (talkcontribs)

Dear Osnard

Thanks a mil for your suggestions. I followed the instructions you kindly provided, but so far I have been unable to run my wiki after making the necessary changes to the LocalSettings.php. As described in the Html2Wiki documentation, I added the following lines to my LocalSettings.php and ran the composer afterwards.

$wgNamespacesWithSubpages[NS_MAIN] = true; wfLoadExtension( 'Html2Wiki' );

When launching the wiki on my localhost server, the following error message crops up. I had a look at those php code lines mentioned in the error messages, but could not figure out how to resolve the issue, since the information in question appears to be stored in a variable. I do lack the skills for properly debugging php, but I have the feeling that this will not be necessary, since I am afraid I have yet made another configuration / installation error. This is the error I got (when removing the lines above, the wiki works fine, hence my assumptions about the config/install error). I would be delighted if you or other people could provide some assistance.

Fatal error: Uncaught Exception: C:\xampp\htdocs\mediawiki/extensions/Html2Wiki/extension.json does not exist! in C:\xampp\htdocs\mediawiki\includes\registration\ExtensionRegistry.php:99 Stack trace: #0 C:\xampp\htdocs\mediawiki\includes\GlobalFunctions.php(118): ExtensionRegistry->queue('C:\\xampp\\htdocs...') #1 C:\xampp\htdocs\mediawiki\LocalSettings.php(139): wfLoadExtension('Html2Wiki') #2 C:\xampp\htdocs\mediawiki\includes\WebStart.php(127): require_once('C:\\xampp\\htdocs...') #3 C:\xampp\htdocs\mediawiki\index.php(40): require('C:\\xampp\\htdocs...') #4 {main} thrown in C:\xampp\htdocs\mediawiki\includes\registration\ExtensionRegistry.php on line 99

Thanks in advance for your time and suggestions.

AhmadF.Cheema (talkcontribs)

Replace wfLoadExtension( 'Html2Wiki' ); with

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

(or C:\xampp\htdocs\mediawiki/extensions/Html2Wiki/Html2Wiki.php).

This should resolve one of the errors.

Using wfLoadExtension is the newer method of installing extensions, which required the extension files to have been updated with an extension.json file. For Html2Wiki it appears that only the master version has been updated and not the REL_1.29 branch. Therefore, when using REL_1.29 branch, the older method of activating extensions is required.

Bigfoot c (talkcontribs)

Dear AhmadF.Cheema, Thank your very much for your insight. I was able to resolve this particular issue with the help of your comments. However, I am now struggling with a new issue regarding the installation of this particular plugin. I am sorry for all these questions but I have not done any XAMP stuff on a WIN machine before. The next issue is that the Plugin seems to require Pandoc. I install Pandoc on my local machine and also added it ot the path environment. After restarting XAMP the error still appears saying

Html2Wiki requires pandoc.

On Ubuntu systems this is as simple as sudo apt-get install pandoc

Please see the installation instructions at https://www.mediawiki.org/wiki/Extension:Html2Wiki for more info. Could anybody please tell me how to go about the installation of Pandoc on an XAMP / WIN10 System?

Thanks in advance for your comments. Kind regards C.

AhmadF.Cheema (talkcontribs)

To make sure that Pandoc is installed and set in PATH, does running pandoc --version in cmd, show the installed Pandoc version? Also, have you installed composer too.

Bigfoot c (talkcontribs)

Dear AhmadF.Cheema

Thanks a mil for your reply. I just wanted to get back to regarding your comments. Pandoc is installed C:\WINDOWS\system32>pandoc --version pandoc 1.19.2.1 Compiled with pandoc-types 1.17.0.4, texmath 0.9, skylighting 0.1.1.4 Default user data directory: C:\Users\creske\AppData\Roaming\pandoc Copyright (C) 2006-2016 John MacFarlane Web: http://pandoc.org This is free software; see the source for copying conditions. There is no warranty, not even for merchantability or fitness for a particular purpose I ran the composer installer again to make sure it is installed properly. During installation I set the following php executable C:\xampp\php\php.exe

After that I ran a test-import of a zip-file containing html-files that I had previously prepared. The import was successful. I guess it is working now, otherwise I'll get back to the forum.

Thank you so much for your support in this matter, it is much appreciated.

Kind regards C.