Zend Framework 2 : Working with SQL Server
In some situation, work on windows environment is not as easy as you’ve imagine. SQL Server is a powerfull database platform with complex features and it means complex requirements too. In this post, I will show you step by step to work with.
1. Install Your SQL Server
2. Download SqlSrv extension for PHP, you can download from http://www.microsoft.com/en-us/download/details.aspx?id=20098 , I’m prefer using *V30.EXE
3. Run the executable file, and you will find an input which show message “Please type the location where you want to place the extacted files. : “, fill in with your php ext directory.
4. Download Microsoft® SQL Server® 2012 Native Client here : http://www.microsoft.com/en-us/download/details.aspx?id=29065 and install the lib. ( choose between X64 Package (sqlncli.msi) or X86 Package (sqlncli.msi) ).
5. Register SqlSrv extension into php extension in php.ini
// or 54 based on your php version extension=php_sqlsrv_53_ts.dll
6. Restart your web server
7. Configure your db adapter
'db' => array( 'driver' => 'Sqlsrv', 'server' => 'ACER-PC', 'Database' => 'YourDB', 'USER' => 'sa', //if you're using sa 'password' => 'yourpassword' );
Done !, let’s run.
Note : It’s work for SQL Server 2008.