PHP Connection SQL Server related configuration and instructions

Source: Internet
Author: User
Tags install php

about how PHP connection database, we certainly have different views, some with Wamp, some with xamp, they are integrated environment, convenient operation.
Sometimes, however, the database type is different and you want to connect to a different database. Today share with you how to connect the sql2000, the server environment for the iis,php version of the 5.2 version.

1. Install PHP:
1) Open "programs and Features" and click "Turn window features on or off".
2) Tick "IIS Admin Console" and CGI, OK.
3) Open IIS Manager and you will see the "FastCGI" setting.
4) Download and install the PHP Manager (X86). You can then see the PHP Manager in IIS Manager.
5) Download PHP version, unzip to the specified directory, then open IIS Manager, double-click the PHP Manager icon, click Register New PHP version, in the pop-up window, enter or select the Php-cgi.exe in the previously unzipped directory. Click OK.
6) Click Check Phpinfo (), select a site to check the PHP environment, check whether PHP installation is successful.

2. Modify the contents of php.ini in PHP:
1) the No. 689 line; extension=php_mssql.dll the front; remove.
2) Change the display_errors=off of line No. 373 to Display_errors=on.
3) the No. 342 line; Error_reporting=e_all &~e_notice the front; remove.

3.config.php (Connection database)

<?php
$host = ' localhost ';
$user = ' sa ';
$pass = ' 123456 ';
$dbname = ' users ';
$con = Mssql_connect ($host, $user, $pass) or Die ("Connection Server failed! ");
$db = mssql_select_db ($dbname) or Die ("Database selection failed! ");
?>
Note: php5.3 the above version does not have the MSSQL extension, so the above content only adapts to the php5.2 version.
I also see a lot of methods on the Internet, through repeated attempts and pondering, and finally successfully connected to the database, I would like to share the experience of this article, I hope that the network of small partners can like.

PHP Connection SQL Server related configuration and instructions

Related Article

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.