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.2Configure 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'),则显示不存在此函数。  泪奔~~还有的救不?

解决方案 »

  1.   

    怎样安装php才能有mssql库呢?为什么网上的解决方案都是自带extension=php_mssql.dll这行的呢?
      T_T  
    肯定是有解决方法的吧,不然php怎么访问mssql数据库的呀呀呀
      

  2.   

    用微软提供的这个驱动去连接
    http://www.microsoft.com/downloads/en/details.aspx?displaylang=en&FamilyID=ccdf728b-1ea0-48a8-a84a-5052214caad9
      

  3.   

    已经不支持php_sqlsrv, php_mssql下载:
    http://msdn.microsoft.com/en-us/library/cc296170(v=sql.90).aspx资料:
    http://hardforum.com/showthread.php?p=1035593792
      

  4.   

    http://www.helpspot.com/helpdesk/index.php?pg=kb.page&id=13
      

  5.   

    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,但是无法访问远程数据库。
      

  6.   

    远程端口?是指本地开启还是说要连接的数据库所在电脑开启?如果zend Studio debug下可以连接的话,远程端口就应该是已经开启的吧!?
      

  7.   

    希望对你有帮助:http://support.microsoft.com/kb/914277/zh-cn