'PHPMyAdmin not working as intended at remote server. Error 500, $respond not found
I am just starting my journey with servers so I bought one VPN. I installed there ubuntu 18, apache 2.4, php8, webmin, mysql etc. I have two sites based on symfony 5 hosted here without any problems. I installed PHPmyAdmin using Ubuntu PPA: https://github.com/phpmyadmin/phpmyadmin/wiki/DebianUbuntu#ubuntu-ppa
When I go to mysite.com/phpmyadmin everything is fine. I log in with credentials and I am logged in. It reads databases properly and renders all UI as it should, but then it throws error 500 Screenshot of PHPmyadmin
And it throws error in apache logs:
[Sun Oct 10 13:00:44.298896 2021] [proxy_fcgi:error] [pid 30370:tid 140207772845824] AH01071: Got error 'PHP message: PHP Fatal error: Uncaught Error: Unknown named parameter $$response in /usr/share/php/Symfony/Component/DependencyInjection/ContainerBuilder.php:1140\nStack trace:\n#0 /usr/share/php/Symfony/Component/DependencyInjection/ContainerBuilder.php(1140): ReflectionClass->newInstanceArgs()\n#1 /usr/share/php/Symfony/Component/DependencyInjection/ContainerBuilder.php(604): Symfony\\Component\\DependencyInjection\\ContainerBuilder->createService()\n#2 /usr/share/php/Symfony/Component/DependencyInjection/ContainerBuilder.php(569): Symfony\\Component\\DependencyInjection\\ContainerBuilder->doGet()\n#3 /usr/share/phpmyadmin/libraries/classes/Routing.php(186): Symfony\\Component\\DependencyInjection\\ContainerBuilder->get()\n#4 /usr/share/phpmyadmin/index.php(18): PhpMyAdmin\\Routing::callControllerForRoute()\n#5 {main}\n thrown in /usr/share/php/Symfony/Component/DependencyInjection/ContainerBuilder.php on line 1140'
[Sun Oct 10 13:00:44.359963 2021] [proxy_fcgi:error] [pid 30369:tid 140207873558272] AH01071: Got error 'PHP message: PHP Fatal error: Uncaught Error: Unknown named parameter $$response in /usr/share/php/Symfony/Component/DependencyInjection/ContainerBuilder.php:1140\nStack trace:\n#0 /usr/share/php/Symfony/Component/DependencyInjection/ContainerBuilder.php(1140): ReflectionClass->newInstanceArgs()\n#1 /usr/share/php/Symfony/Component/DependencyInjection/ContainerBuilder.php(604): Symfony\\Component\\DependencyInjection\\ContainerBuilder->createService()\n#2 /usr/share/php/Symfony/Component/DependencyInjection/ContainerBuilder.php(569): Symfony\\Component\\DependencyInjection\\ContainerBuilder->doGet()\n#3 /usr/share/phpmyadmin/libraries/classes/Routing.php(186): Symfony\\Component\\DependencyInjection\\ContainerBuilder->get()\n#4 /usr/share/phpmyadmin/index.php(18): PhpMyAdmin\\Routing::callControllerForRoute()\n#5 {main}\n thrown in /usr/share/php/Symfony/Component/DependencyInjection/ContainerBuilder.php on line 1140'
[Sun Oct 10 13:00:44.411282 2021] [proxy_fcgi:error] [pid 30370:tid 140207898736384] AH01071: Got error 'PHP message: PHP Fatal error: Uncaught Error: Unknown named parameter $$response in /usr/share/php/Symfony/Component/DependencyInjection/ContainerBuilder.php:1140\nStack trace:\n#0 /usr/share/php/Symfony/Component/DependencyInjection/ContainerBuilder.php(1140): ReflectionClass->newInstanceArgs()\n#1 /usr/share/php/Symfony/Component/DependencyInjection/ContainerBuilder.php(604): Symfony\\Component\\DependencyInjection\\ContainerBuilder->createService()\n#2 /usr/share/php/Symfony/Component/DependencyInjection/ContainerBuilder.php(569): Symfony\\Component\\DependencyInjection\\ContainerBuilder->doGet()\n#3 /usr/share/phpmyadmin/libraries/classes/Routing.php(186): Symfony\\Component\\DependencyInjection\\ContainerBuilder->get()\n#4 /usr/share/phpmyadmin/index.php(18): PhpMyAdmin\\Routing::callControllerForRoute()\n#5 {main}\n thrown in /usr/share/php/Symfony/Component/DependencyInjection/ContainerBuilder.php on line 1140'
[Sun Oct 10 13:14:58.028291 2021] [proxy_fcgi:error] [pid 30369:tid 140207798023936] AH01071: Got error 'PHP message: PHP Fatal error: Uncaught Error: Unknown named parameter $$response in /usr/share/php/Symfony/Component/DependencyInjection/ContainerBuilder.php:1140\nStack trace:\n#0 /usr/share/php/Symfony/Component/DependencyInjection/ContainerBuilder.php(1140): ReflectionClass->newInstanceArgs()\n#1 /usr/share/php/Symfony/Component/DependencyInjection/ContainerBuilder.php(604): Symfony\\Component\\DependencyInjection\\ContainerBuilder->createService()\n#2 /usr/share/php/Symfony/Component/DependencyInjection/ContainerBuilder.php(569): Symfony\\Component\\DependencyInjection\\ContainerBuilder->doGet()\n#3 /usr/share/phpmyadmin/libraries/classes/Routing.php(186): Symfony\\Component\\DependencyInjection\\ContainerBuilder->get()\n#4 /usr/share/phpmyadmin/index.php(18): PhpMyAdmin\\Routing::callControllerForRoute()\n#5 {main}\n thrown in /usr/share/php/Symfony/Component/DependencyInjection/ContainerBuilder.php on line 1140'
I have no idea what is wrong.
Solution 1:[1]
It is a bug / incompatibility in one of phpmyadmin dependencies - symfony dependency injection componenet and ubuntu package.
issue for ubuntu:
https://bugs.launchpad.net/ubuntu/+source/symfony/+bug/1932552
symfony issue:
https://github.com/symfony/symfony/commit/8e34978e4e2c4bf7dac97e44e904368c4cfb54f8
phpmyadmin isseue stating they cannot do anything:https://github.com/phpmyadmin/phpmyadmin/issues/16968#issuecomment-864088274
Tldr: Try udpating your dependecies, possiblity changing repositories in ubnutu or wait until fix is distributed.
apt-get update && apt-get upgrade -y
You can also downgrade your phpmyadmin version (not sure if it will help as it can be tied to php8.0 version)
Solution 2:[2]
Thanks to @nakashu I found solution.
According to symfony issue he linked: https://github.com/symfony/symfony/commit/8e34978e4e2c4bf7dac97e44e904368c4cfb54f8
I know it is only temporal solution but I replaced code in /usr/share/php/Symfony/Component/DependencyInjection/ContainerBuilder.php:1140
I changed:
$service = null === $r->getConstructor() ? $r->newInstance() : $r->newInstanceArgs($arguments);
to:
$service = null === $r->getConstructor() ? $r->newInstance() : $r->newInstanceArgs(array_values($arguments));
Now phpMyAdmin is working.
Solution 3:[3]
in nginx settings file switch php version from fastcgi_pass unix:/var/run/php/php7.1-fpm.sock; on the fastcgi_pass unix:/var/run/php/php8.1-fpm.sock;
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | |
Solution 2 | Furoris |
Solution 3 | INDIGO |