【问题标题】:"Call to undefined function trailingslashit()" wordpress PHP fatal error when trying to update plugins\"Call to undefined function trailingslashit()\" 尝试更新插件时出现 wordpress PHP 致命错误
【发布时间】:2022-12-12 16:03:41
【问题描述】:

我们在提供商 wpengine 上安装了 wordpress。当我们尝试更新一些插件时,我们在主题中遇到了致命的 PHP 错误。提供商支持不知道如何帮助我们。这是错误的调用堆栈:

“PHP 致命错误:未捕获错误:调用 /nas/content/live/sillaindustrie/wp-includes/class-wp-textdomain-registry.php:103\n堆栈跟踪:\n#0 /nas 中的未定义函数 trailingslashit() /content/live/sillaindustrie/wp-includes/l10n.php(784): WP_Textdomain_Registry->set('default', 'it_IT', '/nas/content/li...')\n#1 /nas/内容/live/sillaindustrie/wp-includes/load.php(1401): load_textdomain('default', '/nas/content/li...', 'it_IT')\n#2 /nas/content/live/ sillaindustrie/wp-includes/load.php(278): wp_load_translations_early()\n#3 /nas/content/live/sillaindustrie/wp-settings.php(74): wp_maintenance()\n#4 /nas/content/现场/sillaindustrie/wp-config.php(67): require_once('/nas/content/li...')\n#5 /nas/content/live/sillaindustrie/wp-load.php(50): require_once ('/nas/content/li...')\n#6 /nas/content/live/sillaindustrie/wp-blog-header.php(13): require_once('/nas/content/li...' )\n#7 /nas/content/live/sillaindustrie/index.php(17): require('/nas/content/li...')\n#8 {main}\n 扔进 /nas/content /生活e/sillaindustrie/wp-includes/class-wp-textdomain-registry.php 第 103 行,referer:https://silla.industries/wp-admin/update-core.php?action=do-plugin-upgrade"

它似乎与 WPML 插件或类似插件有关,有什么建议吗? 谢谢 G。

我试图更新 wordpress 插件,但我无法理解错误的来源。也许是插件不兼容,但我不知道如何发现它。

【问题讨论】:

  • 您可能需要检查您是否有:wp-includes/formatting.php,它定义了trailingslashit(),由WP_Textdomain_Registry::set()使用(在第 103 行调用)。如果需要,您可以在wp developer resources研究细节
  • 我查了一下,我找到了

标签: php wordpress plugins


【解决方案1】:

检查你是否安装了 php-psr。 我有这个错误,因为我没有安装 php8.1-psr

【讨论】:

  • 谢谢你的建议。我在哪里可以检查?
  • 我怀疑您必须与您的托管公司联系。如果你有 shell / SSH 访问权限,那么你将运行类似: sudo apt get install php-psr 注意:这假设你正在运行 Ubuntu / Debian
【解决方案2】:

看起来 formatting.php 函数在更新时不再可用。

【讨论】:

  • 您的答案可以通过其他支持信息得到改进。请edit 添加更多详细信息,例如引用或文档,以便其他人可以确认您的答案是正确的。你可以找到更多关于如何写出好的答案的信息in the help center
【解决方案3】:

更新:我发现一个用户有类似的问题,他通过删除 wp_includes 文件夹然后通过 FTP 重新上传来解决。我也试过:在暂存环境中它工作但在生产中更新任何插件后仍然出现错误:(

【讨论】:

    【解决方案4】:

    更新:我发现可能与 TikTok 插件不兼容,但我不确定。事实上,在一些运行良好的更新之后,问题又回来了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-11-01
      • 2016-06-14
      • 2022-12-02
      • 1970-01-01
      • 2013-06-19
      • 1970-01-01
      相关资源
      最近更新 更多