Reputation: 1828
I went through several questions and recommendation to resolve the above issue, but No luck at all.
I have the following settings:
Windows Server 2008 R2
xampp-win32-1.8.2-5-VC9-installer
SQLSRV30 - php driver
sqlncli - Microsoft SQL Server 2008 R2 Native Client Set Up
I installed everything else and I have the following on the php.ini file The code below show where the php drivers are residing:
; On windows:
extension_dir="C:\xampp\php\ext"
The following is under windows extensions
extension=php_pdo_sqlsrv_54_ts.dll
extension=php_sqlsrv_54_ts.dll
When I check the phpinfo file sqlsrv is not listed. I know this may imply that its not installed, but It is installed.
The following is the php info file:
I also restarted apache and the server. Am I missing something ?
I get the following error:
Call to undefined function sqlsrv_connect()
This the code I am using to connect: I am connecting to another server which is hosting SQL Server 2005
/Connection to SQL Server Database
error_reporting(E_ALL);
$serverName = "172.xx.x.xxx";
$connectionInfo = array('Database'=>'Eque', "UID"=>"develop", "PWD"=>"develop");
$conn = sqlsrv_connect($serverName, $connectionInfo);
if($conn) {
echo "Connection established.<br />";
}else {
echo "Connection could not be established.<br />";
die(print_r(sqlsrv_errors(), true));
}
Upvotes: 5
Views: 56433
Reputation: 5093
What worked for me on windows 10 64bit and php 5.6. is the 3.2 version of the driver downloaded from here:Microsoft SQL Server driver for PHP
Upvotes: 0
Reputation: 149
I have struggled through the process and this is what has finally worked. I am using php 5.4.16 and Apache 2.4.4 with Sql Express 2008 R2.
Download Microsoft Drivers for PHP for SQL Server from Microsoft download site
Extact the files to a local folder
Upvotes: 8
Reputation: 4650
Load the PHP drivers in php.ini file and restart the server.
extension=php_sqlsrv_53_ts.dll
extension=php_pdo_sqlsrv_53_ts.dll
Reference: http://technet.microsoft.com/en-us/library/cc296203(v=sql.105).aspx
TS denotes thread safe. find your server is thread safe or non thread safe
Upvotes: 4