Forums

[resolved] 2.5 - Fatal Error: Cannot use string offset as an array, line 46 dashboard.php (14 posts)

  1. mohkar
    Member
    Posted 1 year ago #

    I've successfully got 2.5 working locally, however when I migrate to my server by

    a) exporting the database and uploading to my server
    b) updating wp-config.php with the correct details
    c) uploading all files
    and d) changing references from my local install to my online install

    I get the following error when I visit the online WP-Admin:

    Fatal error: Cannot use string offset as an array in <my online site>/blog/wp-admin/includes/dashboard.php on line 46

    I note this does not happen locally. I downloaded my old 2.3 to my local server to do the 2.5 upgrade.

  2. mohkar
    Member
    Posted 1 year ago #

    Anyone, I cannot use my site administrative functions till I resolve this.

    I can log in but because the dashboard doesn't load I can't access any functions.

  3. cmbg
    Member
    Posted 1 year ago #

    i get this error too...

    BUT you can go directly to the admin functions bypassing the dashboad, go to /blog/wp-admin/edit.php when you get the error.

  4. mohkar
    Member
    Posted 1 year ago #

    Hmm same thing here CMBG! Thanks for showing me that though, gives me some control

  5. rasheed
    Member
    Posted 1 year ago #

    The same problem here ...

  6. Viper007Bond
    Member
    Posted 1 year ago #

    Your dashboard widget options somehow got corrupted.

    Open up phpMyAdmin, go to the wp_options table, click on "Search" at the top. Next to the option_name label, type in dashboard_widget_options, and hit "Go".

    Just one row should pop up. Delete that ONE row by clicking the X.

    That should fix it.

  7. mohkar
    Member
    Posted 1 year ago #

    Thankyou very much, Viper007Bond, did the trick perfectly!

  8. Viper007Bond
    Member
    Posted 1 year ago #

    I wrote a plugin for those who don't want to use phpMyAdmin as this seems to be a decently common problem.

    http://wordpress.org/extend/plugins/dashboard-fixer/

    I've also opened a ticket on the matter and attached a possible fix.

  9. fadzlizuka
    Member
    Posted 1 year ago #

    hey Viper007Bond, it worked perfect!
    thanks man.

  10. cinematic
    Member
    Posted 1 year ago #

    Thank you viper007bond ... you saved me a lot of headache! Brilliant!

  11. dhiman_pawan
    Member
    Posted 1 year ago #

    Thanks Viper007Bond for your help

  12. maximsc
    Member
    Posted 1 year ago #

    BTW, FYI, Here's the reason that the dashboard widget options "somehow" got corrupted:

    The option_value for dashboard_widget_options is a serialized object (like many other values in that table). The PHP serialization syntax depends on the lengths of strings being fixed. In the process of transferring the data from my local machine to the live server, I dumped the database (using MySQLDump) and did a search-and-replace on localhost, changing it to the real domain (www.saverskeepers.com, in my case). "www.saverskeepers.com" is 12 characters longer than "localhost", and that threw off the deserialization when the option was read back in.

  13. marcvdwurff
    Member
    Posted 1 year ago #

    Thanks Viper007Bond for your help and maximsc for your explaination!

  14. mersh
    Member
    Posted 11 months ago #

    OK I resolved the issue below, but I'll leave it for posterity... the answer to my problem was MAGIC QUOTES - they MUST BE TURNED OFF to fix this issue.

    ====================================================================
    I just moved several sites to a new server, and used cpanel to move the sites, which has worked before. In this current move, all my wordpress sites are showing this error or one of a couple others (all of which have threads here) but none of the fixes mentioned seems to help.

    This is what is on the front page of one of the sites:

    Warning: Invalid argument supplied for foreach() in /home/canadian/public_html/wp-

    includes/capabilities.php on line 31

    Fatal error: Cannot unset string offsets in /home/canadian/public_html/wp-includes/widgets.php on line 362

    Can't get to the admin screen, don't use text widgets, deleted the suggested row in the mysql database referring to widgets, none of it has worked. Any advice on this would be appreciated.

Topic Closed

This topic has been closed to new replies.

About this Topic