phpmyadmin为什么在将Ubuntu升级到22.04之后停止工作?

发布于 2025-01-25 04:34:03 字数 790 浏览 5 评论 0原文

刚刚升级到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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

屋檐 2025-02-01 04:34:03

我正在使用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/

無處可尋 2025-02-01 04:34:03

由于版本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.

辞取 2025-02-01 04:34:03

是的,如果您在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).

唱一曲作罢 2025-02-01 04:34:03
  • 升级PHP到
  • Apache中的8.x开关PHP版本:
cd /etc/apache2/mods-enabled/
sudo rm php7.4.conf
sudo rm php7.4.load
sudo ln -s ../mods-available/php8.0.load php8.0.load
sudo ln -s ../mods-available/php8.0.conf php8.0.conf

最后,重新启动Apache:

sudo /etc/init.d/apache2 restart
  • upgrade php to 8.x
  • switch php version in apache:
cd /etc/apache2/mods-enabled/
sudo rm php7.4.conf
sudo rm php7.4.load
sudo ln -s ../mods-available/php8.0.load php8.0.load
sudo ln -s ../mods-available/php8.0.conf php8.0.conf

at the end, restart apache:

sudo /etc/init.d/apache2 restart
岁月无声 2025-02-01 04:34:03

您必须在PHP 8中查看PHPMYADMIN版本COZ。*版本PhpMyAdmin 5.*将需要版本。

You have to check your phpmyadmin version Coz in php 8.* version phpmyadmin 5.* version will be required.

著墨染雨君画夕 2025-02-01 04:34:03

检查当前正在运行的PHP版本
php -v

您需要PHP 8.3。如果有的话,请启用PHP模式8.3 sudo a2enmod php8.3并禁用当前的php模式say sudo a2dismod php7.4

然后重新启动apache sudo systemctl restart restart restart apache2

导航到/etc/apache2/mods-abailable以验证更改。然后测试以访问phpmyadmin

Check 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 say sudo 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文