phpmyadmin为什么在将Ubuntu升级到22.04之后停止工作?
刚刚升级到Ubuntu 22.04,现在我的phpadmin不会加载。我得到以下错误
解析错误:语法错误,/usr/share/php/symfony/component/depparentynoction/containerbuilder.php in/usr/share/php/symfony/component.php in/usr/share/php/symfony/component.php in 272
>
解析错误:语法错误,/usr/share/php/symfony/component/component/depparencyindoction/containerbuilder.php in /usr/share/php/symfony/componty.php
public function addResource(ResourceInterface $resource): static
{
if (!$this->trackResources) {
return $this;
}
if ($resource instanceof GlobResource && $this->inVendors($resource->getPrefix())) {
return $this;
}
$this->resources[(string) $resource] = $resource;
return $this;
}
昨天升级之前,一切都很好。有人有任何建议吗?
Just upgraded to Ubuntu 22.04 and now my phpadmin won't load. I get this following error
Parse error: syntax error, unexpected 'static' (T_STATIC) in /usr/share/php/Symfony/Component/DependencyInjection/ContainerBuilder.php on line 272
I opened up the file, and here is the specific code in that segment.
public function addResource(ResourceInterface $resource): static
{
if (!$this->trackResources) {
return $this;
}
if ($resource instanceof GlobResource && $this->inVendors($resource->getPrefix())) {
return $this;
}
$this->resources[(string) $resource] = $resource;
return $this;
}
Yesterday before the upgrade, everything was working fine. Does anybody have any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
我正在使用PHP7.4.30,我的修复程序正在升级PhpMyAdmin。
这是一个简单的指南:
I'm using php7.4.30 and my fix was upgrading phpMyAdmin.
Here is a simple guide:
https://devanswers.co/manually-upgrade-phpmyadmin/
由于版本8.0,PHP允许
static
作为类方法的返回类型。显然,您的PHP版本已降级。Since version 8.0, PHP allows
static
as a return type for class methods. Apparently your PHP version was downgraded.是的,如果您在8点之前运行PHP版本,例如7.**。
在此处下载5.2并安装它。
https://www.phpmyadmin.net/downloads/”
< a href =“ 您在哪里安装它(取决于您的Web服务器)。那个符号组件破坏了一切(第272行)。
Yes, it's a pain if you are running a PHP version prior to 8, such as 7.*.
Download 5.2 here and install it.
https://www.phpmyadmin.net/downloads/
Completely purge your previous version and secure the directory where you install it (depends on your web server). That Symfony component ruined everything (line 272).
最后,重新启动Apache:
at the end, restart apache:
您必须在PHP 8中查看PHPMYADMIN版本COZ。*版本PhpMyAdmin 5.*将需要版本。
You have to check your phpmyadmin version Coz in php 8.* version phpmyadmin 5.* version will be required.
检查当前正在运行的PHP版本
php -v
。您需要PHP 8.3。如果有的话,请启用PHP模式8.3
sudo a2enmod php8.3
并禁用当前的php模式saysudo a2dismod php7.4
然后重新启动apache
sudo systemctl restart restart restart apache2
导航到
/etc/apache2/mods-abailable
以验证更改。然后测试以访问phpmyadminCheck the php version currently running
php -v
.you need php 8.3. If you have it, enable the php mode 8.3
sudo a2enmod php8.3
and disable the current php mode saysudo a2dismod php7.4
then restart apache
sudo systemctl restart apache2
navigate to
/etc/apache2/mods-available
to verify the changes. then test to access phpmyadmin