Add SQLSRV driver support in EasyPHP Devserver
By default this php configuration didn’t have a sqlsrv_connect support and my connection got an error:
Fatal error: Call to undefined function sqlsrv_connect() in
At this point I was pretty sure that it’s a miss config (It wasn’t my first time) so had searched on Microsoft for specific driver, but official one’s didn’t work for me, fortunately I had found another one not official and it worked.
Download the driver:
Unofficial Microsoft SQL Server Driver for PHP (sqlsrv)
After this you’ll must unzip the file and copy content which is inside into an extension folder, if you want to be sure about the correct destination I recommend to check phpinfo.php in your browser, for me it was http://127.0.0.1:8080/phpinfo.php In this page you’ll find some interesting info, like the right php.ini (it’s location), and your default extension folder.
Search for “Loaded Configuration File” and “extension_dir”
Copy extracted files from downloaded driver in extension dir
Edit Loaded Configuration File “php.ini” and add this two lines in extension part
Save changes and reload your Easyphp Devserver
Now you can refresh phpinfo.php and check if driver is loaded
And finally test you page