mardi 30 mai 2017

could not find driver laravel sqlsrv

I have enabled sqlsrv and postgree extensions

Default connection is sqlsrv

.env configs

DB_CONNECTION=sqlsrv
DB_HOST=00.00.000.000
DB_PORT=1433
DB_DATABASE=DBNAME
DB_USERNAME=USER
DB_PASSWORD=5555555

Wrote following code for just checking is it working but the code thrown an error "could not find the driver"

Route::get('/',function (){
    dd(DB::connection()->getPdo());
    try {
        DB::connection()->getPdo();

        if(DB::connection()->getDatabaseName()){
            echo "Yes! Successfully connected to the DB: " . DB::connection()->getDatabaseName();
        }
    } catch (\Exception $e) {
        die("Could not connect to the database.  Please check your configuration.");
    }
});

enter image description here



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire