1024programmer PHP Please help me, heroes (problems related to PHP connecting to MSSQL)

Please help me, heroes (problems related to PHP connecting to MSSQL)

Please help me, heroes (Problems with PHP connecting to MSSQL)
Environment:
1.MYSQL is installed on centos 5.9,
2. MSSSQL 2005 + WIN7, the version (ntwdblib) installed on WIN7 is also 2005.

Question:
I use PHP to connect to MSSQL. If you can connect to a local one, that’s fine
<?php
$res = mssql_connect(‘127.0.0.1′,’sa’,’123′);
var_dump($res);
?>
If I press the same configuration from another computer, the firewall is also turned off. Related services are also enabled. Even so, the connection is unsuccessful.

Share to:

——Solution——————–

Quote:

Do other computers also have MSSSQL 2005 installed?
RE:No

What is the php version? 5.3

Does the sa account allow remote access in mssql?
RE:Yes

Are your PHP and mssql running on the same machine? If not, does the machine running php have the mssql extension installed? Have you changed the connection IP to the IP of the mssql server?
——Solution——————–
1. Not here The same machine, then servername should be the target machine name or ip + / instance name
2. PHP 5.3 no longer has mssql extension
3. MSSSQL 2005 does not allow remote access by default, you need to open it yourself

This article is from the internet and does not represent1024programmerPosition, please indicate the source when reprinting:https://www.1024programmer.com/please-help-me-heroes-problems-related-to-php-connecting-to-mssql/

author: admin

Previous article
Next article

Leave a Reply

Your email address will not be published. Required fields are marked *

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: 34331943@QQ.com

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索