Fatal error: Call to undefined function sqlsrv_connect() in C:\xampp\htdocs
The MSSQL extension is not available anymore on Windows with PHP 5.3
or later. SQLSRV, an alternative driver for MS SQL is available from
Microsoft: »
http://www.microsoft.com/en-us/download/details.aspx?id=20098
Step by Step
Download SQLSRV32.EXE (Microsoft Drivers for PHP for SQL Server) from: http://www.microsoft.com/en-us/download/details.aspx?id=20098
Choose path: C:\xampp\php\ext
Uncomment or Append
extension = php_sqlsrv_56_ts.dll
inphp.ini
Restart Apache from XAMPP Control Panel (Stop/Start)
I tested it and it works 100%
You can find the most recent compiled binaries in the official Microsoft Git repository.
Uncaught Error: Call to undefined function sqlsrv_connect()
1) php_sqlsrv_72_ts_x64 AND php_pdo_sqlsrv_72_ts_x64 should be 32 bit same as xampp
2) Also compatible with PHP version
Call to undefined function sqlsrv_connect() - Troubleshooting
You have added the PDO variant of SQLSRV drivers to the extension list, but have not added the base drivers php_sqlsrv_55_ts.dll
.
Add to the php.ini:
extension=php_sqlsrv_55_ts.dll
or
extension=php_sqlsrv_55_nts.dll
Also, you really should be using either the Thread-Safe (_ts.dll
) or Non-Thread-Safe (_nts.dll
) versions of the driver, not both. I believe that, as you are using an Apache Server, you should be using the Thread-Safe versions. So you php.ini should have:
extension=php_sqlsrv_55_ts.dll
extension=php_pdo_sqlsrv_55_ts.dll
Related Topics
Dynamically Changing Image Colours
Detect If Android App Has Been Installed on the Device Using a Mobile Web Page - PHP and Js
Understanding Imagemagick's Convert and Translating to Ruby Rmagick
Ruby and PHP Hmacs Not Agreeing
Preg_Match Equivalent in Swift
Swift Sync Data of Core Data an MySQL Database
Using Variables in MySQL Update (Php/Mysql)
Filling Gaps in Dates Returned from Database - Pure SQL Solution Possible
Performance in Pdo/Php/Mysql: Transaction Versus Direct Execution
Get Div Content from External Website
Calculate Total Seconds in PHP Dateinterval
How to Echo the Whole Content of a .HTML File in PHP
PHP Generated Xml Shows Invalid Char Value 27 Message
How to Create a Twig Custom Tag That Executes a Callback