Mailing List Archive

M.W. 1.34.4 VS SyntaxHighlight 2.0 on Linux
Hi All,

I have recently upgraded mediawiki to version 1.34.4 (from 1.24) in a
fresh directory and found that SyntaxHighlight extension is not working
well.

There is no color applied for all the langs I tried (especialy ksh
one).

I guess there is a link with the Python version used.

Both Python V2.7.9 and V3.4.2 are available on the server.

Her are the specs :

OS: Linux Distribution

Hosting: OVH Shared hosting

PHP version: 7.3.20 (cgi-fcgi)

Mediawiki version: 1.34.4

SyntaxHighlight: 2.0 (embended)


Does anybody have a clue ?


Regards

_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Re: M.W. 1.34.4 VS SyntaxHighlight 2.0 on Linux [ In reply to ]
Does the path to Python3 show up in the path for PHP (phpinfo)?
the python3 binary must be installed in the execution PATH of the PHP
interpreter.

Also, if you installed from git, did you run composer in the extension
directory (mediawiki/extensions/SyntaxHighlight_GeSHi)?
run Composer <https://www.mediawiki.org/wiki/Special:MyLanguage/Composer> to
install PHP dependencies, by issuing composer install --no-dev in the
extension directory.

~ Greg

eQuality Technology

*Let's work together*

https://equality-tech.com
follow us: https://twitter.com/eQualityTech
*creators of https://QualityBox.us <https://QualityBox.us> *


On Tue, Oct 6, 2020 at 3:24 PM NL <mediawiki.org@faiscommechezmoi.org>
wrote:

> Hi All,
>
> I have recently upgraded mediawiki to version 1.34.4 (from 1.24) in a
> fresh directory and found that SyntaxHighlight extension is not working
> well.
>
> There is no color applied for all the langs I tried (especialy ksh
> one).
>
> I guess there is a link with the Python version used.
>
> Both Python V2.7.9 and V3.4.2 are available on the server.
>
> Her are the specs :
>
> OS: Linux Distribution
>
> Hosting: OVH Shared hosting
>
> PHP version: 7.3.20 (cgi-fcgi)
>
> Mediawiki version: 1.34.4
>
> SyntaxHighlight: 2.0 (embended)
>
>
> Does anybody have a clue ?
>
>
> Regards
>
> _______________________________________________
> MediaWiki-l mailing list
> To unsubscribe, go to:
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>
Re: M.W. 1.34.4 VS SyntaxHighlight 2.0 on Linux [ In reply to ]
I tried to check this.
phpinfo gave me no info with 'python'.

Ther is many paths in the list and I don't know wich one is to verify.

The extention is the one which bundled with M.W.; so no need to run
composer ?



Thank you for helping.

N.L.



Le 2020-10-06 22:38, eQuality Technology a écrit :
> Does the path to Python3 show up in the path for PHP (phpinfo)?
>  the python3 binary must be installed in the execution PATH of the
> PHP interpreter.
>
> Also, if you installed from git, did you run composer in the
> extension
> directory (mediawiki/extensions/SyntaxHighlight_GeSHi)?
> run Composer [2] to install PHP dependencies, by issuing composer
> install --no-dev in the extension directory.
>
> ~ Greg
>
> eQuality Technology
>
> _Lets work together_
>
> https://equality-tech.com [3]
> follow us: https://twitter.com/eQualityTech [4]
> CREATORS OF  
>
> On Tue, Oct 6, 2020 at 3:24 PM NL <mediawiki.org@faiscommechezmoi.org
> [5]> wrote:
>
>> Hi All,
>>
>> I have recently upgraded mediawiki to version 1.34.4 (from 1.24) in
>> a
>> fresh directory and found that SyntaxHighlight extension is not
>> working
>> well.
>>
>> There is no color applied for all the langs I tried (especialy ksh
>> one).
>>
>> I guess there is a link with the Python version used.
>>
>> Both Python V2.7.9 and V3.4.2 are available on the server.
>>
>> Her are the specs :
>>
>> OS: Linux Distribution
>>
>> Hosting: OVH Shared hosting
>>
>> PHP version: 7.3.20 (cgi-fcgi)
>>
>> Mediawiki version: 1.34.4
>>
>> SyntaxHighlight: 2.0 (embended)
>>
>> Does anybody have a clue ?
>>
>> Regards
>>
>> _______________________________________________
>> MediaWiki-l mailing list
>> To unsubscribe, go to:
>> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l [1]
>
>
> Links:
> ------
> [1] https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
> [2] https://www.mediawiki.org/wiki/Special:MyLanguage/Composer
> [3] https://equality-tech.com/
> [4] https://twitter.com/eQualityTech
> [5] mailto:mediawiki.org@faiscommechezmoi.org


_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Re: M.W. 1.34.4 VS SyntaxHighlight 2.0 on Linux [ In reply to ]
On Wed, Oct 7, 2020 at 3:58 AM NL <mediawiki.org@faiscommechezmoi.org>
wrote:

>
>
> I tried to check this.
> phpinfo gave me no info with 'python'.
>
> Ther is many paths in the list and I don't know wich one is to verify.
>
>
In all likelihood, the path to python is in the 'PATH' for PHP. An easy
way to check is to
php -i | grep PATH
And look for '/usr/bin' in the output.

E.g.
NODE_PATH => :/usr/local/lib/npm/lib/node_modules
PATH => /usr/local/lib/npm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:
*/usr/bin*:/sbin:/bin
$_SERVER['NODE_PATH'] => :/usr/local/lib/npm/lib/node_modules
$_SERVER['PATH'] =>
/usr/local/lib/npm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

$_SERVER['PATH_TRANSLATED'] =>


The extention is the one which bundled with M.W.; so no need to run
> composer ?


Correct. If you installed by downloading the tarball, you have all the
dependencies you need.

Your issue probably stems from the default Python being used.

Check the version of the default Python interpreter: python --version

List the versions of python available: ls /usr/bin/python*

(As 'root' or using 'sudo') Use update-alternatives to setup system-wide
ability to choose Python interpreter. The one with the *higher* priority
number will become the default.
update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1
update-alternatives --install /usr/bin/python python /usr/bin/python3.6 *2*

Now we can list the choices: update-alternatives --list python

And choose one: update-alternatives --config python

At this point, you should have successfully changed your default Python
interpreter to 3.x

Note: we can also remove a choice if it's no longer an option on the
system: update-alternatives --remove python /usr/bin/python2.7


Now your syntax highlighting should work (using Python3).


~ Greg

eQuality Technology

*Let's work together*

https://equality-tech.com
follow us: https://twitter.com/eQualityTech
*creators of https://QualityBox.us <https://QualityBox.us> *
Re: M.W. 1.34.4 VS SyntaxHighlight 2.0 on Linux [ In reply to ]
Here are the results of identified commands :

$ php -i | grep -i PATH |grep -i usr
Configure Command => './configure' '--with-openssl'
'--with-mysqli=mysqlnd' '--with-pdo-mysql=mysqlnd'
'--prefix=/usr/local/php7.3' '--enable-fpm' '--enable-memcached'
'--enable-opcache' '--enable-redis' '--with-gd' '--enable-intl'
'--with-png-dir=/usr' '--enable-wddx'
'--with-config-file-path=/usr/local/php7.3/etc' '--enable-sigchild'
'--enable-short-tags' '--disable-rpath' '--enable-libgcc'
'--with-zlib=/usr' '--enable-bcmath' '--enable-calendar'
'--with-curl=/usr' '--with-gdbm=/usr' '--enable-ftp'
'--with-gettext=/usr' '--with-imap' '--with-kerberos' '--with-imap-ssl'
'--with-mhash=/usr' '--with-jpeg-dir=/usr' '--enable-exif'
'--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--enable-zip'
'--enable-inline-optimization' '--enable-soap' '--enable-mbstring'
'--enable-mbregex' '--with-gnu-ld' '--with-libxml-dir'
'--enable-shared=yes' '--enable-static=yes' '--with-xsl=/usr'
'--enable-sockets' '--with-xmlrpc' '--with-iconv' '--with-imagick'
'--enable-pdo' '--with-pdo-pgsql=/usr' '--enable-mongodb'
'--with-xpm-dir=/usr' '--with-pcre-regex' '--enable-freetype'
'--with-pspell' '--with-pgsql=/usr' '--with-bz2' '--with-gmp'
'--with-sodium=/home/pkg/src/sodium-i386/usr' '--with-password-argon2'
'--with-webp-dir=/usr'
'EXTENSION_DIR=/usr/local/php7.3/lib/php-extensions'
Configuration File (php.ini) Path => /usr/local/php7.3/etc
include_path => .:/usr/local/php7.3/lib/php =>
.:/usr/local/php7.3/lib/php
sendmail_path => /usr/sbin/sendmail -t -i => /usr/sbin/sendmail -t -i
Path to sendmail => /usr/sbin/sendmail -t -i


$ python --version
Python 2.7.9


$ python3 -V
Python 3.4.2


The fact is that the server is a shared hosting server, so I can not
sudo, some directories and binaries are not accessible ...

N.L.


Le 2020-10-07 14:58, eQuality Technology a écrit :
> On Wed, Oct 7, 2020 at 3:58 AM NL <mediawiki.org@faiscommechezmoi.org
> [1]> wrote:
>
>> I tried to check this.
>> phpinfo gave me no info with python.
>>
>> Ther is many paths in the list and I dont know wich one is to
>> verify.
>
>  
> In all likelihood, the path to python is in the PATH for PHP.  An
> easy way to check is to 
> php -i | grep PATH
>
> And look for /usr/bin in the output.
>
> E.g. 
> NODE_PATH => :/usr/local/lib/npm/lib/node_modules
> PATH =>
>
> /usr/local/lib/npm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/USR/BIN:/sbin:/bin
>
> $_SERVER[NODE_PATH] => :/usr/local/lib/npm/lib/node_modules
> $_SERVER[PATH] =>
>
> /usr/local/lib/npm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
>
> $_SERVER[PATH_TRANSLATED] =>
>
>> The extention is the one which bundled with M.W.; so no need to run
>> composer ?
>
> Correct. If you installed by downloading the tarball, you have all
> the
> dependencies you need. 
>
> Your issue probably stems from the default Python being used.
>
> Check the version of the default Python interpreter: python --version
>
> List the versions of python available: ls /usr/bin/python*
>
> (As root or using sudo) Use update-alternatives to setup system-wide
> ability to choose Python interpreter. The one with
> the HIGHER priority number will become the default.
> update-alternatives --install /usr/bin/python python
> /usr/bin/python2.7 1
> update-alternatives --install /usr/bin/python python
> /usr/bin/python3.6 2
>
> Now we can list the choices: update-alternatives --list python
>
> And choose one: update-alternatives --config python
>
> At this point, you should have successfully changed your default
> Python interpreter to 3.x
>
> Note: we can also remove a choice if its no longer an option on the
> system: update-alternatives --remove python /usr/bin/python2.7
>
> Now your syntax highlighting should work (using Python3).
>
> ~ Greg
>
> eQuality Technology
>
> _Lets work together_
>
> https://equality-tech.com [2]
> follow us: https://twitter.com/eQualityTech [3]
> CREATORS OF  
>
> Links:
> ------
> [1] mailto:mediawiki.org@faiscommechezmoi.org
> [2] https://equality-tech.com/
> [3] https://twitter.com/eQualityTech


_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Re: M.W. 1.34.4 VS SyntaxHighlight 2.0 on Linux [ In reply to ]
>
> $ python --version
> Python 2.7.9
>
>
> $ python3 -V
> Python 3.4.2
>
>
> The fact is that the server is a shared hosting server, so I can not
> sudo, some directories and binaries are not accessible ...
>
>
You'll need to contact your web host and ask them to set your default
Python to python3

~ Greg
Re: M.W. 1.34.4 VS SyntaxHighlight 2.0 on Linux [ In reply to ]
Hello Greg,

My web host told me that since the server is a shared one, the python
version pour PHP is not customizable and is 2.7.13
I'll wait a futur upgrade on the server ...

Thank you for your help :)

N.




Le 2020-10-08 17:12, eQuality Technology a écrit :
>> $ python --version
>> Python 2.7.9
>>
>> $ python3 -V
>> Python 3.4.2
>>
>> The fact is that the server is a shared hosting server, so I can
>> not
>> sudo, some directories and binaries are not accessible ...
>
> Youll need to contact your web host and ask them to set your default
> Python to python3
>
> ~ Greg


_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l