1, from the official download: http://windows.php.net/downloads/releases/
Http://windows.php.net/downloads/releases/php-7.0.23-Win32-VC14-x64.zip
Consider that there is no 7.1 SQL Server connection component, using 7.0 version 64-bit.
2, the download after the decompression good,
3. Add CGI support in IIS, http://www.jb51.net/article/38048.htm
4, in the PHP directory to start the command line, PHP-V will indicate whether the DLL is missing, if missing, https://www.microsoft.com/zh-cn/download/confirmation.aspx?id=48145 VC14 components are downloaded here, after installation, try again, if OK.
5, PHP7 with 2008 database, the middle first to install an ODBC Driver one for SQL (Msodbcsql.msi)
6, add two lines in the Php7.ini:
Extension=php_pdo_sqlsrv_7_nts_x64.dll
Extension=php_sqlsrv_7_nts_x64.dll
Set the extension directory pointing;
PHP-V Test Information
7. Test the connection success:
<?php phpinfo (); try { $conn = new PDO ("sqlsrv:server= (local);D atabase=dbname", "SA", "1234"); $conn->setattribute (Pdo::attr_errmode, pdo::errmode_exception);} catch (Pdoexception $e) {die ("Error Connecting to SQL Server". $e->getmessage ());} echo "Connected to SQL server/n", $query = ' Select top * from TABLE '; $stmt = $conn->query ($query); while ($row = $stmt->fetch (PDO::FETCH_ASSOC)) { print_r ($row);}?>
8, if no problem, you can play happily
IIS7 configuration Php7