• I just upgraded one of my weblogs from 1.2.1 to 1.5 by deleting everything except wp-config.php and uploading from the distribution file. Everything appears to load okay so far, though I’m getting this error message on the plugins screen.

    Warning: Invalid argument supplied for foreach() in /xxx/www/xxx/xxxx/wp-admin/plugins.php on line 32

    I didn’t have any extra plugins on this installation and the three plugins that are default in 1.5 all are there, so it may not be a big issue.

    Any thoughts?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Did you remember to run .../wp-admin/upgrade.php? 🙂

    The upgrade script appears to do this if it can’t find the plugins directory, which it won’t if you deleted it. 🙂 I got the same thing, but the warning was on a different line number. The site appears to work even though I decided to ignore the warning. . .

    Thread Starter 12068

    NuclearMoose: Yes, I did run the upgrade.php. When the Step 1 page loaded, however, it did not load fully showing the Step 1 statement and saying that I was done, even though the browser showed a status of Done.

    brandonabell: I deleted the entire directory structure and uploaded a clean 1.5 installation, so the plugins directory that exists in the downloadable archive is there.

    Gary,

    Then I’m confused. My bad.

    I have this one. It won’t take a null argument, if that’s the correct term: it gives you an error if you have zero active plugins.

    I got this error too, and then I activated “Hello Dolly” and it went away.

    GaryPetersen,

    It sounds as if you may have a memory problem. If php runs into a memory limit during the upgade, you never see the all done page. I did some debugging from the command line when I ran into this problem. PHP 4 ships with a memory limit of 8 Mb, which is not enough for some blogs.

    To fix this, modify php.ini to set memory_limit to a bigger number (like 64M). Alternatively , you can run the upgrade from the command line by typing php -d memory_limit=64M upgrade.php to run with 64 Mb as the limit, for example. You will also need to modify upgrade.php to go directly to step 1 or put the cgi arguments on the command line (step=1).

    After that, everything works perfectly. You don’t need to keep the memory limit at a larger number, it’s only needed for the upgrade. If you fix this by modifying php.ini, don’t keep it set at the higher value after the upgade. The limit is there to protect you. Let it do its job.

    Thread Starter 12068

    Typey, I activated Hello Dolly, as you suggested, and the error statement went away. What’s weird is that deactivating Hello Dolly didn’t restore the error statement.

    What’s also weird is that I’ve upgraded three of four weblogs I have between home and work to 1.5, all with no active plugins at the time of upgrade, and only this one had the problem.

    Thanks for the suggestions and feedback, everyone. I do appreciate the help.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘1.5 Upgrade – Invalid Argument foreach Error’ is closed to new replies.