Topic on Project:Support desk

Updated to 1.28 today and i cannot get the SyntaxHighlight_GeSHi working

9
Summary by AhmadF.Cheema

Issue resolved by using external pygmentize binary.

50.106.19.97 (talkcontribs)

I used the 1.28.0 downloadable tar.gz file from the official download page.

I am running on FreeBSD 9.1-RELEASE-p3

The wiki is working normally after upgrade in that it shows all my pages, files, etc. However, all my highlights in bash, perl, python, etc. are showing up like <pre> sections instead of with colors like they normally did before the upgrade. Here is the output of my Version page:

Product Version
MediaWiki 1.28.0
PHP 5.6.27 (apache2handler)
MariaDB 10.0.27-MariaDB
ICU 58.1

Entry point URLs

Entry point URL
Article path /wiki/$1
Script path /w
index.php /w/index.php
api.php /w/api.php
load.php /w/load.php

Installed skins

Skin Version License Description Authors
MonoBook GPL-2.0+ The classic MediaWiki skin since 2004, named after the black-and-white photo of a book in the page background Gabriel Wicke and others

Installed extensions

Parser hooks
Extension Version License Description Authors
SyntaxHighlight 2.0 (65073ad)17:03, 24 October 2016 GPL-2.0+ Provides syntax highlighting <syntaxhighlight> using Pygments - Python syntax highlighter Brion Vibber, Tim Starling, Rob Church, Niklas Laxström, Ori Livneh and Ed Sanders

I have made sure the pygmentize binary is executable and i've run it myself with -V and got version 1.21 which is in the 1.28.0 mediawiki tar.gz.

Does anyone have any idea of anything I might have missed?

<syntaxhighlight lang="bash">

#!/usr/local/bin/bash

echo -ne "ada0 : " && smartctl -a /dev/ada0 | grep Temp | awk '{ print $10 }'

echo -ne "ada1 : " && smartctl -a /dev/ada1 | grep Temp | awk '{ print $10 }'

echo -ne "ada2 : " && smartctl -a /dev/ada2 | grep Temp | awk '{ print $10 }'

echo -ne "ada3 : " && smartctl -a /dev/ada3 | grep Temp | awk '{ print $10 }'

echo -ne "ada4 : " && smartctl -a /dev/ada4 | grep Temp | awk '{ print $10 }'

echo -ne "ada5 : " && smartctl -a /dev/ada5 | grep Temp | awk '{ print $10 }'

</syntaxhighlight>

RESULT:

#!/usr/local/bin/bash
echo -ne "ada0 : " && smartctl -a /dev/ada0 | grep Temp | awk '{ print $10 }'
echo -ne "ada1 : " && smartctl -a /dev/ada1 | grep Temp | awk '{ print $10 }'
echo -ne "ada2 : " && smartctl -a /dev/ada2 | grep Temp | awk '{ print $10 }'
echo -ne "ada3 : " && smartctl -a /dev/ada3 | grep Temp | awk '{ print $10 }'
echo -ne "ada4 : " && smartctl -a /dev/ada4 | grep Temp | awk '{ print $10 }'
echo -ne "ada5 : " && smartctl -a /dev/ada5 | grep Temp | awk '{ print $10 }'
58.164.108.250 (talkcontribs)

Check for any errors in the browser console, perhaps an error is preventing the styling from loading.

AhmadF.Cheema (talkcontribs)

You have made the pygmentize binary executable by "User" or "World"?

50.106.19.97 (talkcontribs)

It's world executable

AhmadF.Cheema (talkcontribs)

Try setting the rights to allow "User" to be able to execute too and then try again.

Octavianh (talkcontribs)

Here is the output of the permissions on the binary:

drwxr-xr-x  2 www  www       7 Nov 28 11:21 .

drwxr-xr-x  7 www  www      19 Nov 28 11:21 ..

-rw-r--r--  1 www  www    7326 Nov 28 11:21 AUTHORS

-rw-r--r--  1 www  www    1330 Nov 28 11:21 PYGMENTS_LICENSE

-rw-r--r--  1 www  www       4 Nov 28 11:21 VERSION

-rwxr-xr-x  1 www  www    1852 Nov 28 11:21 create_pygmentize_bundle

-rwxr-xr-x  1 www  www  754672 Nov 28 11:21 pygmentize

AhmadF.Cheema (talkcontribs)

These permissions should've worked, so the issue is probably somewhere else.

See this phabricator task opened for this bug, maybe you will find something here which helps.

Octavianh (talkcontribs)

i'm getting this error in debug:

[Preprocessor] Cached preprocessor output (key: wiki:preprocess-xml:6a88b2bdb1bee6bbf0a2a002f1d79c5d:0)

[error] [694ffd93e3aebc31d7e87cf8] /wiki/FreeBSD_arc_summary.pl   ErrorException from line 311 of /data/www/www/mediawiki/includes/debug/MWDebug.php: PHP Notice: Failed to invoke Pygments: env: python: No such file or directory

[Called from SyntaxHighlight_GeSHi::highlight in /data/www/www/mediawiki/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.class.php at line 296]

i verified and i have the following package installed:

py27-pygments-2.1.3

path:

-rwxr-xr-x  1 root  wheel  399 Nov 30 12:24 /usr/local/bin/pygmentize

what is the option to point to an external pygmentize binary in LocalSettings?

Octavianh (talkcontribs)

fixed, i used this:

$wgPygmentizePath = "/usr/local/bin/pygmentize";

This was quite the nightmare but it's working now.

thanks Ahmad.