PDO MSSQL Server - Driver not found

后端 未结 3 1605
感情败类
感情败类 2020-12-06 14:23

I am currently trying to connect to my localdb on MSSQL 2012 Express.

I have downloaded and installed the official microsoft driver from http://www.microsoft.com/en-

3条回答
  •  萌比男神i
    2020-12-06 14:47

    The PDO Extension is not the same as the native driver Microsoft is offering. For PDO you must enable

    extension=php_pdo_mssql.dll
    

    in your php.ini.

    Normally this file (php_pdo_mssql.dll) should be in your PHP extension-directory (C:...\php\ext). If it's not there you can download PHP from http://windows.php.net/download/ and just take the extension from a package there (take one that correspond with your PHP version of course).

    //edit: just read you latest comment. This extension is available for a very long time now and can be considered working. If you are not allowed to use it you must rewrite your code to use the functions the native driver offers for PHP.

提交回复
热议问题