Skip to:
Content
Pages
Categories
Search
Top
Bottom

Installation Problem – Cannot modify header information

  • Hi Guys,

    I´ve got a problemrunning the installation properly. These failures appear and I can`t log in to the forum:

    Warning: Invalid argument supplied for foreach() in /var/www/web7/html/stilblogforum/bb-settings.php on line 169

    Warning: Cannot modify header information – headers already sent by (output started at /var/www/web7/html/stilblogforum/bb-settings.php:169) in /var/www/web7/html/stilblogforum/bb-includes/pluggable.php on line 37

    Warning: Cannot modify header information – headers already sent by (output started at /var/www/web7/html/stilblogforum/bb-settings.php:169) in /var/www/web7/html/stilblogforum/bb-includes/pluggable.php on line 37

    Warning: Cannot modify header information – headers already sent by (output started at /var/www/web7/html/stilblogforum/bb-settings.php:169) in /var/www/web7/html/stilblogforum/bb-includes/pluggable.php on line 164

    At the top of the forum, the followinf message is displayed:

    Warning: Invalid argument supplied for foreach() in /var/www/web7/html/stilblogforum/bb-settings.php on line 16

    Can anyone help me? I already tried searching here for an answer, but nothing helped me…

    Thx from Aachen, Germany

    Andreas

Viewing 9 replies - 1 through 9 (of 9 total)
  • Can you create the my-plugins directory in your root folder? I assume it isn’t there, that’s the only reason I can see for glob() to return false rather than an array.


    chrishajer
    Participant

    @chrishajer

    I’ve seen two or three seemingly unrelated problems pop up related to something like this:

    if ( is_callable( 'glob' ) )
    foreach ( glob(BBPLUGINDIR . '_*.php') as $_plugin )
    require($_plugin);

     

    Seems like if there are no underscore plugins, this fails. I don’t follow the code exactly, but further up in that file, it defines BBPLUGINDIR if it’s not already defined as (basically) my-plugins/. But this line just says “if glob is callable, then go through the directory for all underscore plugins”. What happens if there are no plugins there? This would return false, maybe, instead of an array?

    And, is there a good reason NOT to include a blank directory for my-templates and my-plugins? At least then people would know where to put stuff. I mean, what IS the reason? WordPress comes with wp-content/themes/ and wp-content/plugins/ directories, and by default, two themes and two plugins. That eliminates the possibility of something missing. Of course, people could delete those, but right off the bat, they wouldn’t and things would just work when they started out.

    At the very least, I think this should be fixed to have a conditional looking for underscore plugins before looping through them (i.e. if there are none, you can’t loop through them.)

    Maybe someone with a better read on it can explain to me exactly what’s happening.

    No, from the PHP docu glob only returns false when it encounters an error. No files found makes it return an empty array. (I don’t have any underscored files and it works for me, too.)

    But I agree with you, those folders should be in there by default. What plugins could be included that could be interesting to everyone? Avatars?


    chrishajer
    Participant

    @chrishajer

    No, not avatars :)

    With WordPress, they include Hello which is an admin only plugin and it serves mostly to show how a plugin is done. It doesn’t affect the public site at all, and it’s not activated either. I would think a similarly benign plugin could be included, just so there is something there.


    chrishajer
    Participant

    @chrishajer

    So, why the PHP error then? Is it related to the PHP version (I think this was happening with PHP version 4.x vs servers with version 5.x)?

    Did anyone review this solution?

    I am currently having this problem as well. The solution of editing line 173 linked to by the above poster has made the errors go away from my main pages, but I still get this error when I go to Admin > Site Management:

    Warning: Invalid argument supplied for foreach() in /homedir/bb-admin/plugins.php on line 7

    In bbPress version 0.8.3.1 open file: bb-admin/plugins.php and find:

    if ( is_callable( 'glob' ) ) {
    foreach ( glob(BBPLUGINDIR . '_*.php') as $_plugin ) {
    $_data = bb_get_plugin_data( $_plugin );
    $_plugins[$_plugin] = $_data ? $_data : true;
    }
    }

    Replace with:

    if ( is_callable( 'glob' ) ) {
    $pluginarray = glob(BBPLUGINDIR . '_*.php');
    if ($pluginarray)
    foreach ( $pluginarray as $_plugin )
    require($_plugin);
    }

    I’m not sure if this will work.


    Sam Bauers
    Participant

    @sambauers

    See the solution in this post. It may fix your problem.

    https://bbpress.org/forums/topic/php-error-messages?replies=10#post-13143

    @Sam Bauers: Thanks, it really works.

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