Project:Support desk

Jump to navigation Jump to search

About this board

Welcome to the MediaWiki Support desk, where you can ask MediaWiki questions!

(Read this message in a different language)

See also

Other places to ask for help:

Before you post

Post a new question

  1. To help us answer your questions, please indicate which versions you are using, as found on your wiki's Special:Version page:
    • MediaWiki version
    • PHP version
    • Database type and version
  2. Please include the web address (URL) to your wiki if possible. It's often easier for us to identify the source of the problem if we can see the error directly.
  3. To start a new thread, click "Start a new topic".

How to prevent FOUC in an extension

3
2003:E7:570A:2200:998A:9322:CAC5:CA6E (talkcontribs)

I have an extension which defines a style file, places it into an extension bundle and does an $out->addModules in an onOutputPageBeforeHtml hook.

Unfortunately I get a flash of unstyled content (FOUC) affecting the class specifications.

I tried to put the style into Common.css - just the same problem.

My current workaround is to use $out->addHtml to inject a style tag containing the class definitions - but, of course, this is not really nice software engineering. Another workign workaround is to hardcode the style as part of the HTML tags. This is even less nice.


What is the best practice of adding css so that I get no FOUC?=

Mainframe98 (talkcontribs)
2003:E7:5707:4B00:C1B0:C242:1549:CB0 (talkcontribs)

Thnx. Works.

Reply to "How to prevent FOUC in an extension"

Infobox formatting problems with width and text wrapping

6
ECBritannia (talkcontribs)

Hi, I am facing some issues with infoboxes on my own wiki.


I am under the impression I have installed every infobox template available (that I have in use) and therefore I cannot account for the difference in formatting.


As an example, please see this infobox on my page on my personal wiki:


https://www.encyclopediabritannia.org/index.php?title=German_Canadians


Now compare this to the wikipedia version:


https://en.wikipedia.org/wiki/German_Canadians


As you can see, the formatting is very different. The wikipedia infobox is centred, and the text wraps, yet mine does not. The text makes the width of the infobox wider, when it should not.


This also happens on the infobox template itself.


Here is the template on my wiki:


https://www.encyclopediabritannia.org/index.php?title=Template:Infobox#Examples


Here is the template on wikipedia:


https://en.wikipedia.org/wiki/Template:Infobox#Examples


Again, the formatting on the template itself seems to be broken. I am not sure why this happens, but the formatting is broken and therefore *every* infobox on my wiki is broken.


Can anyone shed some light on this for me?


Thank you!


Edit 1: I have fixed the earlier issue, the Apache server was broken by an automated script. The above problem still exists though!

PerfektesChaos (talkcontribs)
ECBritannia (talkcontribs)

I have done it, THANK YOU! You are fantastic !

ECBritannia (talkcontribs)

Thanks for your help!


I cannot edit the common.css page on my own wiki, I want to make it a mirror of that on mediawiki/wikipedia but I cannot edit it


Do you know how I can give myself permissions? I am the only admin

PerfektesChaos (talkcontribs)

For modification of site CSS or JavaScript you need to be interface admin and as site maintainer you should be able to assign yourself to that group. The same way you made your account to be general admin (sysop group).

ECBritannia (talkcontribs)

You are amazing, thank you!

Reply to "Infobox formatting problems with width and text wrapping"

Error contacting the Parsoid/RESTBase server (HTTP 415)

43
189.217.121.39 (talkcontribs)

I just installed mediawiki 1.35 every time I edit with the visual editor, when I save changes, I get error 415 and I don't know what happens, what can I do?

MarkAHershberger (talkcontribs)

Check your access log and tell us what lines you see there for rest.php.

189.217.121.39 (talkcontribs)

i can't obtain access of the logs of the visualeditor, my wiki is alojed in host shared

Gota de agua (talkcontribs)

i check yhis mistake of the file rest.php

{"messageTranslations":{"es":"La ruta relativa solicitada () no coincide con ningún controlador conocido","en":"The requested relative path () did not match any known handler"},"httpCode":404,"httpReason":"Not Found"}

MarkAHershberger (talkcontribs)

How was that generated? And, it looks like VE is not set up correctly. How did you install it?

Gota de agua (talkcontribs)

that was installed with the mediawiki installation

MarkAHershberger (talkcontribs)

Can you add the following to your LocalSettings.php:

$logDir = "$IP/cache";
$wgDebugLogGroups['rest'] = "$logDir/rest.php";

(Change $logDir to something the webserver can write to, if needed.) And apply the following diff:

diff --git a/includes/Rest/EntryPoint.php b/includes/Rest/EntryPoint.php
index 84704e67bb..e9031619a7 100644
--- a/includes/Rest/EntryPoint.php
+++ b/includes/Rest/EntryPoint.php
@@ -130,14 +130,23 @@ class EntryPoint {
 
 	public function execute() {
 		ob_start();
+
+		wfDebugLog( "rest", __METHOD__ . " got router: " . get_class( $this->router ) );
 		$response = $this->router->execute( $this->request );
+		$proto = $response->getProtocolVersion();
+		$req = $this->request->getUri();
+		$code = $response->getStatusCode();
+		$reason = $response->getReasonPhrase();
+		wfDebugLog( "rest", "Got $code:$reason in response to $req" );
 
-		$this->webResponse->header(
-			'HTTP/' . $response->getProtocolVersion() . ' ' .
-			$response->getStatusCode() . ' ' .
-			$response->getReasonPhrase() );
+		$this->webResponse->header( "HTTP/$proto $code $reason" );
 
-		foreach ( $response->getRawHeaderLines() as $line ) {
+		wfDebugLog( "rest", "body: " . $this->request->getBody() );
+		foreach ( $this->request->getHeaders() as $headerType => $line ) {
+			wfDebugLog( "rest", "< $headerType: " . implode( "/", $line ) );
+		}
+		foreach ( $response->getRawHeaderLines() as $lineNo => $line ) {
+			wfDebugLog( "rest", "> $lineNo: $line" );
 			$this->webResponse->header( $line );
 		}
 
diff --git a/includes/Rest/Router.php b/includes/Rest/Router.php
index b6e674ea3c..1cb1b4f41f 100644
--- a/includes/Rest/Router.php
+++ b/includes/Rest/Router.php
@@ -362,8 +362,10 @@ class Router {
 		}
 
 		// Run the main part of the handler
+		wfDebugLog( "rest", "About to execute: " . get_class( $handler ) );
 		$response = $handler->execute();
 		if ( !( $response instanceof ResponseInterface ) ) {
+			wfDebugLog( "rest", "Response: $response" );
 			$response = $this->responseFactory->createFromReturnValue( $response );
 		}
 

(If you don't know what I mean by "apply the following diff", let me know and I'll try to guide you through it.)


After that, you should get messages in your rest.log file (the one you will have told MediaWiki to log requests to with your LocalSettings.php modifications) which should begin to give us an idea of what is happening.

Gota de agua (talkcontribs)

ok, i add the lines a localsentigs.php i don't undernstand "aplic the next diference " the file rest.log where to consult?

MarkAHershberger (talkcontribs)

Nevermind the diff. Just put replace includes/Rest/EntryPoint.php in your mediawiki installation with this file. After that, try to use the VE. A log file should show up under cache/rest.log on your shared hosing site.

Gota de agua (talkcontribs)
MarkAHershberger (talkcontribs)

So.... I have some logs from earlier this month that show the 415 responses like you're getting here, ... and I can't figure out what I did to get rid of them.

Gota de agua (talkcontribs)

so, that registers are solutions for this problem?

MarkAHershberger (talkcontribs)

There are. ping me here tomorrow and I'll ask you for some more debugging info that might help.

Gota de agua (talkcontribs)

good morning, According to everything, we agree that there is a solution, I hope it works, well then what remains to be done?

MarkAHershberger (talkcontribs)
Gota de agua (talkcontribs)
MarkAHershberger (talkcontribs)

Thank you. One more file. In mediawiki: includes/Rest/Validator/Validator.php

Then remove the rest log and re-do the edit test as before. This time, though, look for the section in your rest.log that begins "validateBody got headers: " and paste only that section.

Gota de agua (talkcontribs)

I just tested the visual editor and it still doesn't work, replace the above code in the rest.php file and it remains the same

MarkAHershberger (talkcontribs)

The last result you posted contained a line that looked like this:

   'content-type' => 'application/json',
   'via' => '1.1 alproxy',

The via seems to indicate that you are using a proxy server and it may be caching and/or changing your headers. Can you remove the proxy?

Gota de agua (talkcontribs)

ok, these lines have been eliminated, i don't see any results

MarkAHershberger (talkcontribs)

What do you mean by "these lines"?

Did you delete the old rest.log and use the includes/Rest/Validator/Validator.php replacement for the corresponding MediaWiki file that I pasted to generate a new rest.log?

Gota de agua (talkcontribs)

yes, I deleted the old rest, the new one removed the proxy lines and also added the "replacement of validateboy", the validator file, php, is also already modified

MarkAHershberger (talkcontribs)

Could you humor me and post the new rest.log?

Gota de agua (talkcontribs)
MarkAHershberger (talkcontribs)

This is the part I was looking for:

2020-10-21 16:48:32 http7 pony_mediawiki-wiki: validateBody got headers: array (
  'Connection' => 
  array (
    0 => 'close',
  ),
  'X-Ssl-Client-Verify' => 
  array (
    0 => 'NONE',
  ),
  'X-Ssl' => 
  array (
    0 => '1',
  ),
  'X-Forwarded-Proto' => 
  array (
    0 => 'https',
  ),
  'Via' => 
  array (
    0 => '1.1 alproxy',
  ),
  'Api-User-Agent' => 
  array (
    0 => 'VisualEditor-MediaWiki/1.35.0',
  ),
  'User-Agent' => 
  array (
    0 => 'VisualEditor-MediaWiki/1.35.0',
  ),
  'Accept-Language' => 
  array (
    0 => 'es',
  ),
  'Accept' => 
  array (
    0 => 'text/html; charset=utf-8; profile="https://www.mediawiki.org/wiki/Specs/HTML/2.0.0"',
  ),
  'Host' => 
  array (
    0 => 'lapluma.tk',
  ),
)

You can see that MediaWiki (Api-User-Agent) is going through the proxy (Via) and that the headers do not include Content-Type.

Do you have $wgHTTPProxy set?

Gota de agua (talkcontribs)

the proxyhttp i don't know, i don't know how configure that.

that code should it be removed or added?

MarkAHershberger (talkcontribs)

I thought you might be using and that might be causing the problem.

The problem apprears to be that mediawiki is somehow using a proxy when it should not be and that proxy appears to be filtering out some headers that Parsoid or VE expects.

Beyond that, I don't know what I can tell you since I'm not familiar with how your MediaWiki, php, or server is configured.

Gota de agua (talkcontribs)

ok i understand, visualeditor i think that is the configuration predeterm and i don't if exist how change that

my server is in alwaysdata is shared, these are my dates of software in the wiki, That would be solved although I don't know how it is

Producto Versión
MediaWiki 1.35.0
PHP 7.3.22 (cgi-fcgi)
MariaDB 10.4.14-MariaDB
ICU 63.1
Lua 5.1.5

URL del punto de entrada

Punto de entrada URL
Ruta del artículo /index.php?title=$1
Ruta de la secuencia de órdenes /
index.php /index.php
api.php /api.php
rest.php /rest.php

Apariencias instaladas

Apariencia Versión Licencia Descripción Autores
Vector GPL-2.0-or-later Versión moderna de MonoBook, con un aspecto actualizado y muchas mejoras de usabilidad Trevor Parscal, Roan Kattouw y otros

Extensiones instaladas

Páginas especiales
Extensión Versión Licencia Descripción Autores
CiteThisPage GPL-2.0-or-later Añade una página especial para citar las páginas y un enlace en el cuadro de herramientas Ævar Arnfjörð Bjarmason y James D. Forrester
Interwiki 3.2 GPL-2.0-or-later Añade una página especial para ver y editar la tabla de interwikis Stephanie Amanda Stevens, Alexandre Emsenhuber, Robin Pepermans, Siebrand Mazeland, Platonides, Raimond Spekking, Sam Reed, Jack Phoenix, Calimonius the Estrange y otros
Nuke 1.3.0 GPL-2.0-or-later Da a los administradores la posibilidad de borrar páginas de forma masiva Brion Vibber y Jeroen De Dauw
Renameuser GPL-2.0-or-later Añade una página especial para cambiar el nombre de un usuario (necesita el permiso renameuser) Ævar Arnfjörð Bjarmason y Aaron Schulz
Replace Text 1.4.1 GPL-2.0-or-later Provee a los administradores de una página especial para realizar una búsqueda y reemplazo global de una expresión en todas las páginas de una wiki. Yaron Koren, Niklas Laxström y otros
Editores
Extensión Versión Licencia Descripción Autores
CodeEditor GPL-2.0-or-later AND BSD-3-Clause Edición de páginas con resaltado de sintaxis para JavaScript y CSS, usando el editor Ace Brion Vibber, Derk-Jan Hartman y authors of Ace
VisualEditor 0.1.2 MIT Editor visual para MediaWiki Alex Monk, Bartosz Dziewoński, C. Scott Ananian, Christian Williams, David Lynch, Ed Sanders, Inez Korczyński, James D. Forrester, Moriel Schottlender, Roan Kattouw, Rob Moen, Subramanya Sastry, Thalia Chan, Timo Tijhof, Trevor Parscal y otros
WikiEditor 0.5.3 GPL-2.0-or-later Provee una interfaz avanzada y extensible de edición de wikitexto Derk-Jan Hartman, Trevor Parscal, Roan Kattouw, Nimish Gautam y Adam Miller
Extensiones del analizador sintáctico
Extensión Versión Licencia Descripción Autores
CategoryTree GPL-2.0-or-later Navegar dinámicamente por la estructura de categorías Daniel Kinzler
Cite GPL-2.0-or-later Añade las etiquetas <ref> y <references> para citas. Ævar Arnfjörð Bjarmason, Andrew Garrett, Brion Vibber, Ed Sanders, Marius Hoch, Steve Sanbeg, Trevor Parscal y otros
ImageMap GPL-2.0-or-later Permite image-maps dinámicos usando la etiqueta <imagemap> Tim Starling
InputBox 0.3.0 MIT Permite la inclusión de formularios HTML predefinidos Erik Moeller, Leonardo Pimenta, Rob Church, Trevor Parscal y DaSch
ParserFunctions 1.6.0 GPL-2.0-or-later Mejora el analizador con funciones lógicas. Tim Starling, Robert Rohde, Ross McClure y Juraj Simlovic
Poem CC0-1.0 Añade la etiqueta <poem> para dar el formato propio de un poema. Nikola Smolenski, Brion Vibber y Steve Sanbeg
Scribunto GPL-2.0-or-later AND MIT Marco para la incorporación de lenguajes de script en páginas de MediaWiki Victor Vasiliev, Tim Starling y Brad Jorsch
SyntaxHighlight 2.0 GPL-2.0-or-later Permite resaltar el código fuente usando la etiqueta <syntaxhighlight>. Esta extensión usa Pygments - Resaltador de sintaxis en Python Brion Vibber, Tim Starling, Rob Church, Niklas Laxström, Ori Livneh y Ed Sanders
TemplateData 0.1.2 GPL-2.0-or-later Implementa almacenamiento de datos para parámetros de plantillas (mediante JSON). Timo Tijhof, Moriel Schottlender, James D. Forrester, Trevor Parscal, Bartosz Dziewoński, Marielle Volz y otros
Manejadores de medios
Extensión Versión Licencia Descripción Autores
PDF Handler GPL-2.0-or-later Controlador para ver archivos PDF en modo imagen. Martin Seidel y Mike Połtyn
Prevención de spam
Extensión Versión Licencia Descripción Autores
ConfirmEdit 1.6.0 GPL-2.0-or-later Provee técnicas CAPTCHA para proteger contra spam y adivinación de contraseña. Brion Vibber, Florian Schmidt, Sam Reed y otros
SpamBlacklist GPL-2.0-or-later Herramienta anti-spam basada en expresiones regulares que permite filtrar URLs en páginas y direcciones de correo electrónico para usuarios registrados Tim Starling, John Du Hart y Daniel Kinzler
TitleBlacklist 1.5.0 GPL-2.0-or-later Permite que los administradores prohíban la creación de páginas y cuentas de usuario mediante una lista negra y una lista blanca Victor Vasiliev y Fran Rogers
API
Extensión Versión Licencia Descripción Autores
PageImages WTFPL Recopila información sobre las imágenes utilizadas en la página Max Semenik
Otro
Extensión Versión Licencia Descripción Autores
Gadgets GPL-2.0-or-later Permite a los usuarios seleccionar accesorios de CSS y JavaScript personalizados en sus preferencias. Daniel Kinzler y Max Semenik
LocalisationUpdate 1.4.0 GPL-2.0-or-later Mantiene los mensajes traducidos tan actualizados como sea posible Tom Maaswinkel, Niklas Laxström y Roan Kattouw
MultimediaViewer GPL-2.0-or-later Expande las miniaturas a un tamaño mayor en una vista de pantalla completa. MarkTraceur (Mark Holmquist), Gilles Dubuc, Gergő Tisza, Aaron Arcos, Zeljko Filipin, Pau Giner, theopolisme, MatmaRex, apsdehal, vldandrew, Ebrahim Byagowi, Dereckson, Brion VIBBER, Yuki Shira, Yaroslav Melnychuk, tonythomas01, Raimond Spekking, Kunal Mehta, Jeff Hall, Christian Aistleitner, Amir E. Aharoni y otros
Parsoid Licencia The Parsoid extension enables the REST API for Parsoid. This is needed to support VisualEditor.
SecureLinkFixer GPL-3.0-or-later Reescribe las URL a HTTPS si el dominio siempre requiere HTTPS Kunal Mehta
TextExtracts GPL-2.0-or-later Proporciona extractos del contenido de una página en texto sencillo o HTML limitado Max Semenik

Bibliotecas instaladas

Biblioteca Versión Licencia Descripción Autores
composer/semver 1.5.1 MIT Semver library that offers utilities, version constraint parsing and validation. Nils Adermann, Jordi Boggiano y Rob Bast
composer/spdx-licenses 1.5.3 MIT SPDX licenses list and validation library. Nils Adermann, Jordi Boggiano y Rob Bast
composer/xdebug-handler 1.4.3 MIT Restarts a process without Xdebug. John Stevenson
cssjanus/cssjanus 1.3.0 Apache-2.0 Convert CSS stylesheets between left-to-right and right-to-left. Trevor Parscal, Roan Kattouw y Timo Tijhof
dnoegel/php-xdg-base-dir 0.1.1 MIT implementation of xdg base directory specification for php
doctrine/cache 1.10.2 MIT PHP Doctrine Cache library is a popular cache implementation that supports many different drivers such as redis, memcache, apc, mongodb and others. Guilherme Blanco, Roman Borschel, Benjamin Eberlei, Jonathan Wage y Johannes Schmitt
doctrine/dbal 2.10.2 MIT Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management. Guilherme Blanco, Roman Borschel, Benjamin Eberlei y Jonathan Wage
doctrine/event-manager 1.1.1 MIT The Doctrine Event Manager is a simple PHP event system that was built to be used with the various Doctrine projects. Guilherme Blanco, Roman Borschel, Benjamin Eberlei, Jonathan Wage, Johannes Schmitt y Marco Pivetta
doctrine/instantiator 1.3.1 MIT A small, lightweight utility to instantiate objects in PHP without invoking their constructors Marco Pivetta
doctrine/sql-formatter 1.1.0 MIT a PHP SQL highlighting library Jeremy Dorn
felixfbecker/advanced-json-rpc 3.1.1 ISC A more advanced JSONRPC implementation Felix Becker
giorgiosironi/eris 0.10.0 MIT PHP library for property-based testing. Integrates with PHPUnit. Gabriele Lana, Giorgio Sironi y Mirko Bonadei
guzzlehttp/guzzle 6.5.4 MIT Guzzle is a PHP HTTP client library Michael Dowling
guzzlehttp/promises 1.4.0 MIT Guzzle promises library Michael Dowling
guzzlehttp/psr7 1.7.0 MIT PSR-7 message implementation that also provides common utility methods Michael Dowling y Tobias Schultze
hamcrest/hamcrest-php 2.0.1 BSD-3-Clause This is the PHP port of Hamcrest Matchers
johnkary/phpunit-speedtrap 3.2.0 MIT Find and report on slow tests in your PHPUnit test suite John Kary
justinrainbow/json-schema 5.2.10 MIT A library to validate a json schema. Bruno Prieto Reis, Justin Rainbow, Igor Wiedler y Robert Schönthal
liuggio/statsd-php-client 1.0.18 MIT Statsd (Object Oriented) client library for PHP Giulio De Donato
mediawiki/mediawiki-codesniffer 31.0.0 GPL-2.0-or-later MediaWiki CodeSniffer Standards
mediawiki/mediawiki-phan-config 0.10.2 GPL-2.0-or-later Standard MediaWiki phan configuration MediaWiki developers
mediawiki/phan-taint-check-plugin 3.0.2 GPL-2.0-or-later A Phan plugin to do security checking Brian Wolff
microsoft/tolerant-php-parser 0.0.20 MIT Tolerant PHP-to-AST parser designed for IDE usage scenarios Rob Lourens
monolog/monolog 1.25.5 MIT Sends your logs to files, sockets, inboxes, databases and various web services Jordi Boggiano
myclabs/deep-copy 1.10.1 MIT Create deep copies (clones) of your objects
netresearch/jsonmapper 2.1.0 OSL-3.0 Map nested JSON structures onto PHP classes Christian Weiske
nikic/php-parser 4.4.0 BSD-3-Clause A PHP parser written in PHP Nikita Popov
nmred/kafka-php 0.1.5 BSD-3-Clause Kafka client for php
oojs/oojs-ui 0.39.3 MIT Provides library of common widgets, layouts, and windows. Bartosz Dziewoński, Ed Sanders, James D. Forrester, Kirsten Menger-Anderson, Kunal Mehta, Prateek Saxena, Roan Kattouw, Rob Moen, Timo Tijhof y Trevor Parscal
pear/console_getopt 1.4.3 BSD-2-Clause More info available on: http://pear.php.net/package/Console_Getopt Andrei Zmievski, Stig Bakken y Greg Beaver
pear/mail 1.4.1 BSD-2-Clause Class that provides multiple interfaces for sending emails. Chuck Hagenbuch, Richard Heyes y Aleksander Machniak
pear/mail_mime 1.10.8 BSD-3-clause Mail_Mime provides classes to create MIME messages Cipriano Groenendal y Aleksander Machniak
pear/net_smtp 1.9.1 BSD-2-Clause An implementation of the SMTP protocol Jon Parise y Chuck Hagenbuch
pear/net_socket 1.2.2 PHP License More info available on: http://pear.php.net/package/Net_Socket Chuck Hagenbuch, Aleksander Machniak y Stig Bakken
pear/pear-core-minimal 1.10.10 BSD-3-Clause Minimal set of PEAR core files to be used as composer dependency Christian Weiske
pear/pear_exception 1.0.1 BSD-2-Clause The PEAR Exception base class. Helgi Thormar y Greg Beaver
phan/phan 2.6.1 MIT A static analyzer for PHP Tyson Andre, Rasmus Lerdorf y Andrew S. Morrison
phar-io/manifest 1.0.3 BSD-3-Clause Component for reading phar.io manifest information from a PHP Archive (PHAR) Arne Blankerts, Sebastian Heuer y Sebastian Bergmann
phar-io/version 2.0.1 BSD-3-Clause Library for handling version information and constraints Arne Blankerts, Sebastian Heuer y Sebastian Bergmann
php-parallel-lint/php-console-color 0.3 BSD-2-Clause Jakub Onderka
php-parallel-lint/php-console-highlighter 0.5 MIT Highlight PHP code in terminal Jakub Onderka
php-parallel-lint/php-parallel-lint 1.2.0 BSD-2-Clause This tool check syntax of PHP files about 20x faster than serial check. Jakub Onderka
phpdocumentor/reflection-common 2.2.0 MIT Common reflection classes used by phpdocumentor to reflect the code structure Jaap van Otterdijk
phpdocumentor/reflection-docblock 5.2.2 MIT With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock. Mike van Riel y Jaap van Otterdijk
phpdocumentor/type-resolver 1.4.0 MIT A PSR-5 based resolver of Class names, Types and Structural Element Names Mike van Riel
phpspec/prophecy 1.12.1 MIT Highly opinionated mocking framework for PHP 5.3+ Konstantin Kudryashov y Marcello Duarte
phpunit/php-code-coverage 7.0.10 BSD-3-Clause Library that provides collection, processing, and rendering functionality for PHP code coverage information. Sebastian Bergmann
phpunit/php-file-iterator 2.0.2 BSD-3-Clause FilterIterator implementation that filters files based on a list of suffixes. Sebastian Bergmann
phpunit/php-text-template 1.2.1 BSD-3-Clause Simple template engine. Sebastian Bergmann
phpunit/php-timer 2.1.2 BSD-3-Clause Utility class for timing Sebastian Bergmann
phpunit/php-token-stream 3.1.1 BSD-3-Clause Wrapper around PHP's tokenizer extension. Sebastian Bergmann
phpunit/phpunit 8.5.8 BSD-3-Clause The PHP Unit Testing framework. Sebastian Bergmann
pimple/pimple 3.3.0 MIT Pimple, a simple Dependency Injection Container Fabien Potencier
pleonasm/bloom-filter 1.0.2 BSD-2-Clause A pure PHP implementation of a Bloom Filter Matthew Nagi
psr/container 1.0.0 MIT Common Container Interface (PHP FIG PSR-11) PHP-FIG
psr/http-message 1.0.1 MIT Common interface for HTTP messages PHP-FIG
psr/log 1.1.3 MIT Common interface for logging libraries PHP-FIG
psy/psysh 0.10.4 MIT An interactive shell for modern PHP. Justin Hileman
ralouphie/getallheaders 3.0.3 MIT A polyfill for getallheaders. Ralph Khattar
sabre/event 5.1.2 BSD-3-Clause sabre/event is a library for lightweight event-based programming Evert Pot
sebastian/code-unit-reverse-lookup 1.0.1 BSD-3-Clause Looks up which function or method a line of code belongs to Sebastian Bergmann
sebastian/comparator 3.0.2 BSD-3-Clause Provides the functionality to compare PHP values for equality Jeff Welch, Volker Dusch, Bernhard Schussek y Sebastian Bergmann
sebastian/diff 3.0.2 BSD-3-Clause Diff implementation Kore Nordmann y Sebastian Bergmann
sebastian/environment 4.2.3 BSD-3-Clause Provides functionality to handle HHVM/PHP environments Sebastian Bergmann
sebastian/exporter 3.1.2 BSD-3-Clause Provides the functionality to export PHP variables for visualization Sebastian Bergmann, Jeff Welch, Volker Dusch, Adam Harvey y Bernhard Schussek
sebastian/global-state 3.0.0 BSD-3-Clause Snapshotting of global state Sebastian Bergmann
sebastian/object-enumerator 3.0.3 BSD-3-Clause Traverses array structures and object graphs to enumerate all referenced objects Sebastian Bergmann
sebastian/object-reflector 1.1.1 BSD-3-Clause Allows reflection of object attributes, including inherited and non-public ones Sebastian Bergmann
sebastian/recursion-context 3.0.0 BSD-3-Clause Provides functionality to recursively process PHP variables Jeff Welch, Sebastian Bergmann y Adam Harvey
sebastian/resource-operations 2.0.1 BSD-3-Clause Provides a list of PHP built-in functions that operate on resources Sebastian Bergmann
sebastian/type 1.1.3 BSD-3-Clause Collection of value objects that represent the types of the PHP type system Sebastian Bergmann
sebastian/version 2.0.1 BSD-3-Clause Library that helps with managing the version number of Git-hosted PHP projects Sebastian Bergmann
seld/jsonlint 1.7.1 MIT JSON Linter Jordi Boggiano
squizlabs/php_codesniffer 3.5.5 BSD-3-Clause PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards. Greg Sherwood
symfony/console 5.1.7 MIT Symfony Console Component Fabien Potencier y Symfony Community
symfony/polyfill-intl-grapheme 1.18.1 MIT Symfony polyfill for intl's grapheme_* functions Nicolas Grekas y Symfony Community
symfony/polyfill-intl-idn 1.17.0 MIT Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions Laurent Bassin y Symfony Community
symfony/polyfill-intl-normalizer 1.18.1 MIT Symfony polyfill for intl's Normalizer class and related functions Nicolas Grekas y Symfony Community
symfony/polyfill-php72 1.18.1 MIT Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions Nicolas Grekas y Symfony Community
symfony/polyfill-php73 1.18.1 MIT Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions Nicolas Grekas y Symfony Community
symfony/polyfill-php80 1.18.1 MIT Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions Ion Bazan, Nicolas Grekas y Symfony Community
symfony/service-contracts 2.2.0 MIT Generic abstractions related to writing services Nicolas Grekas y Symfony Community
symfony/string 5.1.7 MIT Symfony String component Nicolas Grekas y Symfony Community
symfony/var-dumper 5.1.7 MIT Symfony mechanism for exploring and dumping PHP variables Nicolas Grekas y Symfony Community
symfony/yaml 5.0.11 MIT Symfony Yaml Component Fabien Potencier y Symfony Community
theseer/tokenizer 1.2.0 BSD-3-Clause A small library for converting tokenized PHP source code into XML and potentially other formats Arne Blankerts
webmozart/assert 1.9.1 MIT Assertions to validate method input/output with nice error messages. Bernhard Schussek
wikimedia/assert 0.5.0 MIT Provides runtime assertions Daniel Kinzler y Thiemo Kreuz
wikimedia/at-ease 2.0.0 GPL-2.0-or-later Safe replacement to @ for suppressing warnings. Tim Starling y MediaWiki developers
wikimedia/avro 1.9.0 Apache-2.0 A library for using Apache Avro with PHP. Michael Glaesemann, Andy Wick, Saleem Shafi, A B, Doug Cutting y Tom White
wikimedia/base-convert 2.0.1 GPL-2.0-or-later Convert an arbitrarily-long string from one numeric base to another, optionally zero-padding to a minimum column width. Brion Vibber y Tyler Romeo
wikimedia/cdb 1.4.1 GPL-2.0+ Constant Database (CDB) wrapper library for PHP. Provides pure-PHP fallback when dba_* functions are absent. Daniel Kinzler, Tim Starling, Chad Horohoe y Ori Livneh
wikimedia/cldr-plural-rule-parser 1.0.0 GPL-2.0+ Evaluates plural rules specified in the CLDR project notation. Tim Starling y Niklas Laxström
wikimedia/common-passwords 0.2.0 MIT List of the 100,000 most commonly used passwords Sam Reed
wikimedia/composer-merge-plugin 1.4.1 MIT Composer plugin to merge multiple composer.json files Bryan Davis
wikimedia/html-formatter 1.0.2 GPL-2.0-or-later Performs transformations of HTML by wrapping around libxml2 and working around its countless bugs. MediaWiki contributors
wikimedia/ip-set 2.1.0 GPL-2.0-or-later Efficiently match IP addresses against a set of CIDR specifications. Brandon Black
wikimedia/ip-utils 1.0.0 GPL-2.0-or-later Functions and constants to play with IP addresses and ranges MediaWiki developers
wikimedia/less.php 3.0.0 Apache-2.0 PHP port of the Javascript version of LESS http://lesscss.org (Originally maintained by Josh Schmidt) Josh Schmidt, Matt Agar y Martin Jantošovič
wikimedia/object-factory 2.1.0 GPL-2.0-or-later Construct objects from configuration instructions Bryan Davis
wikimedia/parsoid 0.12.0 GPL-2.0-or-later Parsoid, a bidirectional parser between wikitext and HTML5 Wikimedia Parsing Team and the broader MediaWiki community
wikimedia/php-session-serializer 1.0.7 GPL-2.0-or-later Provides methods like PHP's session_encode and session_decode that don't mess with $_SESSION Brad Jorsch
wikimedia/purtle 1.0.7 GPL-2.0-or-later Fast streaming RDF serializer Daniel Kinzler, Stanislav Malyshev, C. Scott Ananian y Thiemo Kreuz
wikimedia/relpath 2.1.1 MIT Compute a relative filepath between two paths. Ori Livneh
wikimedia/remex-html 2.2.0 MIT Fast HTML 5 parser Tim Starling
wikimedia/running-stat 1.2.1 GPL-2.0+ PHP implementations of online statistical algorithms Ori Livneh
wikimedia/scoped-callback 3.0.0 GPL-2.0-or-later Class for asserting that a callback happens when a dummy object leaves scope Aaron Schulz
wikimedia/services 2.0.1 GPL-2.0-or-later Generic service to manage named services using lazy instantiation based on instantiator callback functions Daniel Kinzler
wikimedia/testing-access-wrapper 1.0.0 GPL-2.0+ A simple helper class to access non-public elements of a class when testing. Adam Roses Wight, Brad Jorsch y Gergő Tisza
wikimedia/timestamp 3.0.0 GPL-2.0-or-later Creation, parsing, and conversion of timestamps Tyler Romeo
wikimedia/utfnormal 2.0.0 GPL-2.0-or-later Contains Unicode normalization routines, including both pure PHP implementations and automatic use of the 'intl' PHP extension when present Brion Vibber
wikimedia/wait-condition-loop 1.0.1 GPL-2.0+ Wait loop that reaches a condition or times out Aaron Schulz
wikimedia/wikipeg 2.0.4 MIT Parser generator for JavaScript and PHP
wikimedia/wrappedstring 3.2.0 MIT Automatically compact sequentially-outputted strings that share a common prefix / suffix pair. Timo Tijhof
wikimedia/xmp-reader 0.7.0 GPL-2.0-or-later Reader for XMP data containing properties relevant to images Brian Wolff
wikimedia/zest-css 1.1.3 MIT Fast, lightweight, extensible CSS selector engine for PHP Christopher Jeffrey y C. Scott Ananian
wmde/hamcrest-html-matchers 0.1.1 LGPL-2.1 Set of Hamcrest matchers for HTML assertrions Aleksey Bekh-Ivanov
zordius/lightncandy 1.2.5 MIT An extremely fast PHP implementation of handlebars ( http://handlebarsjs.com/ ) and mustache ( http://mustache.github.io/ ). Zordius Chen
MarkAHershberger (talkcontribs)

This information is helpful, but would probably be most helpful is your LocalSettings.php file with passwords elided.

Gota de agua (talkcontribs)
<?php
#This file was automatically generated by the MediaWiki 1.35.0
#installer. If you make manual changes, please keep track in case you
#need to recreate them later.
#
#See includes/DefaultSettings.php for all configurable settings
#and their default values, but don't forget to make changes in _this_
#file, not there.
#
#Further documentation for configuration settings may be found at:
#https://www.mediawiki.org/wiki/Manual:Configuration_settings

#Protect against web entry
if ( !defined( 'MEDIAWIKI' ) ) {
	exit;
}


##Uncomment this to disable output compression
#$wgDisableOutputCompression = true;

$wgSitename = "La pluma azul";
$wgMetaNamespace = "La_pluma_azul";

##The URL base path to the directory containing the wiki;
##defaults for all runtime URL paths are based off of this.
##For more information on customizing the URLs
##(like /w/index.php/Page_title to /wiki/Page_title) please see:
##https://www.mediawiki.org/wiki/Manual:Short_URL
$wgScriptPath = "";

##The protocol and server name to use in fully-qualified URLs
$wgServer = "http://lapluma.tk";

##The URL path to static resources (images, scripts, etc.)
$wgResourceBasePath = $wgScriptPath;

##The URL paths to the logo.  Make sure you change this from the default,
##or else you'll overwrite your logo when you upgrade!
$wgLogos = [ '1x' => "$wgResourceBasePath/resources/assets/wiki.png" ];

##UPO means: this is also a user preference option

$wgEnableEmail = true;
$wgEnableUserEmail = true; # UPO

$wgEmergencyContact = "[email protected]";
$wgPasswordSender = "[email protected]";

$wgEnotifUserTalk = false; # UPO
$wgEnotifWatchlist = false; # UPO
$wgEmailAuthentication = true;

##Database settings
$wgDBtype = "mysql";
$wgDBserver = "mysql-pony.alwaysdata.net";
$wgDBname = "pony_mediawiki";
$wgDBuser = "pony_mediawiki1";
$wgDBpassword = "---";

#MySQL specific settings
$wgDBprefix = "wiki";

#MySQL table options to use during installation or update
$wgDBTableOptions = "ENGINE=InnoDB, DEFAULT CHARSET=binary";

##Shared memory settings
$wgMainCacheType = CACHE_NONE;
$wgMemCachedServers = [];

##To enable image uploads, make sure the 'images' directory
##is writable, then set this to true:
$wgEnableUploads = false;
$wgUseImageMagick = true;
$wgImageMagickConvertCommand = "/usr/bin/convert";

#InstantCommons allows wiki to use images from https://commons.wikimedia.org
$wgUseInstantCommons = false;

#Periodically send a pingback to https://www.mediawiki.org/ with basic data
#about this MediaWiki instance. The Wikimedia Foundation shares this data
#with MediaWiki developers to help guide future development efforts.
$wgPingback = false;

##If you use ImageMagick (or any other shell command) on a
##Linux server, this will need to be set to the name of an
##available UTF-8 locale
$wgShellLocale = "C.UTF-8";

##Set $wgCacheDirectory to a writable directory on the web server
##to make your wiki go slightly faster. The directory should not
##be publicly accessible from the web.
#$wgCacheDirectory = "$IP/cache";

#Site language code, should be one of the list in ./languages/data/Names.php
$wgLanguageCode = "es";

$wgSecretKey = "---";

#Changing this will log out all existing sessions.
$wgAuthenticationTokenVersion = "1";

#Site upgrade key. Must be set to a string (default provided) to turn on the
#web installer while LocalSettings.php is in place
$wgUpgradeKey = "---";

##For attaching licensing metadata to pages, and displaying an
##appropriate copyright notice / icon. GNU Free Documentation
##License and Creative Commons licenses are supported so far.
$wgRightsPage = ""; # Set to the title of a wiki page that describes your license/copyright
$wgRightsUrl = "";
$wgRightsText = "";
$wgRightsIcon = "";

#Path to the GNU diff3 utility. Used for conflict resolution.
$wgDiff3 = "/usr/bin/diff3";

##Default skin: you can change the default skin. Use the internal symbolic
##names, ie 'vector', 'monobook':
$wgDefaultSkin = "vector";

#Enabled skins.
#The following skins were automatically enabled:
wfLoadSkin( 'Vector' );

wfLoadExtension( 'CategoryTree' );
wfLoadExtension( 'Cite' );
wfLoadExtension( 'CiteThisPage' );
wfLoadExtension( 'CodeEditor' );
wfLoadExtension( 'ConfirmEdit' );
wfLoadExtension( 'Gadgets' );
wfLoadExtension( 'ImageMap' );
wfLoadExtension( 'InputBox' );
wfLoadExtension( 'Interwiki' );
wfLoadExtension( 'LocalisationUpdate' );
wfLoadExtension( 'MultimediaViewer' );
wfLoadExtension( 'Nuke' );
wfLoadExtension( 'PageImages' );
wfLoadExtension( 'ParserFunctions' );
wfLoadExtension( 'PdfHandler' );
wfLoadExtension( 'Poem' );
wfLoadExtension( 'Renameuser' );
wfLoadExtension( 'ReplaceText' );
wfLoadExtension( 'Scribunto' );
wfLoadExtension( 'SecureLinkFixer' );
wfLoadExtension( 'SpamBlacklist' );
wfLoadExtension( 'SyntaxHighlight_GeSHi' );
wfLoadExtension( 'TemplateData' );
wfLoadExtension( 'TextExtracts' );
wfLoadExtension( 'TitleBlacklist' );
wfLoadExtension( 'VisualEditor' );
wfLoadExtension( 'WikiEditor' );

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

$PARSOID_INSTALL_DIR = 'vendor/wikimedia/parsoid'; # bundled copy
#$PARSOID_INSTALL_DIR = '/my/path/to/git/checkout/of/Parsoid';

// For developers: ensure Parsoid is executed from $PARSOID_INSTALL_DIR,
// (not the version included in mediawiki-core by default)
// Must occur *before* wfLoadExtension()
if ( $PARSOID_INSTALL_DIR !== 'vendor/wikimedia/parsoid' ) {
    AutoLoader::$psr4Namespaces += [
        // Keep this in sync with the "autoload" clause in
        // $PARSOID_INSTALL_DIR/composer.json
        'Wikimedia\\Parsoid\\' => "$PARSOID_INSTALL_DIR/src",
    ];
}

wfLoadExtension( 'Parsoid', "$PARSOID_INSTALL_DIR/extension.json" );

#Manually configure Parsoid
$wgVisualEditorParsoidAutoConfig = false;
$wgParsoidSettings = [
    'useSelser' => true,
    'rtTestMode' => false,
    'linting' => false,
];
$wgVirtualRestConfig['modules']['parsoid'] = [];
$logDir = "$IP/cache";
$wgDebugLogGroups['rest'] = "$logDir/rest.php";
$wgVisualEditorFullRestbaseURL = true;
MarkAHershberger (talkcontribs)

It looks like you are using the developers instructions which the VE page says:

By default VisualEditor is automatically configured to talk to a Parsoid service running on the same host. You should not need to change this in most cases!

What happens if you remove everything after #Add more configuration options below. except

$logDir = "$IP/cache";
$wgDebugLogGroups['rest'] = "$logDir/rest.log";
Gota de agua (talkcontribs)

that don't help, because i preview I tried it and it kept marking the error

what instrucctions i should revise for the visualeditor normally?

MarkAHershberger (talkcontribs)

Even if you tried it previously, you should try it again now that we have the rest.log recording problems. It may tell us something new.

Gota de agua (talkcontribs)
MarkAHershberger (talkcontribs)

No new information, that I could see. Could you try this updated version of includes/Rest/Validator/Validator.php for mediawiki? I commented out the line causing it to return 415.

It will probably still fail, but the failure will be interesting.

Gota de agua (talkcontribs)

the changes are diferent

MarkAHershberger (talkcontribs)

Well, you are getting farther. I would suggest filing a bug at this point giving as much information as you have. Something is going on with the proxy and I do not know how to fix it.

Uvas magicas (talkcontribs)

@MarkAHershberger, something strange that I realized is that when I use http the visual editor does work but when I use https (ssl) the visual editor marks this error when saving the edition

MarkAHershberger (talkcontribs)

Interesting... Change $wgServer to https and see if it works for https edits then.

If it does, then just make the webserver redirect all requests to https.

Uvas magicas (talkcontribs)

sorry i meant, the visualeditor 100 % working in url http but in https (ssl) does't work and places this mistake before save the changes

Arthurd2 (talkcontribs)

I had the same error here and, despite of the HTTPS redirects, at the end was the lack of "https" in my $wgServer .

I've notice this by the JSON response of the 415 error message (using inspect).

I've also changfe the $response['code'] to print_r($response,true) to get the full error data.

./VisualEditor/includes/ApiParsoidTrait.php:                [ 'apierror-visualeditor-docserver-http', $response['code'] ]

Xelgen (talkcontribs)

Experienced same issue, and it was resolved by changing url of website in $wgServer from http to https. Thanks for the hints.

73.89.215.13 (talkcontribs)

Hello, thankful for all of the efforts and details in this thread! As simple as this may sound, the culprit that I found was semicolon characters in the content ¯\_(ツ)_/¯

I'm running a new installation of MediaWiki 1.35 and I can reproduce this issue just by adding a semicolon to my text in the Visual Editor. When I leave out semicolons, no issue.

Reply to "Error contacting the Parsoid/RESTBase server (HTTP 415)"

SyntaxHighlight not working in MediaWiki 1.36.0

2
Eddi27L (talkcontribs)

Hi

I tried to enable SyntaxHighlight on my newly installed Wiki, running inside XAMPP 8.0.6 on Windows 10 Version 2004, 64bit.

Attempt 1: Using the incorporated pygmentize

Firtstly I had to rename "pygmentize" to "pygmentize.pyc" and add the following line to LocalSettings.php:

$wgPygmentizePath = 'D:/xampp/htdocs/mywiki/extensions/SyntaxHighlight_GeSHi/pygments/pygmentize.pyc';

When I edit a page with syntaxhighlight, the following messages are logged in the wiki logfile:

[Called from SyntaxHighlight::{closure} in D:\xampp\htdocs\mywiki\extensions\SyntaxHighlight_GeSHi\includes\SyntaxHighlight.php at line 293]
[exec] Executing: cmd /s /c ""D:/xampp/htdocs/mywiki/extensions/SyntaxHighlight_GeSHi/pygments/pygmentize.pyc" "-l" "php" "-f" "html" "-O" "cssclass=mw-highlight,encoding=utf-8,startinline=1""
[exec] Error running cmd /s /c ""D:/xampp/htdocs/mywiki/extensions/SyntaxHighlight_GeSHi/pygments/pygmentize.pyc" "-l" "php" "-f" "html" "-O" "cssclass=mw-highlight,encoding=utf-8,startinline=1"": Zugriff verweigert

Zugriff verweigert means access denied

If I call the above command on the command line it works fine and delivers correct result (if you input some lines on the standard input):

D:\>cmd /s /c ""D:/xampp/htdocs/mywiki/extensions/SyntaxHighlight_GeSHi/pygments/pygmentize.pyc" "-l" "php" "-f" "html" "-O" "cssclass=mw-highlight,encoding=utf-8,startinline=1""
print "Hello";
^Z
<div class="mw-highlight"><pre><span></span><span class="k">print</span> <span class="s2">"Hello"</span><span class="p">;</span>
</pre></div>

D:\>

Attempt 2: Using external pygmentize.exe

I replaced the line in localsettings.php with:

$wgPygmentizePath = 'C:/Python39/Scripts/pygmentize.exe';

This time the following lines are logged:

[Called from SyntaxHighlight::{closure} in D:\xampp\htdocs\mywiki\extensions\SyntaxHighlight_GeSHi\includes\SyntaxHighlight.php at line 293]
[exec] Executing: cmd /s /c ""C:/Python39/Scripts/pygmentize.exe" "-l" "php" "-f" "html" "-O" "cssclass=mw-highlight,encoding=utf-8,startinline=1""
[exec] Error running cmd /s /c ""C:/Python39/Scripts/pygmentize.exe" "-l" "php" "-f" "html" "-O" "cssclass=mw-highlight,encoding=utf-8,startinline=1"": Fatal Python error: _Py_HashRandomization_Init: failed to get random numbers to initialize Python

According to this thread, the Environment variable SystemRoot must be set properly, otherwise the Win32 API call CryptAcquireContext will fail when called inside python during initialization. (quoted from above link).

On my system, SystemRoot is properly set, even inside the script D:\xampp\htdocs\mywiki\extensions\SyntaxHighlight_GeSHi\includes\SyntaxHighlight.php Maybe some security features prevent access to SystemRoot?

Again, when invoked on the command line it works fine:

D:\>cmd /s /c ""C:/lang/Python39/Scripts/pygmentize.exe" "-l" "php" "-f" "html" "-O" "cssclass=mw-highlight,encoding=utf-8,startinline=1""
echo "hello";
^Z
<div class="mw-highlight"><pre><span></span><span class="k">echo</span> <span class="s2">"hello"</span><span class="p">;</span>
</pre></div>

D:\>


Using:

  • Window 10 Version 2004, 64bit
  • XAMPP 8.0.6
  • MediaWiki 1.36.0
  • Python 3.9.5
  • Pygments 2.9.0 (for the external attempt)

Hope this information is helpful to fix this issue.

Eddi27L (talkcontribs)
Reply to "SyntaxHighlight not working in MediaWiki 1.36.0"

Migrating from 1.9.3 to 1.34 - Geshi no longer available

16
46.232.228.6 (talkcontribs)

I was using the Geshi extension o 1.9.3 with content like


<code xml>

...

    <customcerts

dir="certs"

    />

...

</code>


Now the Geshi extension is gone and I could use Extension:SyntaxHighlight. However, I have hundreds of pages using the <code ''lang''> tag instead of <syntaxhighlight lang="''lang''">. Is there a solution to that apart from manually editing all of them?


Thanks and Regards, Christoph

AhmadF.Cheema (talkcontribs)
46.232.228.6 (talkcontribs)

Thanks for pointing me to Replace Text, @AhmadF.Cheema!

However, I do not get the extension to work on a Windows system:

syntaxhighlight uses Pygmentize directly (such as 'C:\...\SyntaxHighlight_GeSHi\includes/../pygments/pygmentize" "-l" "xml" "-f" "html" "-O" "cssclass"').

pygmentize is a script starting with "#!/usr/bin/env python3" which is going to work on *nix'ish systems fine but won't work on Windows. So I get an expection "PHP Notice: Failed to invoke Pygments" when the extensions tries to render a page.

I installed python 3.8 on the box which seems to run fine (at least, I can get a python prompt with now errors).

So as far as I am concerned, this won't ever work on Windows, does it?

Some googling yields a page saying you need to install ez_install.py and run it. I did so (downloading it from pypi.org) and it bails out saying "SSL required". So I edited it and changed the download URL from http to https.

Now it bails out saying "in self.chown(tarinfo, dirpath) TypeError: chown() missing 1 required positional argument: 'numeric_owner'".

It is frustrating :-|

Am I on the right track with getting ez_install to run?

Or is there a way to tell mediawiki to just call upon python.exe directly?

MarkAHershberger (talkcontribs)
46.232.228.6 (talkcontribs)

@MarkAHershberger you made my day - almost!

here it is in a nutshell:

      [ install python 3.8 ]

python -m ensurepip --default-pip

      python -m pip install --upgrade pip setuptools wheel

      easy_install Pygments

now there is a Windows pygmentize.exe in .../python/Scripts

set "$wgPygmentizePath = "C:/.../python/Scripts/pygmentize.exe"; in LocalSettings.php

I can run pygmentize from the shell.


But: although $wgPygmentizePath is set correctly, I keep getting

PHP Notice: fwrite(): write of 1597 bytes failed with errno=22 Invalid argument in C:\inetpub\wwwroot\wiki\mediawiki-1.34.0\includes\shell\Command.php on line 475

Apparently, proc_open in Command.php cannot start the executable.

Has anyone got SyntaxHighlight_GeSHi to work on a Windows/IIS system? (IIS 8.5, latest PHP 7) ?

MarkAHershberger (talkcontribs)

You seem to have stumbled upon a windows-only bug. Can you get a stacktrace of the error? Try the following:

  • $wgShowExceptionDetails Enable more details (like a stack trace) to be shown on the "Fatal error" page.
  • $wgShowDebug Adds the "log messages" part of wgDebugToolbar as a raw list to the page.
46.232.228.6 (talkcontribs)

@MarkAHershberger


Here is the trace:

PHP Notice:  fwrite(): write of 53 bytes failed with errno=22 Invalid argument in C:\inetpub\wwwroot\wiki\mediawiki-1.34.0\includes\shell\Command.php on line 474

PHP Stack trace:

PHP  17. PPFrame_Hash->expand() C:\inetpub\wwwroot\wiki\mediawiki-1.34.0\includes\parser\Parser.php:3330

PHP  18. Parser->extensionSubstitution() C:\inetpub\wwwroot\wiki\mediawiki-1.34.0\includes\parser\PPFrame_Hash.php:328

PHP  19. SyntaxHighlight::parserHook() C:\inetpub\wwwroot\wiki\mediawiki-1.34.0\includes\parser\Parser.php:4293

PHP  20. SyntaxHighlight::highlight() C:\inetpub\wwwroot\wiki\mediawiki-1.34.0\extensions\SyntaxHighlight_GeSHi\includes\SyntaxHighlight.php:117

PHP  21. WANObjectCache->getWithSetCallback() C:\inetpub\wwwroot\wiki\mediawiki-1.34.0\extensions\SyntaxHighlight_GeSHi\includes\SyntaxHighlight.php:348

PHP  22. WANObjectCache->fetchOrRegenerate() C:\inetpub\wwwroot\wiki\mediawiki-1.34.0\includes\libs\objectcache\wancache\WANObjectCache.php:1278

PHP  23. SyntaxHighlight::{closure:C:\inetpub\wwwroot\wiki\mediawiki-1.34.0\extensions\SyntaxHighlight_GeSHi\includes\SyntaxHighlight.php:306-348}() C:\inetpub\wwwroot\wiki\mediawiki-1.34.0\includes\libs\objectcache\wancache\WANObjectCache.php:1424

PHP  24. MediaWiki\Shell\Command->execute() C:\inetpub\wwwroot\wiki\mediawiki-1.34.0\extensions\SyntaxHighlight_GeSHi\includes\SyntaxHighlight.php:320

PHP  25. fwrite() C:\inetpub\wwwroot\wiki\mediawiki-1.34.0\includes\shell\Command.php:474

PHP Notice:  Failed to invoke Pygments: Der Befehl "C:\inetpub\wwwroot\wiki\mediawiki-1.34.0\extensions\SyntaxHighlight_GeSHi\python38\Scripts\pygmentize.exe" "-l" "xml" "-f" "html" "-O" "cssclass" ist entweder falsch geschrieben oder

konnte nicht gefunden werden.

[Called from SyntaxHighlight::highlight in C:\inetpub\wwwroot\wiki\mediawiki-1.34.0\extensions\SyntaxHighlight_GeSHi\includes\SyntaxHighlight.php at line 353] in C:\inetpub\wwwroot\wiki\mediawiki-1.34.0\includes\debug\MWDebug.php on line 333

PHP  19. SyntaxHighlight::parserHook() C:\inetpub\wwwroot\wiki\mediawiki-1.34.0\includes\parser\Parser.php:4293

PHP  20. SyntaxHighlight::highlight() C:\inetpub\wwwroot\wiki\mediawiki-1.34.0\extensions\SyntaxHighlight_GeSHi\includes\SyntaxHighlight.php:117

PHP  21. wfWarn() C:\inetpub\wwwroot\wiki\mediawiki-1.34.0\extensions\SyntaxHighlight_GeSHi\includes\SyntaxHighlight.php:353

PHP  22. MWDebug::warning() C:\inetpub\wwwroot\wiki\mediawiki-1.34.0\includes\GlobalFunctions.php:1066

PHP  23. MWDebug::sendMessage() C:\inetpub\wwwroot\wiki\mediawiki-1.34.0\includes\debug\MWDebug.php:188

PHP  24. trigger_error() C:\inetpub\wwwroot\wiki\mediawiki-1.34.0\includes\debug\MWDebug.php:334


[ I needed to shorten the trace cause mediwaiki was complaining about "Flow spam filter: large amount of consonant/vowel clusters" ]

I saw a note in PHP's doc for popen:

Example #2 proc_open() quirk on Windows

While one may expect the following program to search the file filename.txt for the text search and to print the results, it behaves rather differently.

<?php
$descriptorspec = [STDIN, STDOUT, STDOUT];
$cmd = '"findstr" "search" "filename.txt"';
$proc = proc_open($cmd, $descriptorspec, $pipes);
proc_close($proc);
?>

The above example will output:

'findstr" "search" "filename.txt' is not recognized as an internal or external command,
operable program or batch file.

To work around that behavior, it is usually sufficient to enclose the cmd in additional quotes:

$cmd = '""findstr" "search" "filename.txt""';


But I don't think its true. The symptom is exactly what I saw, however the solution doesn't work.

46.232.228.6 (talkcontribs)

I finally got tired of this and sort of "fixed" it by changing the code in mediawiki-1.34.0\extensions\SyntaxHighlight_GeSHi\includes\SyntaxHighlight.php from

311 				$result = Shell::command(
312 					self::getPygmentizePath(),
313 					'-l', $lexer,
314 					'-f', 'html',
315 					'-O', implode( ',', $optionPairs )
316 				)
317 					->input( $code )
318 					->restrict( Shell::RESTRICT_DEFAULT | Shell::NO_NETWORK )
319 					->execute();
320 
321 				if ( $result->getExitCode() != 0 ) {
322 					$ttl = WANObjectCache::TTL_UNCACHEABLE;
323 					$error = $result->getStderr();
324 					return null;
325 				}
326                                 
327 				return $result->getStdout();

to:

                                $cmd = '"' . self::getPygmentizePath() . '" ' . 
				                    	'-l ' . '"' . $lexer . '" ' .
			                       		'-f ' . 'html ' . 
		                    			'-O ' . implode( ',', $optionPairs );
                                $filebase = @tempnam(wfTempDir(), "geshi");
                                $ioi = "$filebase-i.txt";
                                file_put_contents($ioi, $code);
                                $pyg = shell_exec("$cmd < \"$ioi\"");
                                if (false) {
                                    // debug, keep in/out put
                                    $ioo = "$filebase-o.txt";
                                    file_put_contents($ioo, $pyg);
                                } else {
                                    unlink($ioi);
                                }
                                return $pyg;

This is of course ugly to say the least but it works somehow and should be fine until a fix is there.

Let me add that I felt the Shell:: code to be overly complicated. However, I was perhaps just not fair cause it refused to work for me for so long ;-)

200.40.50.115 (talkcontribs)

Many thanks! that worked for me. Greetings

Check to the King (talkcontribs)

This fix also worked for me on Windows. Thank you!

How can we get this issue logged and fixed in the production code?

Eddi27L (talkcontribs)

I was just working on something similar, but now just made a copy&paste of your code and it works fine for me too, thanks.

PS: I too was overwhelmed by the complexity of Shell::code

MarkAHershberger (talkcontribs)

It looks like this might be task T193613. Four months later, I don't know why I wrote this. It must be a typo.

Berot3 (talkcontribs)

I have the same problem too... So what you are saying is that this error should disappear with mw 1.35?

MarkAHershberger (talkcontribs)

I'm not sure why I thought a stable interface policy would help. That must be a typo.

79.208.145.217 (talkcontribs)

I have exactly the same problem.

JGTompkins (talkcontribs)
Reply to "Migrating from 1.9.3 to 1.34 - Geshi no longer available"
2003:F4:D71C:4700:90B4:BC04:7744:60A7 (talkcontribs)

How can i backup my mediawiki localsetting.php and the content of the mediawiki? the mediawiki runs on a NAS box, but this should not be a problem.


MediaWiki version 1.31

2003:F4:D71C:4700:90B4:BC04:7744:60A7 (talkcontribs)

wie kann ich mein mediawiki localsetting.php und den Inhalt in regelmäßigen Abschnitten sichern? Das ganze läuft auf einer NAS Box mit der 1.31 Version, sollte aber kein Problem darstellen.

Ciencia Al Poder (talkcontribs)
Reply to "Mediawiki Backup"

Copy table rows from other pages

2
112.198.162.28 (talkcontribs)

I have tables in multiple pages and want to create a new table (in a different page) that automatically lists all rows with matching value in one column.

Example page 1:

2020-12-31 | NBA | Celtics | Lakers

2020-12-31 | NFL | Bears | Packers

2020-12-31 | MLB | Yankees | Red Sox

2020-12-31 | NHL | Islanders | Rangers

2020-12-31 | MLB | Mets | Phillies


Example page 2 (auto-generated table based on matching value in column 2):

2020-12-31 | MLB | Yankees | Red Sox

2020-12-31 | MLB | Mets | Phillies


I would appreciate if someone can just point me to what script/function/extension I need for this and I'll read up on the details.

Ciencia Al Poder (talkcontribs)
Reply to "Copy table rows from other pages"

Is string-searching possible?

5
Vis M (talkcontribs)

Is w:en:String-searching_algorithm possible with wiki? I need it to look for whether an input value given for a template contain the specific characters "[[" for wikilinking, so that the template can automatically remove extra brackets if they were manually added.

I am looking specifically for merging Clickable_buttons and similar templates that break with extra link brackets

PerfektesChaos (talkcontribs)
Vis M (talkcontribs)
PerfektesChaos (talkcontribs)

In this case you got the central point already.

I could recommend w:de:Wikipedia:Lua/Modul/WLink/en #getPlain which will have stripped off any link syntax.

However, you might fail to detect any {{ within template parameters since they have been resolved (expanded) already at the time the parameter value is passed to the receiving template. Supposed they have been properly balanced.

Vis M (talkcontribs)

Ok, thanks

Reply to "Is string-searching possible?"
Dossod11 (talkcontribs)

Installed MW 1.35/ SQL/ Server 2019.  Upgraded to BlueSpice.  BlueSpice came up.  Imported existing extensions/ modified the localsetting.php.  After SQL DB datadump import, the page errors out.


MediaWiki internal Error   …… DBQueryError …


I believe I need to run the update.php.


How do I run it exactly?

Reply to "update.php"
NGC 54 (talkcontribs)

I try to install MediaWiki 1.36.0, and I receive this error:

MediaWiki 1.36 internal error

Installing some PHP extensions is required.

Required components

You are missing a required extension to PHP that MediaWiki requires to run. Please install:

Malyacko (talkcontribs)

What is unclear with the error message and its instructions?

NGC 54 (talkcontribs)

What instructions? I have already installed MediaWiki 1.35.0 and 1.35.1, and I did not received this error.

Majavah (talkcontribs)

As noted in the MediaWiki 1.36 upgrade notes, 1.36 and newer require the php intl extension. What instructions? "You are missing a required extension to PHP that MediaWiki requires to run. Please install: intl".

NGC 54 (talkcontribs)
Malyacko (talkcontribs)

Which exact operating system is running on that machine?

NGC 54 (talkcontribs)

MediaWiki files are installed on my computer, that uses a version of Windows 10.

NGC 54 (talkcontribs)
NGC 54 (talkcontribs)
Jonathan3 (talkcontribs)

This is from my notes of setting up an Ubuntu 18.04 Digital Ocean VPS recently:

sudo apt install php-intl

I think after that you need:

sudo systemctl restart apache2

71.9.94.49 (talkcontribs)

Similar issue here, intl is installed, but WikiMedia does not recognize it as such. Extension is enabled in php.ini, extension dir is set correctly, other extension prerequisites that wikimedia reported run fine, but intl does not.

71.9.94.49 (talkcontribs)

Even though intl is installed, wikimedia reports the extension as missing. Does it need a default_locale?


intl

Internationalization support => enabled

ICU version => 68.1

ICU Data version => 68.1

ICU Unicode version => 13.0

Directive => Local Value => Master Value

intl.default_locale => no value => no value

intl.error_level => 2 => 2

intl.use_exceptions => Off => Off

Bawolff (talkcontribs)

check if its enabled on the webserver. Whether intl is enabled in commandline php is separate from if its enabled on the webserver.

Reply to "intl"