我最近将我的服务器从 Ubuntu 14.04 升级到 Ubuntu 16.04,但 phpmyadmin 版本仍然是 4.5,而我想安装 4.6(以支持新的 JSON 类型)。
我在网上找到的常见说明是通过 apt-add-repository 添加存储库nijel/phpmyadmin
,但这给了我一个奇怪的错误。
root@myserver:~# add-apt-repository ppa:nijel/phpmyadmin
Latest phpMyAdmin packages - https://www.phpmyadmin.net/. Based on packages available in Debian.
There are some notable changes:
* it currently requires updated PHP packages, you can get packages from https://launchpad.net/~ondrej/+archive/ubuntu/php/
* it does include embedded copies of PHP libraries
If you like phpMyAdmin, you can support it's further development at https://www.phpmyadmin.net/donate/ or https://www.phpmyadmin.net/sponsors/, thanks!
More info: https://launchpad.net/~nijel/+archive/ubuntu/phpmyadmin
Press [ENTER] to continue or ctrl-c to cancel adding it
gpg: keyring `/tmp/tmp9zj2r1n2/secring.gpg' created
gpg: keyring `/tmp/tmp9zj2r1n2/pubring.gpg' created
gpg: requesting key 06ED541C from hkp server keyserver.ubuntu.com
gpg: /tmp/tmp9zj2r1n2/trustdb.gpg: trustdb created
gpg: key 06ED541C: public key "Launchpad PPA for Michal \xc4\x8ciha\xc5\x99" imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python3.5/threading.py", line 914, in _bootstrap_inner
self.run()
File "/usr/lib/python3.5/threading.py", line 862, in run
self._target(*self._args, **self._kwargs)
File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 688, in addkey_func
func(**kwargs)
File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 401, in add_key
return apsk.add_ppa_signing_key()
File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 271, in add_ppa_signing_key
tmp_export_keyring, signing_key_fingerprint, tmp_keyring_dir):
File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 220, in _verify_fingerprint
got_fingerprints = self._get_fingerprints(keyring, keyring_dir)
File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 212, in _get_fingerprints
output = subprocess.check_output(cmd, universal_newlines=True)
File "/usr/lib/python3.5/subprocess.py", line 626, in check_output
**kwargs).stdout
File "/usr/lib/python3.5/subprocess.py", line 695, in run
stdout, stderr = process.communicate(input, timeout=timeout)
File "/usr/lib/python3.5/subprocess.py", line 1059, in communicate
stdout = self.stdout.read()
File "/usr/lib/python3.5/encodings/ascii.py", line 26, in decode
return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc4 in position 96: ordinal not in range(128)
这看起来像是 ppa 软件中的一个错误,但我不知道如何解决这个问题。
答案1
我找到了解决办法。显然这是系统本地化问题。我运行了
sudo locale-gen en_US.UTF-8
export LANG=en_US.UTF-8
并且 ppa 可以毫无问题地使用。
答案2
再试一次?可能已修复,因为我收到以下信息:
$ sudo add-apt-repository ppa:nijel/phpmyadmin
[sudo] password for rinzwind:
Latest phpMyAdmin packages - https://www.phpmyadmin.net/. Based on packages available in Debian.
There are some notable changes:
* it currently requires updated PHP packages, you can get packages from https://launchpad.net/~ondrej/+archive/ubuntu/php/
* it does include embedded copies of PHP libraries
If you like phpMyAdmin, you can support it's further development at https://www.phpmyadmin.net/donate/ or https://www.phpmyadmin.net/sponsors/, thanks!
More info: https://launchpad.net/~nijel/+archive/ubuntu/phpmyadmin
Press [ENTER] to continue or ctrl-c to cancel adding it
gpg: keybox '/tmp/tmpzsijcqvx/pubring.gpg' created
gpg: /tmp/tmpzsijcqvx/trustdb.gpg: trustdb created
gpg: key 80E7349A06ED541C: public key "Launchpad PPA for Michal Čihař" imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 1
gpg: imported: 1
OK
看到名字了吗?我得到的是 Čihař,而你得到的是 \xc4\x8ciha\xc5\x99。因此,这是非 ASCII 字符的编码/解码问题。
如果它不起作用,请在他的启动板页面上报告:https://launchpad.net/~nijel/+archive/ubuntu/phpmyadmin
答案3
针对您的问题,我添加了 PPA 并运行它以查看会发生什么。在运行它时,我确实收到了一堆错误消息。但随后 Ubuntu 软件更新自动弹出,我运行了它。它更新phpMyAdmin
为4.6.5.2deb1+deb.cihar.com~xenial.3
然而,这导致了以下警告:“配置中的秘密密码(blowfish_secret)太短。“
要解决该问题,您需要修改文件:/var/lib/phpmyadmin/blowfish_secret.inc.php.
<?php
// $cfg['blowfish_secret'] = 'U0v9kMkdKICvsc6NYgfqryAu';
// modified 1/7/2017
// http://serverfault.com/questions/615550/phpmyadmin-error-the-configuration-file-now-needs-a-secret-passphrase
$cfg['blowfish_secret'] = 'mrgQxxk8C-y}U7ji2BO9o5jLf}Qhe-BI[~6SUa';
phpMyAdmin 现在加载时没有任何警告消息。