Forums

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

  1. mohkar
    Member
    Posted 3 months 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 3 months 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 3 months 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 3 months ago #

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

  5. rasheed
    Member
    Posted 3 months ago #

    The same problem here ...

  6. Viper007Bond
    Member
    Posted 3 months 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 3 months ago #

    Thankyou very much, Viper007Bond, did the trick perfectly!

  8. Viper007Bond
    Member
    Posted 3 months 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 2 months ago #

    hey Viper007Bond, it worked perfect!
    thanks man.

  10. cinematic
    Member
    Posted 2 months ago #

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

  11. dhiman_pawan
    Member
    Posted 2 months ago #

    Thanks Viper007Bond for your help

  12. maximsc
    Member
    Posted 1 month 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.

Reply

You must log in to post.

About this Topic