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