Connect to SQL Server

Posted 7 months ago by camunha

Hi. I have a issue with connection to sql server in Laravel. I have a XAMPP server in windows 10. I have all pdo drivers. My php.info says this:

        PDO

PDO support enabled PDO drivers mysql, odbc, sqlite, sqlsrv

        pdo_mysql

PDO Driver for MySQL enabled Client API version mysqlnd 5.0.12...........

        PDO_ODBC

PDO Driver for ODBC (Win32) enabled ODBC Connection Pooling Enabled, strict matching

        pdo_sqlite

PDO Driver for SQLite 3.x enabled SQLite Library 3.15.1

        pdo_sqlsrv

pdo_sqlsrv support enabled ExtensionVer 5.2.0+10712

Directive Local Value Master Value pdo_sqlsrv.client_buffer_max_kb_size 10240 10240 pdo_sqlsrv.log_severity 0 0

But when I try to connect I get error "PDOException: could not find driver". Dsn in PDO construct is "sqlsrv:Server=127.0.0.1,1433;Database=DataBaseName".

And if I try to connect by ODBC driver I get same error.

I'm executing a command with 'php artisan migracion:centros > "NULL" 2>&1 &'

Please sign in or create an account to participate in this conversation.

Laracasts Mascot

Hi, Have We Met Yet?

Did you know that, in addition to the forum, Laracasts includes well over 1000 lessons on modern web development? All for the price of one lunch out per month.

Sign Me Up

Channels

Reply to

Use Markdown with GitHub-flavored code blocks.