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:\xampp\htdocs\university\wp-content\plugins\full-site-builder-for-elementor\extensions\google-maps\google-maps.php:136 Stack trace: #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, Array) #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') #6 C:\xampp\htdocs\university\wp-config.php(96): require_once('C:\xampp\htdocs...') #7 C:\xampp\htdocs\university\wp-load.php(50): require_once('C:\xampp\htdocs...') #8 C:\xampp\htdocs\university\wp-blog-header.php(13): require_once('C:\xampp\htdocs...') #9 C:\xampp\htdocs\university\index.php(17): require('C:\xampp\htdocs...') #10 {main} thrown in C:\xampp\htdocs\university\wp-content\plugins\full-site-builder-for-elementor\extensions\google-maps\google-maps.php on line 136
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:
Download Notepad++ https://notepad-plus-plus.org/
Open this document in your code editor: C:\xampp\htdocs\university\wp-content\plugins\full-site-builder-for-elementor\extensions\google-maps\google-maps.php
Got to: line 136
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:
Go to Search -> Find in Files (Ctrl+Shift+F) Search the document
base of C:\xampp\htdocs\university\wp-content\plugins\full-site-builder-for-elementor\extensions\ for "create_function("
These instances of the depreciated function will need to be updated in order for
your errors to go away.
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.
Related
I'm upgrading from TYPO3 8.7 to TYPO3 9.5 and am getting the following error. I don't see anywhere in my site extension that that controller is used and don't know what do to. This error is preventing me from using any typo3cms commands. Looked for answers on the Slack channel and else where but haven't found answers yet and am stuck.
Deleted all cache via the TYPO3 Install tool GUI
Manually deleted and rebuilt vendor and typo3temp directories.
[ Symfony\Component\Console\Exception\RuntimeException ]
Command controller class "TYPO3\CMS\Lang\Command\LanguageCommandController" does not exist.
Exception code: 1520200175
Exception trace:
#0 ()
vendor/helhum/typo3-console/Classes/Console/Mvc/Cli/CommandConfiguration.php:102
#1 Helhum\Typo3Console\Mvc\Cli\CommandConfiguration::extractCommandDefinitionsFromControllers()
vendor/helhum/typo3-console/Classes/Console/Mvc/Cli/CommandConfiguration.php:94
#2 Helhum\Typo3Console\Mvc\Cli\CommandConfiguration::unifyCommandConfiguration()
vendor/helhum/typo3-console/Classes/Console/Mvc/Cli/CommandConfiguration.php:149
#3 Helhum\Typo3Console\Mvc\Cli\CommandConfiguration->addCommandControllerCommands()
vendor/helhum/typo3-console/Classes/Console/Mvc/Cli/CommandCollection.php:141
#4 Helhum\Typo3Console\Mvc\Cli\CommandCollection->addCommandControllerCommands()
vendor/helhum/typo3-console/Classes/Console/Core/Kernel.php:138
#5 Helhum\Typo3Console\Core\Kernel->handle()
vendor/helhum/typo3-console/Scripts/typo3-console.php:30
#6 {closure}()
vendor/helhum/typo3-console/Scripts/typo3-console.php:32
#7 require()
vendor/helhum/typo3-console/typo3cms:3
Keep in mind, removed packages are also in your sysext-folder.
In your case, EXT:lang has been removed.
In my case, it has been relicts of typo3/cms while switching to a subtree-split installation of TYPO3.
Manually cleaning up your web-dir (and root-dir if used) by deleting your typo3/-folder will help.
I uploaded custom plugin in my wordpress localhost,
after I activated it I've got an error:
Fatal error: Cannot redeclare true_plugins_activate() (previously declared in /Applications/MAMP/htdocs/wordpress/wp-includes/functions.php:7406) in /Applications/MAMP/htdocs/wordpress/wp-includes/functions.php on line 7465
Fatal error: Uncaught Error: Call to undefined function wp_kses_normalize_entities() in /Applications/MAMP/htdocs/wordpress/wp-includes/formatting.php:4333 Stack trace: #0 /Applications/MAMP/htdocs/wordpress/wp-includes/class-wp-fatal-error-handler.php(190): esc_url('https://wordpre...') #1 /Applications/MAMP/htdocs/wordpress/wp-includes/class-wp-fatal-error-handler.php(147): WP_Fatal_Error_Handler->display_default_error_template(Array, false) #2 /Applications/MAMP/htdocs/wordpress/wp-includes/class-wp-fatal-error-handler.php(52): WP_Fatal_Error_Handler->display_error_template(Array, false) #3 [internal function]: WP_Fatal_Error_Handler->handle() #4 {main} thrown in /Applications/MAMP/htdocs/wordpress/wp-includes/formatting.php on line 4333
Then I deleted this plugin, but anyway I can't enter because of this errors.
I tried to rename plugins folder to plugins_old, plugins.deactivate and etc., but nothing.
Also I entered inside phpmyadmin in options and active_plugins and replace everything with this a:0:{}, but nothing changed.
Can you help me, please?
So we discussed the issue somewhat in the question comments (this is the most important note for context)
Whatever happened here is a reflection of a corrupted WordPress install, not a plugin (even if this was the trigger). People have got these errors when upgrading WordPress or PHP [...] [but] I don't think that [true_plugins_activate] function should even be there once.
Someone also had this problem due to installing a plugin called "Monitization", which was malware.
So I'll say what I'd do in this situation.
I would open the functions.php file (in the folder wp-includes) in a text editor, search for "true_plugins_activate" and look inside the contents for any PHP files I didn't recognise. This would only give me information as to whether something unfamiliar (like malware in the plugin with a different name) was involved, but it's clear you know which plugin caused this.
Then, I would reinstall the wordpress files that are corrupted. I would find the version of WordPress that I had installed, then I would download the zip file from https://wordpress.org/download/releases/, extract it, then first copy the two files that show in the error, replacing the originals in wp-includes. I would check if this fixes the problem. Even if it does, I would most likely copy over all the other files. (I might move any plugins or themes I had installed to a separate location, so that they don't get overwritten.)
If I was feeling very investigative, before copying, I would do a diff check of my entire WordPress installation with the WordPress download to see exactly what files were different and how. There are many programs that can do this.
You said that everything was fine after removing both "true_plugins_activate"s, but I would not come to this conclusion so fast, because there was another error in the log that affected a totally different file, wp-includes/formatting.php. I would definitely reinstall multiple or all WordPress files after this.
I was trying to set up W3 Total Cache to work with Cloudfront+S3, but had trouble following a guide.
I added my access key id and the secred key, but when I try to create the distribution from the wordpress panel I just get a "failed" message.
I looked at the logs and this is what I found:
2018-11-22T01:10:19+00:00 CRITICAL Uncaught Error: Class 'DOMDocument' not found in /var/www/html/wp-content/plugins/w3-total-cache/lib/S3.php:1770
Stack trace:
#0 /var/www/html/wp-content/plugins/w3-total-cache/lib/S3.php(1403): S3::getCloudFrontDistributionConfigXML('myurl.com.a...', 'custom', true, '', '154234534.333'(I changed this number just in case.), Array, NULL, NULL, Array)
#1 /var/www/html/wp-content/plugins/w3-total-cache/CdnEngine_S3_Cf.php(363): S3::createDistribution(',myurl.com.a...', 'custom', true, Array)
#2 /var/www/html/wp-content/plugins/w3-total-cache/Cdn_AdminActions.php(471): W3TC\CdnEngine_S3_Cf->create_container('', 'Incorrect type.')
#3 /var/www/html/wp-content/plugins/w3-total-cache/Root_AdminActions.php(25): W3TC\Cdn_AdminActions->w3tc_cdn_create_container()
#4 /var/www/html/wp-content/plugins/w3-total-cache/Generic_Plugin_Admin.php(159): W3TC\Root_AdminActions->execute('w3tc_cdn_create...')
#5 /var/www/html/wp-includes/class-wp-hook.php(286): W3TC\Generic_Plugin_Admin->load('')
#6 /var/www/html/wp-includes/class-wp-hook.php(310): WP_Hook->app in /var/www/html/wp-content/plugins/w3-total-cache/lib/S3.php on line 1770
I'm unsure of where I have this problem. Did S3 changed and now it's not allowed to use an admin user for this task?
I was using this guide: https://www.youtube.com/watch?v=yaFt3lUvsH8 I get the fail at 9:54
Thanks for the help.
I was able to fix the issue.
I'm using an AWS AMI with Linux 2. Seems like a php plugin was missing.
sudo yum install php-xml
Solved my issue.
Getting this error after a forced wordpress upload (I was working in the database when at one point of time I got an alert - while on the backend, with only one option to upgrade to the newer available version):
Fatal error: Cannot redeclare _421736532() (previously declared in /home/user/domains/mydomain.com/public_html/wp-content/themes/twentyelevenmodified/header.php(68) : eval()'d code:1) in /home/user/domains/mydomain.com/public_html/wp-content/themes/twentyelevenmodified/header.php(68) : eval()'d code on line 1
The above is when I try mydomain.com
When I try mydomain.com/wp-admin/, I am redirected to wp-login.php and getting the following error:
Fatal error: Cannot redeclare _421736532() (previously declared in /home/user/domains/mydomain.com/public_html/wp-login.php(80) : eval()'d code:1) in /home/user/domains/mydomain.com/public_html/wp-login.php(80) : eval()'d code on line 1
Pulling my hair out trying different things since 5 hours now. Any help will be appreciated.
EDIT: After testing, I found that the function.php file is correctly calling function twentyeleven_header_style() and the problem is coming just after calling this function. So it's the next function call that is causing the problem. If I could know what is the next function !!!
Wordpress doesn't use functions with those names. Deactivate your plugins or rename the plugins folder.
If that doesn't work then it's probably coming from your theme. Rename your theme folder so wordpress will revert to the default (assuming the default theme exists).
It sounds like you purchased a theme or plugin with obfuscated code and it's using eval() to run it and probably making a call home.
After much research, I found that the site in question was hacked. More than 100 files were corrupted with codes. I cleaned them all and now things are functioning.
For others facing the same problem, download the whole files to your computer and look for eval codes (can be easily recognized).
I am trying to use the Zend Gdata framework with wordpress but I am having some issues.
Now everything works perfectly fine when I test on localhost with XAMPP. However on my web server my code breaks down.
Here is my code to include the framework.
`set_include_path(TEMPLATEPATH . '/includes/');
require_once ('Zend/Loader.php');
Zend_Loader::loadClass('Zend_Gdata_Youtube');`
That code produces the following error.
Warning: Zend_Loader::include_once(Zend/Gdata/Youtube.php) [zend-loader.include-once]: failed to open stream: No such file or directory in /home/damain/public_html/mysite.com/wp-content/themes/mysite/includes/Zend/Loader.php on line 146
Warning: Zend_Loader::include_once() [function.include]: Failed opening 'Zend/Gdata/Youtube.php' for inclusion (include_path='/home/damain/public_html/mysite.com/wp-content/themes/mysite/includes/') in /home/damain/public_html/mysite.com/wp-content/themes/mysite/includes/Zend/Loader.php on line 146
Fatal error: Uncaught exception 'Zend_Exception' with message 'File "Zend/Gdata/Youtube.php" does not exist or class "Zend_Gdata_Youtube" was not found in the file' in /home/damain/public_html/mysite.com/wp-content/themes/mysite/includes/Zend/Loader.php:99 Stack trace: #0 /home/damain/public_html/mysite.com/wp-content/themes/mysite/includes/modules/yt_link_checker.php(19): Zend_Loader::loadClass('Zend_Gdata_Yout...') #1 /home/damain/public_html/mysite.com/wp-includes/plugin.php(405): load_zend_gdata('') #2 /home/damain/public_html/mysite.com/wp-admin/admin.php(111): do_action('load_zend_gdata', Array) #3 /home/damain/public_html/mysite.com/wp-admin/index.php(10): require_once('/home/damain/...') #4 {main} thrown in /home/damain/public_html/mysite.com/wp-content/themes/mysite/includes/Zend/Loader.php on line 99
I cannot seem to figure this issue out. Can anyone help?
The best solution in this case is to run the script requiring the Zend Loader and use var_dump(get_include_path()) to see what the server says the path is. Then keep modifying the php.ini include_path until the script finds it.
In your case, I'm not sure if 'damain' is supposed to be 'domain'. My include path which finally worked was:
/home2/thelove6/public_html/zf/ZendGdata/library" thelove6 being the username.
Did you look to see if those files exist in those directories? (/mysite/includes/Zend/Loader.php) and they have the correct permissions? It sounds like that could very well be the issue. The other thing to check with a simple phpinfo() would be that you have all of the libraries install on the live server.
Ok, the possible reason is: You're not using the proper case for the classname. For the version 1.11.11, it will be Zend_Gdata_YouTube rather than Zend_Gdata_Youtube.
Windows OS is ignoring the case, whereas the Linux server does not. Hope this will solve your problem, just look at the proper case of the Class or filenames.