首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >调用未定义函数create_function

调用未定义函数create_function
EN

Stack Overflow用户
提问于 2022-06-11 14:17:45
回答 2查看 10.5K关注 0票数 7

我试图激活一个已安装的插件,但我得到了这个错误。我不能再打开这个网站了。我重新启动计算机并加载localhost URL,得到以下相同的错误:

C:\xampp\htdocs\university\wp-content\plugins\full-site-builder-for-elementor\extensions\google-maps\google-maps.php:136堆栈跟踪中未定义函数create_function()的调用:#0 C:\xampp\htdocs\university\wp-content\plugins\full-site-builder-for-elementor\extensions\google-maps\google-maps.php(441):stylepress_dtbaker_Shortcode_Google_Map->init() #1 C:\xampp\htdocs\university\wp-content\plugins\full-site-builder-for-elementor\inc\class.plugin.php(184):require_once(‘C:\xampp\htdocs.’) #2 C:\xampp\htdocs\university\wp-includes\class-wp-hook.php(307):DtbakerElementorManager->load_extensions(‘) #3 C:\xampp\htdocs\university\wp-includes\class-wp-hook.php(331):WP_Hook->apply_filters(NULL,数组#4 C:\xampp\htdocs\university\wp-includes\plugin.php(476):WP_Hook->do_action(Array) #5 C:\xampp\htdocs\university\wp-settings.php(598):do_action('init') #6C:\xampp\htdocs\university\wp-config.php(96):require_once(‘C:\xampp\htdocs.’)#7C:\xampp\htdocs\university\wp-load.php(50)):C:\xampp\htdocs\university\wp-blog-header.php(13):(‘C:\xampp\htdocs.’) #8 C:\xampp\htdocs\university\wp-content\plugins\full-site-builder-for require_once(‘C:\xampp\htdocs.’) #9 C:\xampp\htdocs\university\index.php(17):require(‘C:\xampp\htdocs.’) #10 {main}抛入C:\xampp\htdocs\university\wp-content\plugins\full-site-builder-for-elementor\extensions\google-maps\google-maps.php在线136号

EN

回答 2

Stack Overflow用户

发布于 2022-06-12 07:58:40

似乎某些插件或活动主题的代码与PHP8不兼容,这就是它抛出致命错误的原因。

请按照https://ehikioya.com/fix-for-function-create_function-is-deprecated-in-php-7-2/的文章来解决这个问题。

票数 5
EN

Stack Overflow用户

发布于 2022-07-13 14:17:53

我很难为您解决具体的用例问题--但是这里有一些注释和工具可以帮助您破译和修复这个问题。这个错误是因为您在PHP8上运行,但是您的代码有PHP7不兼容。

A.)将服务器降级为PHP7 B)或者更新扩展到PHP8兼容性C)或者自己手动更新扩展。

来自> PHP7的折旧后的PHP8 ()需要替换为匿名PHP8函数调用。

有关此问题的更多信息,请参见:PHP 7.2 Function create_function() is deprecated和:https://www.php.net/manual/en/function.create-function.php

如果您想深入到代码本身以修复以下内容:

https://notepad-plus-plus.org/

  • Open本文档在您的代码编辑器中: C:\xampp\htdocs\university\wp-content\plugins\full-site-builder-for-elementor\extensions\google-maps\google-maps.php

  • Got to:第136行

  • 使用上面的注释并尝试使用上面的注释重写函数。

代码中可能有其他折旧函数:

C:\xampp\htdocs\university\wp-content\plugins\full-site-builder-for-elementor\extensions\的文档库

  1. to Search -> Find in Files (Ctrl+Shift+F)将需要更新折旧函数的实例,以便您的错误消失。
    1. 知道这一点:在这个扩展中可能会出现其他类型的折旧代码错误。最好不要试图单独修复这些问题,除非您没有其他选项,如更新或降级PHP .
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72585111

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档