IIS7 configuration Php7

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.