无法加载mssql

heiyilvzhe 2010-12-13 04:40:35
windows操作系统xp和win7都有,安装的几个版本的php都是扩展包全选,都是5.2版本以上的,但是安装完成后php.ini中都没有 extension=php_mssql.dll。
不知道是什么原因。


按照网上的说法修改了下
1、php.ini中没有extension=php_mssql.dll这行,所以直接添加了extension=php_mssql.dll
2、mssql.secure_connection = Off改为on
3、php_mssql.dll拷贝到php.ini中extension_dir 指定的目录或者系统system32中
4、更新新ntwdblib.dll为合适于sql2005的版本2000.80.194.0

但是仍然无法正常使用。

phpinfo()

PHP Version 5.3.2

Configure Command cscript /nologo configure.js "--enable-snapshot-build" "--disable-isapi" "--enable-debug-pack" "--disable-isapi" "--without-mssql" "--without-pdo-mssql" "--without-pi3web" "--with-pdo-oci=D:\php-sdk\oracle\instantclient10\sdk,shared" "--with-oci8=D:\php-sdk\oracle\instantclient10\sdk,shared" "--with-oci8-11g=D:\php-sdk\oracle\instantclient11\sdk,shared" "--enable-object-out-dir=../obj/" "--enable-com-dotnet

没有mssql相关模块,且上面显示 "--without-mssql" "--without-pdo-mssql"

apache Version 2.2.15 error log:
PHP Warning: PHP Startup: Unable to load dynamic library 'F:\\php\\ext\\php_mssql.dll' - \xd5\xd2\xb2\xbb\xb5\xbd\xd6\xb8\xb6\xa8\xb5\xc4\xc4\xa3\xbf\xe9\xa1\xa3\r\n in Unknown on line 0


php_mssql.dll无法加载,但是zend studio的debug下又可以使用 mssql_connect(),并且能够正确获取数据;

而localhost下判断function_exists('mssql_connect'),则显示不存在此函数。 泪奔~~

还有的救不?


...全文
377 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
heiyilvzhe 2010-12-14
  • 打赏
  • 举报
回复
咔咔

不是端口或者实例的问题。不过问题解决了,是网络的问题。 谢谢楼上大大~~

结贴~
ihefe 2010-12-14
  • 打赏
  • 举报
回复
希望对你有帮助:

http://support.microsoft.com/kb/914277/zh-cn
heiyilvzhe 2010-12-14
  • 打赏
  • 举报
回复
远程端口?是指本地开启还是说要连接的数据库所在电脑开启?

如果zend Studio debug下可以连接的话,远程端口就应该是已经开启的吧!?
ihefe 2010-12-14
  • 打赏
  • 举报
回复
是否开启远程端口比如1433
heiyilvzhe 2010-12-14
  • 打赏
  • 举报
回复
win7 x64位系统已经能成功访问远程数据库。


但是win xp x86 pack3的系统connect函数可以使用,但是出错, print_r(sqlsrv_errors()); 结果如下:

Array ( [0] => Array ( [0] => 08001 [SQLSTATE] => 08001 [1] => 53 [code] => 53 [2] => [Microsoft][SQL Server Native Client 10.0]Named Pipes Provider: Could not open a connection to SQL Server [53]. [message] => [Microsoft][SQL Server Native Client 10.0]Named Pipes Provider: Could not open a connection to SQL Server [53]. ) [1] => Array ( [0] => HYT00 [SQLSTATE] => HYT00 [1] => 0 [code] => 0 [2] => [Microsoft][SQL Server Native Client 10.0]Login timeout expired [message] => [Microsoft][SQL Server Native Client 10.0]Login timeout expired ) [2] => Array ( [0] => 08001 [SQLSTATE] => 08001 [1] => 53 [code] => 53 [2] => [Microsoft][SQL Server Native Client 10.0]A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online. [message] => [Microsoft][SQL Server Native Client 10.0]A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online. ) )

>_<

xp系统上本地数据库sql server2005访问ok,但是无法访问远程数据库。
ihefe 2010-12-13
  • 打赏
  • 举报
回复
http://www.helpspot.com/helpdesk/index.php?pg=kb.page&id=13
ihefe 2010-12-13
  • 打赏
  • 举报
回复
已经不支持php_sqlsrv, php_mssql

下载:
http://msdn.microsoft.com/en-us/library/cc296170(v=sql.90).aspx

资料:
http://hardforum.com/showthread.php?p=1035593792

CunningBoy 2010-12-13
  • 打赏
  • 举报
回复
用微软提供的这个驱动去连接
http://www.microsoft.com/downloads/en/details.aspx?displaylang=en&FamilyID=ccdf728b-1ea0-48a8-a84a-5052214caad9
heiyilvzhe 2010-12-13
  • 打赏
  • 举报
回复
怎样安装php才能有mssql库呢?为什么网上的解决方案都是自带extension=php_mssql.dll这行的呢?
T_T
肯定是有解决方法的吧,不然php怎么访问mssql数据库的呀呀呀
在-云端 2010-12-13
  • 打赏
  • 举报
回复

无救~鉴定完毕!

21,886

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧