Home > php教程 > php手册 > php连接mssql的故障问题

php连接mssql的故障问题

WBOY
Release: 2016-06-06 19:56:51
Original
1206 people have browsed it

mssql_connect() [function.mssql-connect]: message: 用户 '(null)' 登录失败。原因: 未与信任 SQL Server 连接相关。 (severity 14 ) 一台windows服务器跑了php和mssql,php需要连接本地的mssql 写了个test页面 ?php $conn=mssql_connect(127.0.0.1,sa,xx

mssql_connect() [function.mssql-connect]: message: 用户 '(null)' 登录失败。原因: 未与信任 SQL Server 连接相关。 (severity 14 )
 
一台windows服务器跑了php和mssql,php需要连接本地的mssql   写了个test页面
$conn=mssql_connect("127.0.0.1","sa","xxxx");
       //测试连接
       if($conn)
       {
       echo "连接成功";
       }
?>
 
 
 
但是不能连接mssql 报错:
mssql_connect() [function.mssql-connect]: message: 用户 '(null)' 登录失败。原因: 未与信任 SQL Server 连接相关   (severity 14)
 
 
 要修改2个文件

php.ini
php-apache2handler.ini
mssql.secure_connection = Off

改成这个即可,然后重启服务器。windows+php 每次修改php.ini都需要重启机器才能生效。。。。没linux好,太烂了。

php-apache2handler.ini

php连接mssql的故障问题
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template