Version:
- OS
lsb_release -a: Ubuntu 18.04.5 LTS - PHP
php -v: 8.0.1 - Apache
apache2 -v: 2.4.29 (Ubuntu) - MySQL
mysql --version: mysql Ver 14.14 Distrib 5.7.32
Problem:
I'm trying to install LAMP Stack using following article. However, I was getting HTTP 500 Error while accessing phpmyadmin from browser.
And installed phpmyadmin using below command.
sudo apt install phpmyadmin php-mbstring php-zip php-gd php-json php-curl
Tried :
So, I checked with Error Log tail -f /var/log/apache2/error.log and found that Phpmyadmin was running on depreciated version of PHP.
[Sat Jan 30 12:56:38.798871 2021] [php:error] [pid 17271] [client
103.25.169.179:28514] PHP Fatal error: Array and string offset access
syntax with curly braces is no longer supported in
/usr/share/phpmyadmin/libraries/Util.php on line 2087
[Sat Jan 30 12:56:38.798871 2021] [php:error] [pid 17271] [client 103.25.169.179:28514] PHP Fatal error: Uncaught ValueError:
mb_convert_encoding(): Argument #2 ($to_encoding) must be a valid
encoding, "" given in /usr/share/php/php-php-
gettext/gettext.inc:181\nStack trace:\n#0 /usr/share/php/php-php-
gettext/gettext.inc(181): mb_convert_encoding()\n#1 /usr/share/php/php-
php-gettext/gettext.inc(278): _encode()\n#2 /usr/share/php/php-php-
gettext/gettext.inc(285): _gettext()\n#3
/usr/share/phpmyadmin/libraries/sanitizing.lib.php(179): __()\n#4
/usr/share/phpmyadmin/libraries/Message.php(607): PMA_sanitize()\n#5
/usr/share/phpmyadmin/libraries/Message.php(672):
PMA\\libraries\\Message::decodeBB()\n#6
/usr/share/phpmyadmin/libraries/Error.php(220): PMA\\libraries\\Message-
>getMessage()\n#7 /usr/share/phpmyadmin/libraries/ErrorHandler.php(193):
PMA\\libraries\\Error->getHash()\n#8
/usr/share/phpmyadmin/libraries/ErrorHandler.php(156):
PMA\\libraries\\ErrorHandler->addError()\n#9 [internal function]:
PMA\\libraries\\ErrorHandler->handleError()\n#10
/usr/share/phpmyadmin/libraries/session.inc.php(133): ini_set()\n#11
/usr/share/phpmyadmin/libraries/common.inc.php(280): require('...')\n#12
/usr/share/phpmyadmin/index.php(13): require_once('...')\n#13 {main}\n
thrown in /usr/share/php/php-php-gettext/gettext.inc on line 181
- I'd solved Array and string offset access syntax error by removing
{ }with[ ] - Run the following command
sudo phpenmod mbstring
I'd solved Array and string offset access syntax error by removing { } with [ ]would solve anything. That's unrelated to your question though. No version of PHP 7 should be considered deprecated, php.net/supported-versions.php. Maybe you have 2 PHP versions running, one CLI and one browser? What error(s) did/doestail -f /var/log/apache2/error.loghave