SQLSRV 3.0安装-未定义函数SQLSRV_connect()IIS,php5.4.3,


SQLSRV 3.0 install - undefined function sqlsrv_connect() IIS, php5.4.3,

我已经阅读(并尝试)了我能找到的每一篇帖子,但没有运气。phpinfo没有显示sqlsrv,但是ext文件夹是正确的(经过测试),dll也在那里。

extension=php_pdo.dll //which I don't think is actually needed for this version
extension=php_sqlsrv_53_nts.dll
extension=php_pdo_sqlsrv_53_nts.dll

它们在c:/PHP/ext中
使用FastCGI,确实重新启动了IIS以及整个服务器
此版本的PHP(X86)和MSSQL10_50.SQLEXPRESS已安装&工作一年。

Windows Server 2008 R2
PHPINFO
编译器:MSVC9(Visual C++2008)
PHP扩展版本:API20100525,NTS,VC9

然而,在PHPINFO上,我在配置命令:上看到了这一点

"--without-mssql" "--without-pdo-mssql" 

刚刚找到并添加:

extension=php_sqlsrv_30_53_nts_vc9x86.dll
extension=php_pdo_sqlsrv_30_53_nts_vc9x86.dll 

然后:

extension_dir="C:'PHP'ext" 

所以我知道我已经正确安装了dll的

任何帮助都将不胜感激——到目前为止已经两天了!

我最近升级了我的PHP和sqlsrv驱动程序。以下是我为SQLSRV部分所做的:

首先,我的phpinfo()产生:

PHP Version 5.5.1
System: Windows NT HOSTNAME 6.1 build 7601 (Windows 7 Business Edition Service Pack 1) i586
Build Date: Jul 18 2013 10:37:55 
Compiler: MSVC11 (Visual C++ 2012) 
Architecture: x86 

Configure Command
cscript /nologo configure.js "--enable-snapshot-build" "--enable-debug-pack" "--disable-zts" "--disable-isapi" "--disable-nsapi" "--without-mssql" "--without-pdo-mssql" "--without-pi3web" "--with-pdo-oci=C:'php-sdk'oracle'instantclient10'sdk,shared" "--with-oci8=C:'php-sdk'oracle'instantclient10'sdk,shared" "--with-oci8-11g=C:'php-sdk'oracle'instantclient11'sdk,shared" "--with-enchant=shared" "--enable-object-out-dir=../obj/" "--enable-com-dotnet=shared" "--with-mcrypt=static" "--disable-static-analyze" "--with-pgo" 

然后,我将SQLRV驱动程序安装到C:''Program Files(x86)''PHP''ext文件中,并在PHP.ini中添加:

[PHP_SQLSRV]
extension=php_sqlsrv_53_nts_vc9.dll 
[PHP_PDOSQLSRV]
extension=php_pdo_sqlsrv_53_nts_vc9.dll

它是有效的。虽然我不直接调用函数(我使用Yii框架),但我也更改了DSN:

sqlsrv:Server=主机名_or_ip;数据库=your_Database_name;

希望能有所帮助。

编辑

我从中下载了用于PHP 5.5的实验性/非官方sqlsrv驱动程序http://social.msdn.microsoft.com/Forums/sqlserver/en-US/e1d37219-88a3-46b2-a421-73bfa33fe433/unofficial-php-55-drivers-x86并将我的配置更新为:

[PHP_SQLSRV]
extension=php_sqlsrv_55_nts.dll 
[PHP_PDOSQLSRV]
extension=php_pdo_sqlsrv_55_nts.dll

从以下位置找到:https://stackoverflow.com/a/17390741/2236500