Skip to:
Content
Pages
Categories
Search
Top
Bottom

PHP Error Messages

  • My installation page shows the following error messages at the top:

    “PHP Error Message

    Warning: Invalid argument supplied for foreach() in /home/a9286564/public_html/x/forum/bb-settings.php on line 169

    PHP Error Message

    Warning: Cannot modify header information – headers already sent by (output started at /home/a9286564/public_html/x/forum/bb-settings.php:169) in /home/a9286564/public_html/x/forum/bb-admin/install.php on line 10

    PHP Error Message

    Warning: Cannot modify header information – headers already sent by (output started at /home/a9286564/public_html/x/forum/bb-settings.php:169) in /home/a9286564/public_html/x/forum/bb-includes/functions.php on line 1910″

    The only file I edited was the config.php, I tried to set everything up according to the instructions, here’s what I put in the file (minus my database info and email):

    “<?php

    // ** MySQL settings ** //

    define(‘BBDB_NAME’, ‘*my db name*’); // The name of the database

    define(‘BBDB_USER’, ‘*my user name*’); // Your MySQL username

    define(‘BBDB_PASSWORD’, ‘*my password*’); // …and password

    define(‘BBDB_HOST’, ‘localhost’); // 99% chance you won’t need to

    change these last few

    define(‘BBDB_CHARSET’, ‘utf8’); // If you are *upgrading*, and your

    old config.php does

    define(‘BBDB_COLLATE’, ”); // not have these two contstants in

    them, DO NOT define them

    // If you are installing for the

    first time, leave them here

    // Change the prefix if you want to have multiple forums in a single

    database.

    $bb_table_prefix = ‘bb_’; // Only letters, numbers and underscores

    please!

    // The full URL of your bbPress install

    $bb->uri = ‘http://xynson.890m.com/x/forum&#8217;;

    // What are you going to call me?

    $bb->name = ‘New bbPress Site’;

    // This must be set before you run the install script.

    $bb->admin_email = ‘*my email*’;

    // Set to true if you want pretty permalinks, set to ‘slugs’ if you want

    to use slug based pretty permalinks.

    $bb->mod_rewrite = slugs;

    // The number of topics that show on each page.

    $bb->page_topics = 30;

    // A user can edit a post for this many minutes after submitting.

    $bb->edit_lock = 60;

    // Your timezone offset. Example: -7 for Pacific Daylight Time.

    $bb->gmt_offset = -5;

    // Change this to localize bbPress. A corresponding MO file for the

    // chosen language must be installed to bb-includes/languages.

    // For example, install de.mo to bb-includes/languages and set BBLANG to

    ‘de’

    // to enable German language support.

    define(‘BBLANG’, ”);

    // Your Akismet Key. You do not need a key to run bbPress, but if you

    want to take advantage

    // of Akismet’s powerful spam blocking, you’ll need one. You can get an

    Akismet key at

    // http://wordpress.com/api-keys/

    $bb->akismet_key = ”; // Example: ‘0123456789ab’

    // The rest is only useful if you are integrating bbPress with

    WordPress.

    // If you’re not, just leave it as it is.

    $bb->wp_table_prefix = ‘wp_’; // WordPress table prefix. Example:

    ‘wp_’;

    $bb->wp_home = ‘http://xynson.890m.com/x&#8217;; // WordPress –

    Options->General: Blog address (URL) // Example: ‘http://example.com&#8217;

    $bb->wp_siteurl = ‘http://xynson.890m.com/x&#8217;; // WordPress –

    Options->General: WordPress address (URL) // Example:

    http://example.com&#8217;

    /* Stop editing */

    if ( !defined(‘BBPATH’) )

    define(‘BBPATH’, dirname(__FILE__) . ‘/’ );

    require_once( BBPATH . ‘bb-settings.php’ );

    ?>”

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

  • chrishajer
    Participant

    @chrishajer

    What version are you using? In the trunk, line 169 of bb-settings.php does not have a foreach statement, so maybe you’re using something other than the trunk release?

    That error is related to not having a my-plugins folder and I think possibly not having any plugins in that folder that start with an underscore.

    This was talked about a couple times:

    https://bbpress.org/forums/topic/warning-invalid-argument-supplied-for-foreach-in-bb-settingsphp-on-line-173

    https://bbpress.org/forums/topic/installation-problem-cannot-modify-header-information

    https://bbpress.org/forums/topic/php-error-site-mangement-plugins-page

    I thought the latest 0.8.3.1 release took care of that, but maybe it doesn’t.

    If it were me, I would try creating a my-plugins directory, and then making sure there were some plugins in that folder.

    Since I couldn’t find any plugins starting with an underscore, I made a blank one that i called “_nothing.php”, and that worked. Thanks.


    chrishajer
    Participant

    @chrishajer

    Yeah, I wish this were fixed in the 0.8.3.1 release but apparently, it’s not. This has been reported 3 or 4 times. Maybe the developers are using installations that always have their favorite plugins or something so they don’t see this error. Or maybe their PHP version handles it differently.

    Glad you got it working in any case


    Sam Bauers
    Participant

    @sambauers

    > This has been reported 3 or 4 times.

    Can you link to the Trac tickets? I’ve never experienced this issue. With or without a plugins folder.


    chrishajer
    Participant

    @chrishajer

    Sam, there are no trac tickets that I know of, just forum reports. I’ve already provided links to those. I hesitate to create a trac ticket myself since I have not experienced it first hand. I suspect the developers haven’t either, which is why it appears to still be happening.

    Maybe instead of trying to recreate the problem, someone can look at lines 168 – 172 in bb-settings.php and see if the warning thrown on line 169 has a good reason. It certainly seems to be related to a missing my_plugins or bb-plugins folder, and no underscore plugins. I thought there was a difference between PHP4 and PHP5 at some point, but maybe that’s a red herring.

    Also, since it’s just a warning, maybe it’s not really a hard error, just a warning, but the server is configured to show warnings, thus the warning comes first and then you get the “cannot modify header information” because the warning came first. Maybe the server needs to be configured to show warnings for this to happen? Is there an .htaccess directive to force PHP to show warnings, or maybe another way to test this?

    (BTW, I just checked out 0.8.3.1 and configured my server to use PHP4 and I do not have this error. In the stock install, there is no my-plugins or bb-plugins folder. So, maybe it is throwing a warning but my server is not configured to show them?)


    chrishajer
    Participant

    @chrishajer

    My server does not allow these overrides in the .htaccess to turn off error reporting. Maybe someone else’s server will?

    # suppress php errors
    php_flag display_startup_errors off
    php_flag display_errors off
    php_flag html_errors off

     

    Not sure if that suppresses all errors, or just errors and not warnings, or what. Didn’t work on my server :)

    I got that information here:

    http://perishablepress.com/press/2007/12/17/how-to-enable-php-error-logging-via-htaccess/


    Sam Bauers
    Participant

    @sambauers

    Change line 168 of bb-settings.php to

    if ( function_exists( 'glob' ) && is_callable( 'glob' ) )

    .

    Also, change line 6 of bb-admin/plugins.php to (note curly brace at the end)

    if ( function_exists( 'glob' ) && is_callable( 'glob' ) ) {

    .

    I suspect the version of PHP where the problem is occurring is less than 4.3.0

    Either that or the “glob” function is disabled by the system administrator.


    Sam Bauers
    Participant

    @sambauers

    This is fixed in the latest trunk by the way.


    chrishajer
    Participant

    @chrishajer

    I saw r1012 today with that fix. Thanks. I thought I heard it was a PHP version thing before, but never really confirmed it.


    j8h9
    Participant

    @j8h9

    First install failed due to this error. Why can’t they put the fix in the version I’m downloading. Geez. Back to phpbb.


    Sam Bauers
    Participant

    @sambauers

    @j8h9

    I’ve got 3 fixes for you to choose from:

    1. Make the above changes

    2. Upgrade the version of PHP you are using

    3. Download the current trunk (rev 1071) here

    Or go back to phpbb, your choice.

    : )


    j8h9
    Participant

    @j8h9

    Thank you


    j8h9
    Participant

    @j8h9

    Installed trunk. Get this…

    Warning: Invalid argument supplied for foreach() in /home/bl/public_html/forum/bb-settings.php on line 294

    Warning: Cannot modify header information – headers already sent by (output started at /home/bl/public_html/forum/bb-settings.php:294) in /home/bl/public_html/forum/bb-includes/pluggable.php on line 193

    Warning: Cannot modify header information – headers already sent by (output started at /home/bl/public_html/forum/bb-settings.php:294) in /home/bl/public_html/forum/bb-includes/pluggable.php on line 231

    I am getting this error

    Warning: Cannot modify header information – headers already sent by (output started at /home/content/h/e/r/heroalliance/html/bbpress/config.php:64) in /home/content/h/e/r/heroalliance/html/bbpress/bb-includes/pluggable.php on line 164

    I am using PHP5


    chrishajer
    Participant

    @chrishajer

    I don’t think the trunk release is reliable for installations at this point.

    Changeset 1076 (aka “this will break everything”)

    You should probably install an .8.3.1 release or possibly a revision after .8.3.1 but not the latest trunk. There was a post from sambauers regarding which revision would be best to check out, I think it was revision r980.

    https://bbpress.org/forums/topic/broken-profiles-for-users-with-spaces-in-the-names?replies=5#post-12769

    this did not fix my problem, I’m still getting the same errors.


    chrishajer
    Participant

    @chrishajer

    suleiman: please start a new thread with your specific problem listed there, with a link to your forum. Thanks.

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