Search code examples
phplaravellaravel-5.3

Laravel 5.3 query builder error with MSSQL


new install laravel error when using DB:select the backtrace is

FatalErrorException in SqlServerConnection.php line 13:

Declaration of Illuminate\Database\SqlServerConnection::transaction(Closure $callback) must be compatible with 

Illuminate\Database\ConnectionInterface::transaction(Closure $callback, $attempts = 1)

My setup is PHP 7.0 , laravel 5.3, ubuntu server 16.04, apache2.

The code just as simple in routes/web.php as :

Route::get('/', function () { DB::select('select @@version'); }); 

Yup they work on 5.2. It also run artisan migrate on 5.2 with success. Now i wanna update laravel to 5.3. Even fresh install give me the same error


Solution

  • This is a known bug in 5.3 and will be fixed in 5.3.1 See also: https://github.com/laravel/framework/issues/14992#issuecomment-242006433