GNU social にアクセスするとなにも表示されなくなって困る


さっきまでは動いていたのにウェブブラウザ(qutebrowser)のバージョンアップに追従するために再起動して,自分用 GNU social にアクセスすると画面が真っ白です><

$config['site']['logfile'] に指定しているログファイルを確認するとこんなメッセージがありました.

2019-03-22 14:35:28 LOG_DEBUG: [ GET /] action.php - Server error '500' on 'qvitter': Class 'Locale' not found
2019-03-22 14:35:28 LOG_ERR: [ GET /] Handled serverError (500) but cannot output into desired format (NULL): 'Class \'Locale\' not found'
2019-03-22 14:35:28 LOG_ERR: [ GET /] ServerErrorAction: 500 Class 'Locale' not found


$ find plugins/Qvitter -type f -print0 | xargs -0 grep -n Locale
plugins/Qvitter/actions/qvitter.php:341:                    window.usersLanguageNameInEnglish = <?php print json_encode(Locale::getDisplayLanguage($user_browser_language, 'en')) ?>;
plugins/Qvitter/actions/qvitter.php:462:                                                $languagecodesandnames[$lancode]['english_name'] = Locale::getDisplayName($lancode, 'en');
plugins/Qvitter/actions/qvitter.php:463:                                                $languagecodesandnames[$lancode]['name'] = Locale::getDisplayName($lancode, $lancode);


それらしいpackage を探して,

$ apt-cache search ^php international
php-horde-idna - IDNA backend normalization package
php-horde-ingo - An email filter rules manager
php-intl - Internationalisation module for PHP [default]
php-net-idna2 - PHP Pear module for handling international domain names
php-symfony-translation - tools to internationalize an application
php7.2-intl - Internationalisation module for PHP
phpmyadmin - MySQL web administration tool
php7.0-intl - Internationalisation module for PHP
$ apt show php-intl
Package: php-intl
Version: 1:7.2+60ubuntu1
Priority: optional
Section: universe/php
Source: php-defaults (60ubuntu1)
Origin: Ubuntu
Maintainer: Ubuntu Developers <>
Original-Maintainer: Debian PHP Maintainers <>
Installed-Size: 12.3 kB
Depends: php-common, php7.2-intl
Download-Size: 2,012 B
APT-Sources: bionic/universe amd64 Packages
Description: Internationalisation module for PHP [default]
 This package provides a Internationalisation module for PHP.
 PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used
 open source general-purpose scripting language that is especially suited
 for web development and can be embedded into HTML.
 This package is a dependency package, which depends on Ubuntu's default
 PHP version (currently 7.2).


sudo apt-get install php7.2-intl

恐らく php のバージョンを上げたときに漏れてしまい,API などは問題なく使えていたのでウェブブラウザを再起動するまで気づかなかった感じのようです.

しかし,GNU social はこういう警告をよく見かけるのでどうにかしないといけないですね.開発は滞っている感じなので Pleroma あたりに移行するのがいいんでしょうが…….

this will throw an Error in a future version of PHP


$ dpkg-query -W php7.2-intl
php7.2-intl     7.2.15-0ubuntu0.18.04.1
$ w3m -dump|jq .software
  "name": "gnusocial",
  "version": "1.2.0-beta5"
$ lsb_release -d
Description:    Ubuntu 18.04.2 LTS
$ uname -m

Debian stretch で php5 / php7.0 を切り替え

update-alternatives で OK かなと思ったのですが,

$ sudo update-alternatives --config php
There are 2 choices for the alternative php (providing /usr/bin/php).

  Selection    Path             Priority   Status


* 0            /usr/bin/php7.0   70        auto mode
  1            /usr/bin/php5     50        manual mode
  2            /usr/bin/php7.0   70        manual mode
  Press <enter> to keep the current choice[*], or type selection number: 0
$ php -v
PHP 7.0.30-0+deb9u1 (cli) (built: Jun 14 2018 13:50:25) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
    with Zend OPcache v7.0.30-0+deb9u1, Copyright (c) 1999-2017, by Zend Technologies

apache では php5 のままです.

$ w3m -dump http://localhost/phpinfo.php|grep -m1 'PHP Version'
PHP Version 5.6.30-0+deb8u1

apache module を切り替えたらokでした.

$ sudo a2dismod php5
$ sudo a2enmod php7.0
$ systemctl restart apache2
$ dpkg-query -W apache2 php5 libapache2-mod-php5 php7.0 libapache2-mod-php7.0
apache2 2.4.25-3+deb9u5
libapache2-mod-php5     5.6.30+dfsg-0+deb8u1
libapache2-mod-php7.0   7.0.30-0+deb9u1
php5    5.6.30+dfsg-0+deb8u1
php7.0  7.0.30-0+deb9u1
$ lsb_release -d
Description:    Debian GNU/Linux 9.5 (stretch)
$ uname -m