I need to connect a SQL Server 2008 database in Laravel 4. I've been searching and found no solution to the scenario I'm in.
I'm using Laravel using the XAMPP (PHP 5.5.6 --with-mssql) package on MAC OS X 10.9 with FreeTDS running perfectly when I use the mssql_ * functions of php in other applications where I do not use Laravel.
When I make a simple query to BD SQL I get the following error:
PDOException: could not find driver
My configuration in /app/database.php looks like this:
'default' => 'sqlsrv',
'sqlsrv' => array( 'driver' => 'sqlsrv', 'host' => 'ip do servidor', 'database' => 'nome da base', 'username' => 'sa', 'password' => 'senha', 'prefix' => '', ),
[Edited]
In php.ini, I uncommented the line:
extension=php_pdo_mssql.dll
However, by checking the PHP documentation I found the information: "The PDO_SQLSRV extension is only compatible with PHP running on Windows. For Linux, see ODBC and» Microsoft SQL Server ODBC Driver for Linux. ", ie I have to use the connection through an ODBC Driver? Can not I use FreeTDS in Laravel?
I upgraded Native Client on Server with SQL 2008 to version 11.
I'm still unsuccessful. Could someone help me?