skip to Main Content

I tried to activate an installed plugin and I got this error. I can’t open the site again. I restarted my computer and load the localhost URL, got the same error below:

Fatal error: Uncaught Error: Call to undefined function create_function() in C:xampphtdocsuniversitywp-contentpluginsfull-site-builder-for-elementorextensionsgoogle-mapsgoogle-maps.php:136 Stack trace: #0 C:xampphtdocsuniversitywp-contentpluginsfull-site-builder-for-elementorextensionsgoogle-mapsgoogle-maps.php(441): stylepress_dtbaker_Shortcode_Google_Map->init() #1 C:xampphtdocsuniversitywp-contentpluginsfull-site-builder-for-elementorincclass.plugin.php(184): require_once(‘C:xampphtdocs…’) #2 C:xampphtdocsuniversitywp-includesclass-wp-hook.php(307): DtbakerElementorManager->load_extensions(”) #3 C:xampphtdocsuniversitywp-includesclass-wp-hook.php(331): WP_Hook->apply_filters(NULL, Array) #4 C:xampphtdocsuniversitywp-includesplugin.php(476): WP_Hook->do_action(Array) #5 C:xampphtdocsuniversitywp-settings.php(598): do_action(‘init’) #6 C:xampphtdocsuniversitywp-config.php(96): require_once(‘C:xampphtdocs…’) #7 C:xampphtdocsuniversitywp-load.php(50): require_once(‘C:xampphtdocs…’) #8 C:xampphtdocsuniversitywp-blog-header.php(13): require_once(‘C:xampphtdocs…’) #9 C:xampphtdocsuniversityindex.php(17): require(‘C:xampphtdocs…’) #10 {main} thrown in C:xampphtdocsuniversitywp-contentpluginsfull-site-builder-for-elementorextensionsgoogle-mapsgoogle-maps.php on line 136

2

Answers


  1. It appears that some code from some plugin or active theme is not compatible with the PHP8 which is why it is throwing Fatal error.

    Please follow the article https://ehikioya.com/fix-for-function-create_function-is-deprecated-in-php-7-2/ to solve this issue.

    Login or Signup to reply.
  2. It’s difficult for me to troubleshoot for you specific use case – but here are some notes and tools that may help you decipher and fix this. The error is because you are running on PHP8 but your code has PHP7 incompatibilities.

    A.) Either downgrade the server to PHP7
    B.) Or update the extension to PHP8 compatibility
    C.) Or manually update the extension yourself.

    The depreciated create_function() from > PHP7 needs replaced with an anonymous PHP8 function call.

    For more information on this:
    see: PHP 7.2 Function create_function() is deprecated
    and: https://www.php.net/manual/en/function.create-function.php

    If you want to dive in to the code itself to fix this:

    1. Download Notepad++ https://notepad-plus-plus.org/
    2. Open this document in your code editor: C:xampphtdocsuniversitywp-contentpluginsfull-site-builder-for-elementorextensionsgoogle-mapsgoogle-maps.php
    3. Got to: line 136
    4. Use the notes above and experiment trying to rewrite the function using the notes above.

    You will likely have other depreciated functions in the code:

    1. Go to Search -> Find in Files (Ctrl+Shift+F) Search the document
      base of C:xampphtdocsuniversitywp-contentpluginsfull-site-builder-for-elementorextensions for "create_function("
    2. These instances of the depreciated function will need to be updated in order for
      your errors to go away.
    3. Know this: there are likely other types of depreciated code errors that will crop up in this extension. It’s best to not try and fix these individually unless you have no other option such as updating or downgrading the PHP version.
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search