Fatal error in Exception with PHP 7.1 and Yii 2.0.11.1

Error:

Fatal error: in D:\webroot\sri3\vendor\yiisoft\yii2\db\Schema.php on line 636





       try {


           $dbcom1 = \Yii::$app->db->createCommand( $sSqlC. $sSql );


            $rs1 = $dbcom1->queryOne(); --> this line raise the Exception

       ...

       ...

        } catch( Exception $e ) {


            $sMsg = $e->getMessage() . $sSql;

            $nErro = 1;

        }







yiisoft\yii2\db\Schema.php

/**

     * Converts a DB exception to a more concrete one if possible.

     *

     * @param \Exception $e

     * @param string $rawSql SQL that produced exception

     * @return Exception

     */

    public function convertException(\Exception $e, $rawSql)

    {

        if ($e instanceof Exception) {

            return $e;

        }


        $exceptionClass = '\yii\db\Exception';

        foreach ($this->exceptionMap as $error => $class) {

            if (strpos($e->getMessage(), $error) !== false) {

                $exceptionClass = $class;

            }

        }

        $message = $e->getMessage()  . "\nThe SQL being executed was: $rawSql";

        $errorInfo = $e instanceof \PDOException ? $e->errorInfo : null;

        return new $exceptionClass($message, $errorInfo, (int) $e->getCode(), $e); -->Line 636

    }



How to solve?

My php is :

PHP 7.1.0 (cli) (built: Dec 2 2016 05:24:57) ( ZTS MSVC14 (Visual C++ 2015) x64 )

Copyright © 1997-2016 The PHP Group

Zend Engine v3.1.0-dev, Copyright © 1998-2016 Zend Technologies

The query runs ok direct in the database.

I print the $message = $e->getMessage() in line 634.

Exist an error in the query, table or view does not exist.

I update the yii2 to 2.0.11.2

The error persist, all db exections has de same error

Php 5.6.22 same error.

Searching for a older version os Yii 2, i find the 2.0.2, tha has the same method, with the same code.

I reinstall php completely and is working now.

I dont know whats is happening