我使用Laravel在PHP中开发了一个应用程序,我现在想通过VPS部署它。
我已按照DevMarketer's Guide部署该应用程序,并且我也遵循了This Microsoft's SQL Server Tutorial on Ubuntu。
到目前为止,我的应用程序正在出现并在域上执行得很好。但是,在尝试与数据库通信时,我的日志中出现以下错误。
[2017-07-10 14:11:26] local.ERROR: PDOException :在/ var / www / laravel / vendor / laravel / framework / src / Illuminate /中找不到驱动程序数据库/接头/ Connector.php:68
给我以下结果:
Configuration File (php.ini) Path: /etc/php/7.0/cli
Loaded Configuration File: /etc/php/7.0/cli/php.ini
Scan for additional .ini files in: /etc/php/7.0/cli/conf.d
Additional .ini files parsed: /etc/php/7.0/cli/conf.d/10-opcache.ini,
/etc/php/7.0/cli/conf.d/10-pdo.ini,
/etc/php/7.0/cli/conf.d/15-xml.ini,
/etc/php/7.0/cli/conf.d/20-calendar.ini,
/etc/php/7.0/cli/conf.d/20-ctype.ini,
/etc/php/7.0/cli/conf.d/20-dom.ini,
/etc/php/7.0/cli/conf.d/20-exif.ini,
/etc/php/7.0/cli/conf.d/20-fileinfo.ini,
/etc/php/7.0/cli/conf.d/20-ftp.ini,
/etc/php/7.0/cli/conf.d/20-gettext.ini,
/etc/php/7.0/cli/conf.d/20-iconv.ini,
/etc/php/7.0/cli/conf.d/20-json.ini,
/etc/php/7.0/cli/conf.d/20-mbstring.ini,
/etc/php/7.0/cli/conf.d/20-mcrypt.ini,
/etc/php/7.0/cli/conf.d/20-odbc.ini,
/etc/php/7.0/cli/conf.d/20-pdo_odbc.ini,
/etc/php/7.0/cli/conf.d/20-phar.ini,
/etc/php/7.0/cli/conf.d/20-posix.ini,
/etc/php/7.0/cli/conf.d/20-readline.ini,
/etc/php/7.0/cli/conf.d/20-shmop.ini,
/etc/php/7.0/cli/conf.d/20-simplexml.ini,
/etc/php/7.0/cli/conf.d/20-sockets.ini,
/etc/php/7.0/cli/conf.d/20-sysvmsg.ini,
/etc/php/7.0/cli/conf.d/20-sysvsem.ini,
/etc/php/7.0/cli/conf.d/20-sysvshm.ini,
/etc/php/7.0/cli/conf.d/20-tokenizer.ini,
/etc/php/7.0/cli/conf.d/20-wddx.ini,
/etc/php/7.0/cli/conf.d/20-xmlreader.ini,
/etc/php/7.0/cli/conf.d/20-xmlwriter.ini,
/etc/php/7.0/cli/conf.d/20-xsl.ini
当我使用以下
时,指定它可能很有用sqlcmd -S yeah.server.windows.net -U su_root -P sup3rs3qr3t
我得到了
1>
据我了解,这意味着它已成功验证。
但是,我的laravel.log
文件中仍然存在该错误(我在每次运行之前将其清除,因此我知道我没有看到旧的错误)
我也试过php artisan config:clear
并重新启动nginx等。
'default' => env('DB_CONNECTION', 'sqlsrv'),
'connections' => [
'sqlsrv' => [
'driver' => 'sqlsrv',
'host' => env('DB_HOST', 'localhost'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'prefix' => '',
],
];
我很感激你的帮助,
提前谢谢大家。