Laravel:PDOException:找不到驱动程序 [英] Laravel: PDOException: could not find driver

查看:38
本文介绍了Laravel:PDOException:找不到驱动程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在服务器上开发一个网站,我只能访问 MySQL 和 FTP,所以我运行的所有命令都是通过 b374k php shell 进行的.我遇到了 SQL 驱动程序的 Laravel 问题.我尝试切换到文件托管的 SQLite(在 database/database.sqlite 中),但抛出的异常与使用 MySQL 时相同.输入 &控制台输出如下:

I am developing a website on a server I only have access to MySQL and FTP, so all commands I run are through the b374k php shell . I am experiencing a Laravel problem with SQL driver. I tried switching to file-hosted SQLite (in database/database.sqlite), but the thrown exception is the same as when using MySQL. The input & output of the console is as follows:

   php artisan migrate:refresh --seed
    [Illuminate\Database\QueryException]
could not find driver (SQL: select * from sqlite_master where type = 'table ' and name = migrations)
 [Doctrine\DBAL\Driver\PDOException]
could not find driver
 [PDOException]
could not find driver

服务器上安装的Apache扩展是:

The Apache extensions installed on the server are:

    /etc/php/5.6/apache2/conf.d/10-mysqlnd.ini, 
/etc/php/5.6/apache2/conf.d/10-opcache.ini,
 /etc/php/5.6/apache2/conf.d/10-pdo.ini,
 /etc/php/5.6/apache2/conf.d/15-xml.ini, 
/etc/php/5.6/apache2/conf.d/20-calendar.ini,
 /etc/php/5.6/apache2/conf.d/20-ctype.ini, 
/etc/php/5.6/apache2/conf.d/20-curl.ini,
 /etc/php/5.6/apache2/conf.d/20-dom.ini, 
/etc/php/5.6/apache2/conf.d/20-exif.ini, 
/etc/php/5.6/apache2/conf.d/20-fileinfo.ini, 
/etc/php/5.6/apache2/conf.d/20-ftp.ini, /etc/php/5.6/apache2/conf.d/20-gd.ini, 
/etc/php/5.6/apache2/conf.d/20-gettext.ini, 
/etc/php/5.6/apache2/conf.d/20-iconv.ini, 
/etc/php/5.6/apache2/conf.d/20-json.ini, 
/etc/php/5.6/apache2/conf.d/20-mbstring.ini, 
/etc/php/5.6/apache2/conf.d/20-mcrypt.ini, 
/etc/php/5.6/apache2/conf.d/20-mysql.ini, 
/etc/php/5.6/apache2/conf.d/20-mysqli.ini, 
/etc/php/5.6/apache2/conf.d/20-pdo_mysql.ini,
 /etc/php/5.6/apache2/conf.d/20-phar.ini, 
/etc/php/5.6/apache2/conf.d/20-posix.ini, 
/etc/php/5.6/apache2/conf.d/20-readline.ini, 
/etc/php/5.6/apache2/conf.d/20-shmop.ini, 
/etc/php/5.6/apache2/conf.d/20-simplexml.ini, 
/etc/php/5.6/apache2/conf.d/20-sockets.ini,
 /etc/php/5.6/apache2/conf.d/20-sysvmsg.ini,
 /etc/php/5.6/apache2/conf.d/20-sysvsem.ini,
 /etc/php/5.6/apache2/conf.d/20-sysvshm.ini,
 /etc/php/5.6/apache2/conf.d/20-tokenizer.ini, 
/etc/php/5.6/apache2/conf.d/20-wddx.ini,
 /etc/php/5.6/apache2/conf.d/20-xmlreader.ini, 
/etc/php/5.6/apache2/conf.d/20-xmlwriter.ini, 
/etc/php/5.6/apache2/conf.d/20-xsl.ini, 
/etc/php/5.6/apache2/conf.d/20-zip.ini

可能是什么问题,我该如何解决?(我无权访问 root bash)

What can be the problem and how can I fix it? (I don't have access to root bash)

推荐答案

您的数据库驱动程序丢失.解决问题

Your database driver is missing. To solve the probelm

先安装驱动

对于 ubuntu:对于 mysql 数据库.

For ubuntu: For mysql database.

sudo apt-get install php5.6-mysql/php7.2-mysql

您还可以搜索其他数据库系统.

You also can search for other database systems.

您也可以搜索驱动程序:

You also can search for the driver:

sudo apt-cache search drivername

然后运行cmd php artisan migrate

这篇关于Laravel:PDOException:找不到驱动程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆