Skip to:
Content
Pages
Categories
Search
Top
Bottom

Warning: Invalid argument supplied for foreach() in /bb-settings.php on line 173

  • I just upgraded to the latest wordpress 2.3 and bbpress 0.8.3 and now when I try and access any page I get the following error at the top of the page:

    Warning: Invalid argument supplied for foreach() in bb-settings.php on line 173

    I checked the bb-settings.php file and the line looks like:

    foreach ( glob(BBPLUGINDIR . ‘_*.php’) as $_plugin )

    I checked BBPLUGINDIR to see if it’s been set correctly, and it does indeed point to the location of my-plugins.

    I’m running PHP5 with a mamp server on os x.. I’ve never had a problem with bbpress before (being using it for a few months now), and only saw this error with the upgrade.

    has anyone else seen this, or know how to remove it?

    cheers,

    Jason

Viewing 8 replies - 1 through 8 (of 8 total)

  • chrishajer
    Participant

    @chrishajer

    Is it possible there are no php files in that directory, so the array is empty? File permissions making them unreadable?

    I checked file permissions & tried it both with files in it, and without.. permissions were fine, and the number of files in the directory made no difference to the error. I even tried it w/out the directory there, same error. :(


    chrishajer
    Participant

    @chrishajer

    These are completely wild guesses, just stalling and bumping the thread until someone knowledgeable comes along.

    Are there any underscore plugins in the plugin directory? What if you put an underscore plugin in that folder, if there are none now?

    Is it possible glob is disabled in your php.ini, and the conditional in this file is not working properly when glob is disabled (create a phpinfo file and look for the disabled_functions section to see if glob is there.

    That’s all I’ve got right now :-)

    thanks for trying to solve this chris! I went and tried your options..

    “are there any underscore plugins in the plugin directory?”

    nope, there’s nothing at all in the plugin directory.

    “What if you put an underscore plugin in that orlder, if there are none now?”

    well I’ll be.. I simply touched my-plugins/_test.php

    and it worked.

    that’s just crazy weird.. huh. thanks for the help! :)


    chrishajer
    Participant

    @chrishajer

    It’s good that fixed it, but now I am curious why it was broken. What version of PHP are you using?

    I did this using PHP 4 at localhost and the warning message still appear

    I spent a whole day trying to resolve the same problem, until I came accross a sollution. Try the following improvements, worked for me.

    In the bb-settings.php version 0.8.3 line 172 find the code:

    if ( is_callable( ‘glob’ ) )

    foreach ( glob(BBPLUGINDIR . ‘_*.php’) as $_plugin )

    require($_plugin);

    Replace it with:

    if ( is_callable( ‘glob’ ) ) {

    $pluginarray = glob(BBPLUGINDIR . ‘_*.php’);

    if ($pluginarray)

    foreach ( $pluginarray as $_plugin )

    require($_plugin);

    }

    The source (in German): http://www.brusdeylins.info/bbpress/problem-in-bb-settings/#comment-67

    Thanks Neziniux for that fix and the link.

    My forum was working just fine until today when I started seeing these warnings.

Viewing 8 replies - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.
Skip to toolbar