我刚刚在我的Windows Server 2008上安装了PHP,并希望使用mssql_connect()来连接我的数据库。当我第一次尝试这个时,我得到了错误mssql_connect() function not found
,经过一些搜索,我读到应该使用sqlsrv driver
。
我已经下载了相应的sqlsrv并将其放在我的php / ext文件夹中,但却发现PHP找不到我的php.ini文件。我将.ini文件移动到 C:\ Windows ,因为这是它正在查找的文件夹。
问题(在mssql_connect()之上无效)现在,.ini文件中有关扩展的任何更改都不会显示在phpinfo()
中。扩展目录保持不变,并且不显示sqlsrv驱动程序。
下面是phpinfo()的第一个表
PHP Version 5.3.29
System Windows NT PC020025 6.1 build 7601 (Windows Server 2008 R2 Standard Edition Service Pack 1) i586
Build Date Aug 15 2014 19:01:45
Compiler MSVC9 (Visual C++ 2008)
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"
Server API CGI/FastCGI
Virtual Directory Support disabled
Configuration File (php.ini) Path C:\Windows
Loaded Configuration File C:\Windows\php.ini
Scan this dir for additional .ini files (none)
Additional .ini files parsed (none)
PHP API 20090626
PHP Extension 20090626
Zend Extension 220090626
Zend Extension Build API220090626,NTS,VC9
PHP Extension Build API20090626,NTS,VC9
Debug Build no
Thread Safety disabled
Zend Memory Manager enabled
Zend Multibyte Support disabled
IPv6 Support enabled
Registered PHP Streams php, file, glob, data, http, ftp, zip, compress.zlib, phar
Registered Stream Socket Transports tcp, udp
Registered Stream Filters convert.iconv.*, mcrypt.*, mdecrypt.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, dechunk, zlib.*
提前致谢!