8

I have a xampp running with PHP 5.6. Normally I use mysql server, but for a script that already exists i need a MS SQL server.

I searched on the net and installed SQL server 2012.

But now I need the drivers for PHP. Unfornunately I can only find a version that supports 5.4, 5.5..

(http://msdn.microsoft.com/en-us/sqlserver/ff657782.aspx)

Is there a way to let this work with 5.6?

3

4 Answers 4

13

Microsoft recently released a new version (3.2) of the SQL Drivers for PHP which includes compatibility with PHP 5.6.

You can download the drivers here: https://www.microsoft.com/en-us/download/details.aspx?id=20098

3
  • 1
    Try to avoid link-only answers; they are likely to be closed as low-quality. If the link ever changes/moves, your answer is no longer valid, so it is best to add the relevant information from the link in your answer.
    – Tim Lewis
    Mar 20, 2015 at 15:52
  • 1
    Do you think that my rewording makes the answer acceptable?
    – peterpoe
    Mar 20, 2015 at 17:04
  • Your answer is fine, I never said it was wrong :P This answer came up in my review tasks, and I simply posted the rules about link-only questions. Looking at the question, it may be hard to answer it otherwise, so I gave you a +1 for this.
    – Tim Lewis
    Mar 20, 2015 at 17:23
6

I searched the net for a while.. After posting this question for 10m, I finally found a unofficial driver..

Hope this works, I will check this out..

You can find it on: http://robsphp.blogspot.be/2012/06/unofficial-microsoft-sql-server-driver.html

1
  • 4
    This is correct, there is currently no official driver for PHP 5.6. If you care about this, please upvote this Connect issue and hopefully Microsoft will do something about this.
    – Josh
    Dec 22, 2014 at 21:05
3

I believe it's time to revisit this answer a bit better. Since you've been pretty clear with your setup. The short answer is placed as steps below

  1. Download ver 3.2 of the SQLSRV drivers from here. https://www.microsoft.com/download/details.aspx?id=20098
  2. Do extract them to your "xampp installation path"\php\ext
  3. Kindly ensure you see and keep the files : php_sqlsrv_56_ts.dll and php_pdo_sqlsrv_56_ts.dll
  4. Please delete the redundant files below:

    PHP Drivers License Terms.rtf,
    php_pdo_sqlsrv_54_nts.dll,
    php_pdo_sqlsrv_54_ts.dll,
    php_pdo_sqlsrv_55_nts.dll,
    php_pdo_sqlsrv_55_ts.dll,
    php_pdo_sqlsrv_56_nts.dll,
    php_sqlsrv_54_nts.dll,
    php_sqlsrv_54_ts.dll,
    php_sqlsrv_55_nts.dll,
    php_sqlsrv_55_ts.dll,
    php_sqlsrv_56_nts.dll,
    release.txt,
    SQLSRV_Readme.htm,
    SQLSRV_ThirdPartyNotices.rtf,
    
    • Place these lines in your php.ini at your "xampp installation path"\php\php.ini extension=php_sqlsrv_56_ts.dll extension=php_pdo_sqlsrv_56_ts.dll

    • Restart your XAMPP server and place a '<'?php phpinfo(); ?'>' in an index.php file at \htdocs\'folder'

    • Navigate to it using http://localhost/'folder where phpinfofile is placed'/index.php

If you see something like this image below. It's done, Congratulations![enter image description here]1

PS : The long answer is here. https://msdn.microsoft.com/en-us/library/cc296170.aspx

1

At this time: My solution was:

1- Download ver 3.2 of the SQLSRV drivers from here. https://www.microsoft.com/download/details.aspx?id=20098 enter image description here

2 Extract the files to your "xampp" folder into the \php\ext

3- Add this lines to php.ini

extension=php_pdo_sqlsrv_56_ts.dll

extension=php_pdo_sqlsrv_56_nts.dll

extension=php_sqlsrv_56_ts.dll

extension=php_sqlsrv_56_nts.dll

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.