Seite 1 von 3

CAPTCHA-Problem

Verfasst: 23.03.2010 23:58
von max1185
Hallo

Ich hab heute die deutsche Version von phpBB 3.0.7-PL1 heruntergeladen und installiert.
Wenn ich im Admi-Bereich unter "Board-Konfiguration" auf "CAPTCHA-Modul-Einstellungen" klicke, dann bekomme ich die folgende Fehlermeldung:
Deprecated: Assigning the return value of new by reference is deprecated in /users/max1185/www/phpBB3/includes/captcha/plugins/phpbb_captcha_qa_plugin.php on line 104

Deprecated: Assigning the return value of new by reference is deprecated in /users/max1185/www/phpBB3/includes/captcha/plugins/phpbb_captcha_gd_plugin.php on line 55

Deprecated: Assigning the return value of new by reference is deprecated in /users/max1185/www/phpBB3/includes/captcha/plugins/phpbb_captcha_nogd_plugin.php on line 45

Deprecated: Assigning the return value of new by reference is deprecated in /users/max1185/www/phpBB3/includes/captcha/plugins/phpbb_recaptcha_plugin.php on line 54
[phpBB Debug] PHP Notice: in file /adm/index.php on line 150: Cannot modify header information - headers already sent by (output started at /includes/captcha/plugins/phpbb_captcha_qa_plugin.php:104)
[phpBB Debug] PHP Notice: in file /adm/index.php on line 152: Cannot modify header information - headers already sent by (output started at /includes/captcha/plugins/phpbb_captcha_qa_plugin.php:104)
[phpBB Debug] PHP Notice: in file /adm/index.php on line 153: Cannot modify header information - headers already sent by (output started at /includes/captcha/plugins/phpbb_captcha_qa_plugin.php:104)
[phpBB Debug] PHP Notice: in file /adm/index.php on line 154: Cannot modify header information - headers already sent by (output started at /includes/captcha/plugins/phpbb_captcha_qa_plugin.php:104)
Eine ähnliche Fehlermeldung bekomme ich, wenn sich ein neuer Benutzer registrieren will (nach der Seite mit der Lizenzvereinbarung, wo sich das Captcha befindet):
Deprecated: Assigning the return value of new by reference is deprecated in /users/max1185/www/phpBB3/includes/captcha/plugins/phpbb_captcha_gd_plugin.php on line 55
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4284: Cannot modify header information - headers already sent by (output started at /includes/captcha/plugins/phpbb_captcha_gd_plugin.php:55)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4286: Cannot modify header information - headers already sent by (output started at /includes/captcha/plugins/phpbb_captcha_gd_plugin.php:55)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4287: Cannot modify header information - headers already sent by (output started at /includes/captcha/plugins/phpbb_captcha_gd_plugin.php:55)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4288: Cannot modify header information - headers already sent by (output started at /includes/captcha/plugins/phpbb_captcha_gd_plugin.php:55)
Kann mir jemand bei diesem Problem helfen?

Gruß, Max

Re: CAPTCHA-Problem

Verfasst: 24.03.2010 00:02
von Mahony
Hallo
Schau mal hier viewtopic.php?p=1168429#p1168429 oder hier viewtopic.php?p=1166075#p1166075

Grüße: Mahony

Re: CAPTCHA-Problem

Verfasst: 24.03.2010 01:09
von max1185
Danke Mahony :grin:

Ich kann es kaum glauben! Nachdem ich in jeder Fehlermeldung an der entsprechenden Position die Textstellen durch ersetzt habe, sind die Fehlermeldungen weg und die Captcha-Funktion funktioniert wieder.

Jetzt frage ich mich nur, wieso dieser Fehler nicht in der aktuellen Version behoben wurde?! Immerhin taucht er anscheinend des öfteren auf!

Gruß, Max

Re: CAPTCHA-Problem

Verfasst: 24.03.2010 01:40
von Mahony
Hallo
Du verwendest eine neuere PHP-Version (5.3). Dort gibt es neue error levels: E_DEPRECATED und E_USER_DEPRECATED
sowie Deprecated features:
* Assigning the return value of new by reference is now deprecated.
* Call-time pass-by-reference is now deprecated.
* The use of {} to access string offsets is deprecated. Use [] instead.


Man könnte ja vielleicht so eine Abfrage einbauen

Code: Alles auswählen

function &get_instance()
    {
        if (strnatcmp(phpversion(),'5.3.0') <= 0)
        {
            $instance =& new phpbb_captcha_gd();
            return $instance;
        }
        else
        {
            $instance = new phpbb_captcha_gd();
            return $instance;
        }
    } 
Edit: Die Fehlermeldung bekommt man anscheinend nur, wenn die GD Library nicht korrekt funktioniert. Ich konnte den Fehler auf einem Testsystem (PHP Version 5.3.1) mit korrekt implementierter GD Library (GD Version bundled (2.0.34 compatible) ) nicht nachvollziehen.
Es ist also nicht wirklich ein phpBB3.0.7-PL1 Problem.
Das Problem liegt demnach beim Hoster.


Grüße: Mahony

Re: CAPTCHA-Problem

Verfasst: 24.03.2010 10:12
von max1185
Danke Mahony für die Erklärung des Problems!

Den PHP-Code so umzuschreiben, wie du es gezeigt hattest, hat das Problem leider nicht gelöst.

Ich verwende einen kostenlosen Webhoster von http://www.bplaced.net/ und hab ebenfalls das gleiche Problem auf dem Webhoster http://www.square7.ch/ festgestellt. Wenn die "GD Library" die Fehlerquelle ist, dann hab wahrscheinlich keine Möglichkeit das Problem sauber zu lösen, als das Ersetzen der entsprechenden PHP-Code-Teile mit durch Nochmals Danke
Gruß, Max

Re: CAPTCHA-Problem

Verfasst: 26.03.2010 14:47
von Mahony
Hallo
Ich habe den Code oben noch einmal geändert (die Syntax war nicht korrekt).

Versuch mal, ob es so funktioniert.

Suche

Code: Alles auswählen

function &get_instance()
    {
        $instance =& new phpbb_captcha_gd();
        return $instance;
    } 
Ersetze mit

Code: Alles auswählen

function &get_instance()
    {
        if (strnatcmp(phpversion(),'5.3.0') <= 0)
        {
            $instance =& new phpbb_captcha_gd();
            return $instance;
        }
        else
        {
            $instance = new phpbb_captcha_gd();
            return $instance;
        }
    } 
Somit sollte das in den PHP-Versionen 4.x.x und 5.3.x funktionieren und es sollte keine Fehlermeldung mehr erscheinen.


Grüße: Mahony

Re: CAPTCHA-Problem

Verfasst: 27.03.2010 17:31
von chrsla
Hallo,

also bei mir kommt die Fehlermeldung immer noch, selbst wenn ich deine Änderung nehme.

EDIT: Ich habs gelöst nachdem ich mal im Supportforum des Hosters nachgelesen habe. Ich habe einfach das & entfernt. Meine Frage ist nun. Warum wird das von phpbb benötigt und warum kann das phpbb Team die Zeile nicht mitändern?

Mir gefällt das nicht das ich hier extra für den Hoster die Zeile abändern musste ohne jeglichen Grund. Kann mir jemand erklären warum das & da ist?

Re: CAPTCHA-Problem

Verfasst: 27.03.2010 17:49
von nickvergessen
Mach einfach ein Update auf die neueste phpBB Version, dann verschwindet die Meldung.

Re: CAPTCHA-Problem

Verfasst: 27.03.2010 20:05
von chrsla
Ach ne? Ich habe doch das aktuelle Paket heruntergeladen und installiert ;-)
Ich habe eine frische Installation gemacht und da kam der Fehler.
Also ist das deutsche Paket fehlerhaft?

Re: CAPTCHA-Problem

Verfasst: 02.04.2010 14:37
von nickvergessen
Wenn das Problem immer noch besteht, könntet ihr mal 2 sachen machen:
  1. Gucken ob in der common.php folgender Code-Abschnitt drin ist:

    Code: Alles auswählen

    // Report all errors, except notices and deprecation messages
    if (!defined('E_DEPRECATED'))
    {
    	define('E_DEPRECATED', 8192);
    }
    error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED);
  2. Eure php-Info posten, damit man mal versuchen kann das nach zustellen.