bbPress

Simple, Fast, Elegant

bbPress support forums » Troubleshooting

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

(9 posts)
  • Started 1 year ago by jschleifer
  • Latest reply from decavolt
  • This topic is not resolved
  1. jschleifer
    Member

    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

    Posted 1 year ago #
  2. Is it possible there are no php files in that directory, so the array is empty? File permissions making them unreadable?

    Posted 1 year ago #
  3. jschleifer
    Member

    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. :(

    Posted 1 year ago #
  4. 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 :-)

    Posted 1 year ago #
  5. jschleifer
    Member

    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! :)

    Posted 1 year ago #
  6. It's good that fixed it, but now I am curious why it was broken. What version of PHP are you using?

    Posted 1 year ago #
  7. I did this using PHP 4 at localhost and the warning message still appear

    Posted 11 months ago #
  8. 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

    Posted 9 months ago #
  9. Thanks Neziniux for that fix and the link.
    My forum was working just fine until today when I started seeing these warnings.

    Posted 8 months ago #

RSS feed for this topic

Reply

You must log in to post.

Code is Poetry.