使用Windows帐户将Symfony 2应用程序连接到SQL SERVER

时间:2016-09-26 13:55:15

标签: php sql-server symfony

我正在尝试将我的symfony 2应用程序连接到SQL SERVER数据库,使用SQL SERVER内部帐户一切正常但我需要通过Windows帐户连接我的应用程序来避免这种情况(例如使用运行的Windows用户网络服务上的apache服务。)

有什么想法吗?

我试图评论用户/密码参数

在编辑器安装期间自动生成此文件

parameters:
    database_driver: pdo_sqlsrv
#    database_host: xxxxx
    database_host: x.x.x.x
    database_port: 1557
    database_name: xxxxxx
#    database_user: xxxxx
#    database_password: "xxxxx"

但我收到了这个错误:

Fatal error: Uncaught exception 
'Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException'
enter code here
 with message 'You have requested a non-existent parameter "database_user". 
Did you mean one of these: "database_driver", "database_host", 
"database_port", "database_name"?' in ...

1 个答案:

答案 0 :(得分:0)

我找到了解决方案:只需将database_user和database_password保留为null:

database_user: null 
database_password: null