PHP on IIS7 with (PDO) MS-SQL support

I am running an IIS 7 window server and the relevant part of my phpinfo configuration command is currently reporting this:

cscript / nologo configure.js ...... "--without-mssql" "--without-pdo-mssql" "--without-pi3web" ... "--with-mcrypt = static"

What do I need to do for my server so that I can see with -mssql above and not see without -mssql?

I was once told to recompile PHP. This is where the dollar left off. Because this PHP came with the IIS installation, so we never needed to compile PHP before. Re-compilation ... is this something from the command line?

+3


source to share


2 answers


Microsoft SQL Server support and extensions no longer ship with PHP. To link PHP to SQL Server, you need Microsoft Drivers for PHP for SQL Server :

Microsoft Drivers for PHP for SQL Server is a PHP 5 extension that provides data access for SQL Server 2005 and later, including SQL Azure.

The driver download page has four versions to choose from. Refer to the System Requirements page to determine which version you need. You must install the correct driver for your operating system + SQL Server + PHP version .

You will also need one of these depending on which driver you choose (they must be installed separately):

  • SQL Server Native Client
  • Microsoft ODBC Driver 11 for SQL Server


The installer simply extracts the files at the specified location. The files must be in the PHP extensions directory. Files are PHP extensions. The file names indicate:

  • nts/ts

    - should be used with safe / thread safe PHP version
  • 54/55/56...

    - should be used with PHP version 5.4, 5.5, 5.6, ...
  • sqlsrv/pdo_sqlsrv

    - provides interface / PDO interface

Include extensions in the file php.ini

to ensure stream safety and PHP versions match.

Check phpinfo to see if extensions are loaded. Check sqlsrv_connect("servername")

and new PDO("sqlsrv:server=servername")

to make sure the extensions are working.

+9


source


You can solve this problem with PHP Manager in IIS 7.0 Go to PHP Manager -> PHP Extensions-> Allow Disable Extensions -> Disable List Enable your PHP_PDO_SQLSRV_54_ts.dll



will work perfectly

0


source







All Articles