在我的ubuntu 18远程服务器上将我的php升级到v8.1后,phpmyadmin返回500错误。检查日志我看到错误:
[Thu Jan 06 15:16:40.837918 2022] [mpm_prefork:notice] [pid 982] AH00163: Apache/2.4.29 (Ubuntu) OpenSSL/1.1.1i configured -- resuming normal operations
[Thu Jan 06 15:16:40.840520 2022] [core:notice] [pid 982] AH00094: Command line: '/usr/sbin/apache2'
[Thu Jan 06 15:17:08.538122 2022] [php:error] [pid 1015] [client 213.109.234.130:57510] PHP Fatal error: Array and string offset access syntax with curly braces is no longer supported in /usr/share/phpmyadmin/libraries/url_generating.lib.php on line 231
root@nsn-do-lamp:~# php -v
我用comnmands 升级了我的系统
sudo apt-get update
sudo apt-get upgrade
并重新沸腾。我现在有:
PHP 8.1.1 (cli) (built: Dec 31 2021 07:26:02) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.1, Copyright (c) Zend Technologies
with Zend OPcache v8.1.1, Copyright (c), by Zend Technologies
root@nsn-do-lamp:~# uname -a
Linux nsn-do-lamp 4.15.0-166-generic #174-Ubuntu SMP Wed Dec 8 19:07:44 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
root@nsn-do-lamp:~# lsb_release -d; uname -r; uname -i
Description: Ubuntu 18.04.5 LTS
4.15.0-166-generic
x86_64
# apt show phpmyadmin
Package: phpmyadmin
Version: 4:4.6.6-5ubuntu0.5
Priority: extra
Section: universe/web
Origin: Ubuntu
如果有办法修复这个错误?
谢谢!
这里最好的方法是删除ubuntu repos提供的phpMyAdmin(通过apt remove phpmyadmin
(,然后从https://www.phpmyadmin.net/downloads/因为它看起来不像4.6支持新的PHP
phpMyAdmin发行说明5.1.1根据https://www.phpmyadmin.net/files/5.1.1/