I am trying to move a WordPress site to a new server, but I cannot get it up and running on my local server (running XAMPP).
The site is running perfectly fine, but when I download the files, export the database and then hook everything up on my local copy, I get the following error message:
Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'twentyten_widgets_init' not found or invalid function name in /Users/Tim/Sites/coachhousetimbers.com.au/old/wp-includes/plugin.php on line 405
And the following when I try to access the site’s dashboard:
Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'twentyten_widgets_init' not found or invalid function name in /Users/Tim/Sites/coachhousetimbers.com.au/old/wp-includes/plugin.php on line 405
Warning: Cannot modify header information - headers already sent by (output started at /Users/Tim/Sites/coachhousetimbers.com.au/old/wp-includes/plugin.php:405) in /Users/Tim/Sites/coachhousetimbers.com.au/old/wp-includes/pluggable.php on line 934
Any ideas and/or suggestions?
I have moved many WordPress websites in the past and this is the first time I’ve seen this error. I am running WordPress 3.2.1.
Thanks!
Is the site still working/displaying properly , other than this error on the front end?
It looks to me like your new hosting environment has warning and notice reporting ON.
Consider looking in your
wp-config.php
file forWP_DEBUG
and make sure it’s set tofalse
.Depending on how much control you have on your hosting environment, you should contact your hosting provider to adjust the PHP
error_reporting
to only errors.EDIT: I would first suggest going into your development location and looking in your
wp-config.php
file forWP_DEBUG
and make sure it’s set totrue
.The best way to avoid these warnings is to fix them at the source. It’s probably a very simple fix – it looks like the function
twentyten_widgets_init
doesn’t exist within your theme, which if you forked the twentyten theme instead of creating a child theme, is likely the case. You may have mistakenly renamed the function without addressing the hook where it’s being attached.Try to run this search-replace script as it is able to do proper replaces inside serialized options: Search Replace DB.
What you could do is install the WP Migrate DB plugin and add the new server path and site url before exporting the database.
Here’s the easy way to do it.
a. In find, enter your localhost url, e.g. like
127.0.0.1/mywpinstallation
( remember, no trailing slashes / “http://” or you get everything messed up).b. In replace, enter the production url, e.g.
myproductionsite.com
( again, no trailing slashes or “http://”).Hit replace all.
If you have done everything correctly, you should now have a perfectly working production site. Be sure to take additional measures for securing your site. I am not going to discuss that over here.