1

I'm trying to run laravel 5.4 on localhost php 5.6 using XAMPP with these laravel .env configurations

DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=dbname_here
DB_USERNAME=root
DB_PASSWORD=

But I get QueryException could not find driver (SQL: select * from sessions

In log file

local.ERROR: PDOException: could not find driver in D:\xampp\htdocs\laravel\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\PDOConnection.php:43
Stack trace:
#0 D:\xampp\htdocs\laravel\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\PDOConnection.php(43): PDO->__construct('mysql:host=loca...', 'root', '', Array)

But PDO is already installed

I tried to clear the cache but that didn't solve the problem. Any ideas?

[update]

After an edit by changing "SESSION_DRIVER=file" Now I get

FatalThrowableError
Call to undefined function openssl_encrypt()

local.ERROR: Symfony\Component\Debug\Exception\FatalThrowableError: Call to undefined function openssl_encrypt() in D:\xampp\htdocs\laravel\vendor\laravel\framework\src\Illuminate\Encryption\Encrypter.php:78
Stack trace:
#0 D:\xampp\htdocs\laravel\vendor\laravel\framework\src\Illuminate\Session\EncryptedStore.php(57): Illuminate\Encryption\Encrypter->encrypt('a:3:{s:6:"_toke...')
PHP User
  • 2,350
  • 6
  • 46
  • 87

1 Answers1

0

Might be the issue of missing dependency. Try the following command:

composer require doctrine/dbal

and also comment-out the following line in your php.ini file:

;extension=pdo_mysql.so

Laravel 5 PDOException Could Not Find Driver

Also, if you haven't installed php-mysql driver, install it with following command (depending on PHP version):

sudo apt-get install php7.0-mysql
TalESid
  • 2,304
  • 1
  • 20
  • 41