wBB 3.1 auf PHP 7 zum Laufen bringen?

Shorty1968

Erfahrenes Mitglied
Hallo,
ich betreibe noch ein wBB3 und möchte es mit PHP7 zum Laufen bringen,leider bekomme ich bei PHP7 folgenden Fehler.
Code:
Fatal error: Uncaught TypeError: Argument 1 passed to WCF::handleException() must be an instance of Exception, 
instance of Error given in /var/www/vhosts/wbb-support24.de/httpdocs/wcf/lib/system/WCF.class.php:254 Stack trace: 
#0 [internal function]: WCF::handleException(Object(Error)) #1 {main} thrown in /var/www/vhosts/wbb-support24.de/httpdocs/wcf/lib/system/WCF.class.php on line 254
Zeile 252-261 in WCF.class.php
Code:
* @param    Exception    $e    
     */
    public static final function handleException(Exception $e) {
        if ($e instanceof PrintableException) {
            $e->show();
            exit;
        }
        
        print $e;
    }
[/cxode]
Was bedeutet das und wie kann ich es beheben?
 
Hi Shorty,
der Fehler liegt nicht direkt hier sondern eher ein oder 2 Schritte vor diesen.
Könntest du einmal bitte den Kompletten Stack Trace posten?
 
Ich weiss nun leider nicht welchen Teil du genau meinst und Poste nun mal die Zeilen 222-297
Code:
/**
     * Returns the language object.
     * 
     * @return     Language
     */
    public static final function getLanguage() {
        return self::$languageObj;
    }
    
    /**
     * Returns the template object.
     * 
     * @return    Template
     */
    public static final function getTPL() {
        return self::$tplObj;
    }
    
    /**
     * Returns the active request object.
     *
     * @return    RequestHandler
     */
    public static final function getRequest() {
        return RequestHandler::getActiveRequest();
    }
    
    /**
     * Calls the show method on the given exception.
     * 
     * @param    Exception    $e    
     */
    public static final function handleException(Exception $e) {
        if ($e instanceof PrintableException) {
            $e->show();
            exit;
        }
        
        print $e;
    }
    
    /**
     * Catches php errors and throws instead a system exception.
     * 
     * @param    integer        $errorNo
     * @param    string        $message
     * @param    string        $filename
     * @param    integer        $lineNo
     */
    public static final function handleError($errorNo, $message, $filename, $lineNo) { 
        if (error_reporting() != 0) {
            $type = 'error';
            switch ($errorNo) {
                case 2: $type = 'warning';
                    break;
                case 8: $type = 'notice';
                    break;
            }
            
            throw new SystemException('PHP '.$type.' in file '.$filename.' ('.$lineNo.'): '.$message, 0);
        }
    }
    
    /**
     * Loads the database configuration and creates a new connection to the database.
     */
    protected function initDB() {
        // get configuration
        $dbHost = $dbUser = $dbPassword = $dbName = $dbCharset = '';
        $dbClass = 'MySQLDatabase';
        require_once(WCF_DIR.'config.inc.php');
        
        // create database connection
        require_once(WCF_DIR.'lib/system/database/'.$dbClass.'.class.php');
        self::$dbObj = new $dbClass($dbHost, $dbUser, $dbPassword, $dbName, $dbCharset);
    }
 
Nein das nützt leider nichts,
Hast du bei dein ersten Post die Komplette Fehlermeldung gepostet?
Da müsste eigentlich noch mehr sein.

Code:
#0 [internal function]: WCF::handleException(Object(Error)) #1 {main} thrown in /var/www/vhosts/wbb-support24.de/httpdocs/wcf/lib/system/WCF.class.php on line 254
Dahinter müssten noch weitere Schritte stehen.
 
Wo vielleicht noch etwas mehr steht sind die Error-Logs auf dem Webserver, dies hängt allerdings von den Einstellungen des Servers ab.

Ansonsten bleibt nur das du alle Dateien nach "handleException" durchsuchen lässt und dann muss man Irgendwo scheint in den Aufruf eine Klasseninstanz von einer Klasse die von der Error-Klasse erben übergeben zu sein anstelle von einer die von Exception erbt.
 
Ok vielen dank das scheint ja wohl ein grösserer aufwand zu werden als ich dachte,leider hat WoltLab den Support für das wbb3 ganz eingestellt.
 
Hallo basti1012
ja leider genau so ist es und WoltLab support dazu nicht mehr,wer ein wBB3 mit php7 betreiben möchte muss zusehen wie er das selber hin bekommt.
 
Zurück