我在只能访问MySQL和FTP的服务器上开发网站,因此我运行的所有命令都是通过b374k php shell进行的。我在使用SQL驱动程序时遇到Laravel问题。我尝试切换到文件托管的SQLite(在database / database.sqlite中),但是引发的异常与使用MySQL时相同。控制台的输入和输出如下:
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扩展为:
/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)
如果可以,请运行:
composer update composer require doctrine/dbal
看起来您缺少依赖项
编辑:
您可能需要在php.ini文件中注释掉以下内容。
;extension=pdo_mysql.so
摘自这篇文章: Laravel 5 PDOException无法找到驱动程序 。我认为在数字海洋上设置laravel时必须做完全像这样的事情。