PHP 5.5.0 w/ Microsoft SQL Server 2008 R2 - No sqlsrv_connect()?
PHP 5.5 compiled with VC11, so the driver must be compiled with VC11 too. You can download PHP SQL Server driver (compiled with VC11) from here:
SQL Server PHP Driver For PHP 5.5
SQLSRV driver installed but shows error while connecting to MSSQL 2008 R2 db using PHP
Have you installed the feature pack?
http://microsoft.com/en-us/download/details.aspx?id=29065
A hint from the error tells us that you need the 2012 version of the MS SQL Server for this to work. Also make sure your Server permissions are set correctly.
Connecting to a SQL 2008 R2 server through XAMPP
The clue to solving your problem is in the error message:
Fatal error: Uncaught exception 'PDOException' with message
'SQLSTATE[IMSSP]: This extension requires the Microsoft SQL Server
2012 Native Client ODBC Driver to communicate with SQL Server. Access
the following URL to download the Microsoft SQL Server 2012 Native
Client ODBC driver for x86: go.microsoft.com/fwlink/?LinkId=163712';
It would appear that you don't have the SQL Server Native Client drivers installed.
Browse to this URL:
Microsoft® SQL Server® 2012 Feature Pack
Scroll down until you see:
Microsoft® SQL Server® 2012 Native Client
Download and run the installer for the X86 Package (http://go.microsoft.com/fwlink/?LinkID=239647&clcid=0x409)
Error!: could not find driver' after installing php_[pdo_]mssql.dll on WampServer
In case anyone else ends up here while trying to solve this problem, here are the steps that have worked for me the two times I've done it. These steps worked both on Windows Server 2008 R2 and Windows 8.
For my purposes, I used the latest 32-bit (x86) version of WampServer (at the time of this writing, it was 2.4, and came with Apache 2.4.4 and PHP 5.4.16). The 32-bit version is necessary, as the drivers are 32-bit; the 64-bit version will not work.
- Install Microsoft Visual C++ 2010 Redistributable Package x86
- Install Microsoft SQL Server 2008 Native Client x86 (Click "Download" and select
ENU\x86\sqlncli.msi
. Once again, the 64-bit version will not work) - Install Microsoft ODBC Driver 11 x86 (Click "Download" and select
1033\x86\msodbcsql.msi
) - Install Microsoft SQLSRV driver 3.0 in
php/ext/
(For my installation, this wasC:/wamp/bin/php/php5.4.16/ext/
) - Edit Apache's php.ini to include the line
extension=php_pdo_sqlsrv_54_ts.dll
(for my installation, this was located inC:/wamp/bin/apache/Apache2.4.4/bin/
)
Related Topics
How So I Convert This Sha256 + Base64 from Swift to PHP
What Is Null Coalescing Assignment = Operator in PHP 7.4
Trying to Access Array Offset on Value of Type Null
Errorbag Is Always Empty in Laravel 5.2
How to Get a One-Dimensional Scalar Array as a Doctrine Dql Query Result
How to Paginate a Merged Collection in Laravel 5
Google Calendar API V3 - Authenticate with Hardcoded Credentials
Phpmyadmin Error: the Mbstring Extension Is Missing. Please Check Your PHP Configuration
Preg_Match Equivalent in Swift
Cast the Current Object ($This) to a Descendent Class
PHP Regex Word Boundary Matching in Utf-8
PHP Password_Verify() Hash and Pass Won't Match
MySQL and PHP - Insert Null Rather Than Empty String
Accessing an Associative Array by Integer Index in PHP
How to Set an Arrays Internal Pointer to a Specific Position? PHP/Xml