1

I've developed an application in PHP using Laravel, which I now want to deploy via a VPS.

I've followed DevMarketer's Guide to deploy the application, and I've also followed This Microsoft's SQL Server Tutorial on Ubuntu.

So far, my application is appearing and executing just fine on the domain. However, upon trying to communicate with the database, I get the following error in my log.

[2017-07-10 14:11:26] local.ERROR: PDOException: could not find driver in /var/www/laravel/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:68

PHP --ini

Gives me the following result:

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

It may be useful to specify that when I use the following

sqlcmd -S yeah.server.windows.net -U su_root -P sup3rs3qr3t

I get a

1>

Which as I understand it means it authenticated successfully.

However, that error persists in my laravel.log file (I clear it before every run so I know I'm not seeing an old error)

I've also tried php artisan config:clear and restarting nginx etc.

config/Database.php

'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'   => '',
],
];

I'd appreciate a bit of help,

thank you all in advance.

4
  • stackoverflow.com/questions/12594945/… check if you have the pdo installed (and enabled in php.ini) Commented Jul 10, 2017 at 14:27
  • Check your config/database.php file. No driver could be referring to not having your database config in there. Commented Jul 10, 2017 at 14:33
  • @Styphon I've updated the post at the bottom. Commented Jul 10, 2017 at 14:39
  • @katona.abel - That post is referring to Php5 modules, though. Besides, had the driver not been installed, I doubt command line would work as it does? Commented Jul 10, 2017 at 14:40

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.