WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Invalid argument supplied for foreach()..........capabilities.php on line 31 (13 posts)

  1. nomma
    Member
    Posted 6 years ago #

    Hi! I moved my whole blog to another server, everything goes well except this error message:Invalid argument supplied for foreach()..........capabilities.php on line 31, and I can't login.Can anyone help me? Thanks.

  2. MichaelH
    Member
    Posted 6 years ago #

    Typically the solution for a problem like this is to reupload the WordPress files. You might try just reuploading capabilities.php and pluggable.php to the wp-includes folder.

    If that doesn't work, make sure you get a clean copy of the 2.1 distribution from http://wordpress.org/download/release-archive/ and use that.

    I would also recommend upgrading to 2.2.

  3. nomma
    Member
    Posted 6 years ago #

    Thanks for the help! I did reupload all the files, i tried to upgrade, still not working and a few more warnings added:
    Warning: Cannot modify header information - headers already sent by (output started at ...wp-includes/capabilities.php:31)in.../wp-includes/pluggable.php on line 313
    :((

  4. nomma
    Member
    Posted 6 years ago #

    Any ideas?

  5. MichaelH
    Member
    Posted 6 years ago #

    I still think you don't have a completely intact copy of all the WordPress files.

    I'd get a clean WordPress distribution from the Download link at the top of this screen, then delete the WordPress files from your host, then reupload the WordPress files from the clean distribution.

  6. nomma
    Member
    Posted 6 years ago #

    I'll try again, thank you.

  7. nomma
    Member
    Posted 6 years ago #

    The reupload did not help. I made an XML export and finally it's working :))

  8. RedMike
    Member
    Posted 6 years ago #

    Hi! I have the same problem. The reupload also didn't helped. I'm running php 4.4.7, and have warnings, that "Invalid argument supplied for foreach() in /wwwroot/infolio/lifeln.com/www/wp-includes/capabilities.php on line 31".
    What is XML export?

    I've reupload capabilities.php from svn without any result. My release of WordPress is 2.2.

  9. MichaelH
    Member
    Posted 6 years ago #

    Just resolved this on a Omnis.com host, when installing WordPress Version 2.2.1.

    Solution was found here:
    http://www.eukhost.com/forums/archive/index.php/t-2337.html

    In the case of Omnis hosting, they offer a control panel PHP Settings where "magic_quotes_runtime" can be set to OFF.

    The article above points out you can put
    php_flag magic_quotes_runtime off
    in your .htaccess file.

  10. qersys
    Member
    Posted 6 years ago #

    that did it :)

    Thank you very much

  11. Thanghv
    Member
    Posted 6 years ago #

    I try set "magic_quotes_runtime" to OFF and put php_flag magic_quotes_runtime off to .htaccess file. But it's not work.
    Can anyone help me? THanks

  12. dmry
    Member
    Posted 6 years ago #

    Download http://file.dmry.net/blog/01/wp_user_roles_yama.zip patch file and upload in root directory of wordpress. Finaly call it on URL (http://your_blog_url../wp_user_roles.php)

    Before appyling patch, backup your database..

    For this patch, I write a manual but in Turkish. If you want, you can read or translate with any service..

    Patch URL: http://www.dmry.net/wordpress-231-kullanici-yetkileri-yamasi

  13. promed
    Member
    Posted 6 years ago #

    I tried all these options and none of them worked. I have omnis as a host as well. After googling for 2 hours and messing around with things I figured it out.

    For an omnis host there are 3 PHP options that are default off.

    magic_quotes_runtime:
    magic_quotes_gpc:
    register_globals:

    Everyone was saying those first two NEED to be off and they were, but register_globals NEEDS to be on. Soon as I turned that on everything worked perfectly.

Topic Closed

This topic has been closed to new replies.

About this Topic