MSSQL connection failure in PHP

Source: Internet
Author: User

Mssql_connect () [function. MSSQL-connect]: Message: User '(null)' Login Failed. Cause: it is not related to the trust SQL server connection. (Severity 14)
 
A Windows server runs PHP and MSSQL, and PHP needs to connect to the local MSSQL to write a test page.
<? PHP
$ Conn = mssql_connect ("127.0.0.1", "sa", "XXXX ");
// Test the connection
If ($ conn)
{
Echo "connection successful ";
}
?>
 
 
 
However, MSSQL cannot be connected. The following error occurs:
Mssql_connect () [function. MSSQL-connect]: Message: User '(null)' Login Failed. Cause: it is not related to the trusted SQL server connection (severity 14)
 
 
2 files to be modified

PHP. ini
Php-apache2handler.ini
MSSQL. secure_connection = off

Change it to this and then restart the server. Every time you modify PHP. ini in Windows + PHP, You need to restart the machine to make it take effect .... It's too bad to use Linux.

Php-apache2handler.ini

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.