简体   繁体   English

PDO_MSSQL和SQL Server 7

[英]PDO_MSSQL and SQL Server 7

I have problem with establish connection with sql server 7 on different server using PDO/PHP. 我在使用PDO / PHP在不同服务器上与sql server 7建立连接时遇到问题。 All works perfect on win 2003 32 bit/apache/php5.2.5 but I receive server not found when service is on win 2008R2 64bit/apache/php5.2.5. 在win 2003 32 bit / apache / php5.2.5上所有工作都完美无缺,但是当win 2008R2 64bit / apache / php5.2.5上服务启动时,我收到未找到服务器的消息。 User/password are correct, firewall configured. 用户/密码正确,已配置防火墙。

I check, that PHP don't use 1433 port but try connect with 445 and 139 ports. 我检查一下,PHP不使用1433端口,而是尝试连接445和139端口。

Any idea? 任何的想法?

Stefan 斯特凡

Updated; 更新;

You could use the PDO ODBC connection option: PHP: PDO_ODBC DSN . 您可以使用PDO ODBC连接选项: PHP:PDO_ODBC DSN I've used this method previously to connect from Win 2003 and 2008 to a SQL Server 我以前曾使用此方法将Win 2003和2008连接到SQL Server

In your PDO statement, the first param would do well to take this form: "mssql:host=xxxx;port=xxxx;dbname=xxxxxxx;" 在您的PDO语句中,第一个参数可以很好地采用这种形式:“ mssql:host = xxxx; port = xxxx; dbname = xxxxxxx;” Notice the inclusion of port. 请注意包含端口。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM