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
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.
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:
You will likely have other depreciated functions in the code:
base of C:xampphtdocsuniversitywp-contentpluginsfull-site-builder-for-elementorextensions for "create_function("
your errors to go away.