Seite 1 von 1

Fehlermeldungen in phpBB 3.0.2 mit neuer PHP-Version

Verfasst: 29.10.2013 11:11
von LisaserstesForum
Hi, weil phpBB in Zukunft eine neure PHP-Version als die braucht, die wir hatten, haben wir beim gleichen Anbieter auf einen neuen
Server gewechselt, wo eine aktuelle PHP-Version läuft (5.3.6).
Im aktuellen Forum gibt es keine Probleme, wir haben aber noch das Archivforum, das geschlossen ist und nur noch zum Stöbern von
alten Beiträgen da ist. Dieses läuft mit Version phpBB 3.0.2 und gibt einige Fehlermeldungen aus:
[phpBB Debug] PHP Notice: in file /index.php on line 83: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CET/1.0/no DST' instead
[phpBB Debug] PHP Notice: in file /index.php on line 83: getdate() [function.getdate]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CET/1.0/no DST' instead
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3513: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CET/1.0/no DST' instead
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3673: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3010)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3675: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3010)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3676: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3010)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3677: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3010)
Ich habe mich zuerst mit der "headers already sent"-Fehlermeldung befasst, in der functions.php steht ab Zeile 3672:

Code: Alles auswählen

    // application/xhtml+xml not used because of IE
    header('Content-type: text/html; charset=UTF-8');

    header('Cache-Control: private, no-cache="set-cookie"');
    header('Expires: 0');
    header('Pragma: no-cache');
    if ($user->data['user_accept_rules'] == 0 && $user->data['is_registered'] && !$user->data['is_bot'] && (request_var('mode', '') != 'terms'))
    {
        if (confirm_box(true))
        {
            $sql = 'UPDATE ' . USERS_TABLE . "
                SET user_accept_rules = '1'
                WHERE user_id = " . $user->data['user_id'];
            $db->sql_query($sql);
        }
        else
        {
            confirm_box(false, sprintf($user->lang['NEW_RULES'], '<a href="' . append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=terms') . '">', '</a>'));
            header("Location: " . append_sid("{$phpbb_root_path}ucp.$phpEx?mode=logout&sid=" . $user->session_id));
        }
    }
    return;
} 
Kann ich die Zeilen 3673 bis 3677 einfach raus löschen?


Zur zweiten Fehlermeldung habe ich dieses Thema gefunden: viewtopic.php?f=73&t=201475
Als Lösung steht dort: Set the required setting (date.timezone) in php.ini and these messages will go away.
Wo und wie kann ich das denn einstellen?

Ach, und hier noch der Link zum betroffenen Forum: http://short4u.de/526f8794c6955

Re: Fehlermeldungen in phpBB 3.0.2 mit neuer PHP-Version

Verfasst: 29.10.2013 14:57
von Miriam
Lies es nochmal:
...
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3513: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CET/1.0/no DST' instead
...
Hast Du das mal gelesen? -> KB:debugmode
...und ggf. ausgeschaltet?

Re: Fehlermeldungen in phpBB 3.0.2 mit neuer PHP-Version

Verfasst: 29.10.2013 16:32
von LisaserstesForum
Hi Miriam,

danke für deine Antwort aber ich verstehe nicht genau, was du meinst.
Den Code in der functions.php ab Zeile 3672 habe ich zu diesen Fehlermeldungen heraus gesucht:
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3673: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3010)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3675: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3010)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3676: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3010)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3677: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3010)
Zur anderen Fehlermeldung habe ich ja schon eine Lösung gefunden: Set the required setting (date.timezone) in php.ini and these messages will go away.
Nur weiß ich nicht, was genau ich dort ändern muss.

Re: Fehlermeldungen in phpBB 3.0.2 mit neuer PHP-Version

Verfasst: 29.10.2013 16:38
von Miriam
Die Ursache liegt aber eher hier -> output started at /includes/functions.php:3010

Re: Fehlermeldungen in phpBB 3.0.2 mit neuer PHP-Version

Verfasst: 29.10.2013 16:48
von LisaserstesForum
Achso, da geht es wirklich um den Debugmodus :geek:
Hier (includes/funktions.php) ab 3006:

Code: Alles auswählen

                // remove complete path to installation, with the risk of changing backslashes meant to be there
                $errfile = str_replace(array(phpbb_realpath($phpbb_root_path), '\\'), array('', '/'), $errfile);
                $msg_text = str_replace(array(phpbb_realpath($phpbb_root_path), '\\'), array('', '/'), $msg_text);

                echo '<b>[phpBB Debug] PHP Notice</b>: in file <b>' . $errfile . '</b> on line <b>' . $errline . '</b>: <b>' . $msg_text . '</b><br />' . "\n";
            } 
(3010 ist die Zeile die mit echo beginnt)

Der Debugmodus ist aber ausgeschaltet:

Code: Alles auswählen

@define('PHPBB_INSTALLED', true);
// @define('DEBUG', true);
// @define('DEBUG_EXTRA', true);  

Re: Fehlermeldungen in phpBB 3.0.2 mit neuer PHP-Version

Verfasst: 29.10.2013 16:58
von Miriam
Diesen Hinweis hattest Du gelesen?
Dog Cow hat geschrieben:Alternatively, one may set

Code: Alles auswählen

// Set time zone
    date_default_timezone_set('UTC');
At the top of common.php

Re: Fehlermeldungen in phpBB 3.0.2 mit neuer PHP-Version

Verfasst: 29.10.2013 17:05
von LisaserstesForum
Habe ich eben probiert, die Fehlermeldungen bleiben gleich.
(Cache wurde natürlich geleert)

Re: Fehlermeldungen in phpBB 3.0.2 mit neuer PHP-Version

Verfasst: 29.10.2013 17:09
von Miriam
Zeig mal bitte Deine /includes/functions.php her.

Re: Fehlermeldungen in phpBB 3.0.2 mit neuer PHP-Version

Verfasst: 29.10.2013 17:10
von LisaserstesForum
Kommando zurück, habe es aus Versehen in einen auskommentierten Bereich eingesetzt,
jetzt funktioniert es, danke Miriam.
Kannst du mir vielleicht noch erklären, was das Problem nun war? :)

Re: Fehlermeldungen in phpBB 3.0.2 mit neuer PHP-Version

Verfasst: 29.10.2013 17:55
von Miriam
Also es steht eigentlich alles da:
date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CET/1.0/no DST' instead
Das hast Du mit

Code: Alles auswählen

// Set time zone
    date_default_timezone_set('UTC');
// gern auch: date_default_timezone_set('Europe/Berlin');   
entsprechend den Forderungen umgesetzt, da Du die php.ini nicht anpassen konntest / kannst.