用于PHP的SQL Server驱动程序sqlsrv_connect()用忽略的错误填充PHP错误日志

时间:2011-04-01 11:51:56

标签: php sql-server logging error-handling

每次我的PHP应用程序连接到我的SQL Server数据库时,都会将以下内容放入PHP错误日志中:

[01-Apr-2011 12:39:16] sqlsrv_connect: SQLSTATE = 01000
[01-Apr-2011 12:39:16] sqlsrv_connect: error code = 5701
[01-Apr-2011 12:39:16] sqlsrv_connect: message = [Microsoft][SQL Server Native Client 10.0][SQL Server]Changed database context to 'my_table_name'.
[01-Apr-2011 12:39:16] sqlsrv_connect: SQLSTATE = 01000
[01-Apr-2011 12:39:16] sqlsrv_connect: error code = 5703
[01-Apr-2011 12:39:16] sqlsrv_connect: message = [Microsoft][SQL Server Native Client 10.0][SQL Server]Changed language setting to us_english.
[01-Apr-2011 12:39:16] error ignored

如何抑制此错误?它似乎不是PHP错误,因为它没有严重性,例如Notice / Warning / etc.

1 个答案:

答案 0 :(得分:4)

我想您可以使用sqlsrv_configure()功能来更改错误报告和/或日志设置。

另见: