pdo exception driver not found in laravel for sqli

2019-06-16 05:54发布

when i run php artisan migrate command i got [PDOException] could not find driver .I made my default database as sqlite and checked whether there are pdo privers for sqlite using php -i command.I couldnot understand my problem.please help me.Thanks in advance.

4条回答
走好不送
2楼-- · 2019-06-16 06:11

If you are using sqlite and try to alter a table or drop a column you have to require doctrine/dbal, as suggested in the Laravel docs.

Just do a composer require doctrine/dbal and retry your migration.

查看更多
相关推荐>>
3楼-- · 2019-06-16 06:12

I'm using Laravel 5.3 and I had to comment out some params in .env file.

DB_CONNECTION=sqlite
# DB_HOST=127.0.0.1
# DB_PORT=3306
# DB_DATABASE=homestead
# DB_USERNAME=homestead
# DB_PASSWORD=secret
查看更多
Bombasti
4楼-- · 2019-06-16 06:14

Your system has missing php SQLite installation.

Install it by using:

sudo apt-get install php7.0-sqlite

Then restart your apache server

sudo /opt/lampp/lampp restart
查看更多
别忘想泡老子
5楼-- · 2019-06-16 06:22

You need to install PDO on your server, or you might have to just comment out the following line in your php.ini file.

;extension=pdo_sqlite

(remove the ; character)

You should then restart your server.

查看更多
登录 后发表回答