Home > Blockchain >  Upgrading php to v8.1 on ubuntu 18 remote server phpmyadmin returns 500 error
Upgrading php to v8.1 on ubuntu 18 remote server phpmyadmin returns 500 error

Time:01-08

After upgrading my php to v8.1 on my ubuntu 18 remote server phpmyadmin returns 500 error. Checking logs I see error :

[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

I upgraded my system with comnmands

sudo apt-get update
sudo apt-get upgrade

and reboted. I have now :

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

If there is a way to fix this error ?

Thanks!

CodePudding user response:

the best way here would be to drop the phpMyAdmin provided by ubuntu repos (via apt remove phpmyadmin) and install 5.1.X from https://www.phpmyadmin.net/downloads/ because it doesn't look like 4.6 supports that new PHP

phpMyAdmin release notes 5.1.1 has support for 8.1 according to https://www.phpmyadmin.net/files/5.1.1/

  •  Tags:  
  • Related