upgrade from wordpress 2.1 to 2.5
As I have updated some of my hebrew blogs from wordpress 2.1 to wordpress 2.5 I have ancountered two repeating problems:
1. My entire text transformed into gibberish
2. At the top of my blog the following error message appeared:
Warning: array_keys() [function.array-keys]: The first argument should
be an array in /home/pega9510/domains/kotvim.co.il/public_html/copy/wp-
includes/widgets.php on line 654Warning: Invalid argument supplied for foreach() in /home/pega9510/
domains/kotvim.co.il/public_html/copy/wp-includes/widgets.php on line
654Warning: array_keys() [function.array-keys]: The first argument should
be an array in /home/pega9510/domains/kotvim.co.il/public_html/copy/wp-
includes/widgets.php on line 1307Warning: Invalid argument supplied for foreach() in /home/pega9510/
domains/kotvim.co.il/public_html/copy/wp-includes/widgets.php on line
1307
I won’t depress you with the entire two days of searching google and other places for solutions. but I will tell you I was lucky to have problem number 1, otherwise I would never have solved problem number 2.
The solution:
The solution is to go to the wp-config.php file and delete the line (I think it’s line 7) that contains the phrase:
define(‘DB_CHARSET’, ‘utf8’);
It worked for me and solved both of the problems together. I hope this helps other people who encounter the same problem.
p.s.
it seems that deleting the line after performing the upgrade doesn’t help much, so try deleting it and only then go to your wp-admin/upgrade.php file. If you have already upgraded the database, try restoring it from your last backup (hopfully you made one), then delete the line and then upgrade.
I only get the 654 error and your fix didn’t work for me.
Thanks for trying though!
Did you delete the line before you attempted to upgrade the database or after?
It seems it doesn’t help if you perform the upgrade process before you delete the line. I’ve just added it to the post.
Then again, maybe there are several problems with the same symptoms…
unfortunately i upgraded the db before deleting the line?
thanks for your help so far but what do you suggest now?
cheers – Johnny
Do you have a back up since before the upgrade? i don’t think there is a way to downgrade the db (at least not that i know of). there is a method of returning to 2.3.3 without the db backup but i havn’t tested it and i can’t guaranty it wouldnt cause any damage. it was suggested here
Well, I stumbled upon this post because I was getting the same error you were seeing in #2 anytime I tried to go into the backend of my blog.
I checked my wp-config.php file for the line you suggested deleting, and it wasn’t there. So I tried adding it, and viola! Everything back to normal (my blog is in English).
Not sure why it worked, but I’m super happy it did. Thanks! 🙂
I’m happy you succeeded. I guess it has something to do with the encoding of the database itself.
Hello Uri and guys;
I have faced the problem exactly what Uri got. and guess what?
I just deleted the line define(‘DB_CHARSET’, ‘utf8’); from my wp-config and everything came back to normal ^^
cheer Uri 🙂
Ah ha. I have just had the same problem. nothing sugegsted was working.
I was upgrading from 2.3 to 2.5.1. However, I was also moving domain. I did not want to do this upgrade on the current domain incase I got this error. So I had backed up the database and edited it manually before importing it into the empty database on the new domain.
I opened widget.php in both the old domain and the new one and compared them. The 2.3 widgets.php was over 400 pages longer. I am not good at php in any respect. So to avoid editing anything, I replaced the widgets.php in my 2.5.1 installation with the widgets.php file from my old installation 2.3 and then went to upgrade.php and the errors are gone.
Hope this helps someone 😀
Thank you SO much!!!! You just solved my problem!!!
Thanks! Thanks! Thanks!
tylin and happybatatinha, i’m happy it worked 🙂
dave, there where quite a few changes in the way the widgets are working on the current version. i switching the file will not cause other errors…
Great !
I was struggling with this problem a cpouple of days and this is the solution .
As result of it I found that I can not post pages direct from Word (some strange signs showed up ), but have to make it through notepad
Just wanted to say thanks for the tip, and report that removing the line after the upgrade worked for me. I was upgrading from 2.3.1 to 2.5.1. I guess the encoding mixup didn’t affect the upgrade process in my case.