Ready to get started?Download WordPress


[resolved] Warning: array_keys() [function.array-keys]: (42 posts)

  1. DomainClaimers
    Posted 5 years ago #

    Update - after doing the above it did allow me to work on my website but I found no text widgets in the sidebar, it also shut down 5 other websites on the same server as mine since those are also my websites it was obvious that taking that code out is not going to fix the problem. Not sure what to try next, maybe going back in and taking the text code out of the header and deleting all comments this would leave no text errors possible, maybe upgraded or deactivate all the plug ins.

  2. mersh
    Posted 5 years ago #

    I just moved my sites to an upgraded server, running identical software to the one they left. I should say "apparently" identical because every one of my wordpress blogs is fluggered...


    All have one or another of the error discussed here. I tried removing suggested lines from the widgets.php file and from my wpconfig file, nothing seems to fix this. I have no text widgets. Help...!

  3. mersh
    Posted 5 years ago #

    OK I resolved the issue above... the answer to my problem was MAGIC QUOTES - once I turned them OFF in my php.ini (or it could be done through cpanel) all the error message went away.

  4. Famous
    Posted 5 years ago #

    What is this error?:
    Warning: array_keys() [function.array-keys]: The first argument should be an array in Testing\wp-includes\widgets.php on line 1349

    Warning: Invalid argument supplied for foreach() in Testing\wp-includes\widgets.php on line 1349

  5. michaelkrol
    Posted 5 years ago #

    I figured out what caused this error for me. My blog was working fine, but my local copy was getting the array_keys() error. It turns out it was due to an issue I've run into many times before while exporting a database from phpMyAdmin.

    For some reason, phpMyAdmin inserts garbage after EVERY LINK in your database content. So if you have a database row with <a href="mylink"> in the data, it will end up looking something like <a href="mylink?phpMyAdmin=hxLEzQ1rOQcEE5fSSzkpIuPI8E7">. Obviously, this causes all kinds of issues.

    The only way I've found to stop this behavior is to NOT check "save as file" when exporting your database. Just click "Go" and let the dump print to screen. Then copy/paste it into a text file and import that into your local (or wherever) database.

  6. borayeris
    Posted 5 years ago #

    Thanx Otto

  7. webstergroup
    Posted 5 years ago #

    I have moved my site to a new server and now the text widgets do not work at all. I had the array error after I moved it as well that is now gone BUT I can not use text widgets at all.

  8. Yesteryear
    Posted 5 years ago #

    I had the same problems, getting the error message:
    Warning: array_keys() [function.array-keys]: The first argument should be an array in Testing\wp-includes\widgets.php on line 1044

    Warning: Invalid argument supplied for foreach() in Testing\wp-includes\widgets.php on line 869

    Turns out it's an error you get when importing from a database using a different utf.
    My brother managed to fix the problem by deleting the following code in wp-config.hp: /** Database Charset to use in creating database tables. */
    define('DB_CHARSET', 'utf8');

    Good luck to others with the same problem!

  9. vlads
    Posted 5 years ago #

    Had the same problem after migrating to a new server. The problem was character encoding. Make sure to use utf-8 encoding when exporting/importing your database via phpMyAdmin, CocoaMySQL, etc.

  10. esb
    Posted 5 years ago #

    Please someone help!

    I'm getting this error as well so many others while trying to figure out what I did wrong.

    I added some html into my text box widget and the next thing I know every page has an error. So I look for a solution and find the deal on how to edit the wp-config for it. This only made it to where I can no longer access my wp-admin or my website. I'm seriously freaking out. I've tried every solution I've been able to google and still no luck.

    Parse error: syntax error, unexpected '*' in /home/elibrumb/public_html/artstormhouston.com/wp-config.php on line 2

    This is the current error message.

  11. The General
    Posted 5 years ago #

    Like all of you that wrote in I had this problem as well. I went through and tried the many suggestions posted here and managed to really screw things up bad.

    So bad that a two year old site defaulted to a new installation!! I was mad as heck!!

    I went back through this and noticed that someone had thanked Otto42. So I went and looked at what he wrote. It seems like the first time I read his reply I missed it.

    If you go and edit all your text widgets and then save changes, this should go away. Worst case, manually edit your database, find the widget_text row in wp_options, and remove it. Then put your text widgets back.

    This solved the problem. Before trying anything else please try this first!

    Thank you Otto42!

  12. ldelre
    Posted 5 years ago #

    This worked for me:

    wp-options > option_name > widget_text

    Removed the widget_text, as advised.

Topic Closed

This topic has been closed to new replies.

About this Topic