简体   繁体   English

在 php.ini 中加载 sqlsrv 驱动程序

[英]loading sqlsrv driver in php.ini

i got php5.4.4 and i've downloaded sqlsrv driver for working with microsoft SQL putted the dll in the ext folder of php and in the php.ini i got php5.4.4 and i've downloaded sqlsrv driver for working with microsoft SQL putted the dll in the ext folder of php and in the php.ini

;;;;;;;;;;;;;;;;;;;;;;;;
; Microsoft SQL Server ;
;;;;;;;;;;;;;;;;;;;;;;;;

extension=php_sqlsrv_54_nts.dll
sqlsrv.LogSubsystems=-1
sqlsrv.LogSeverity=-1
sqlsev.WarningsReturnAsErrors=0

but when loading但是在加载时

phpinfo() phpinfo()

the extension doesn't show up.扩展名不显示。

am i doing something wrong here?!我在这里做错了吗?!

thanks in advance.提前致谢。

extension=php_sqlsrv_54_nts.dll should be in [ExtensionList] section, the rest of the parameters should be in [sqlsrv]: extension=php_sqlsrv_54_nts.dll 应在 [ExtensionList] 部分,其余参数应在 [sqlsrv] 中:

(...)

[ExtensionList]
(...)
extension=php_sqlsrv_54_nts.dll

(...)

[sqlsrv]
sqlsrv.LogSubsystems=-1
sqlsrv.LogSeverity=-1
sqlsev.WarningsReturnAsErrors=0

(...)

You only need to set extension to the filename without extension these days (php 8.1):这些天你只需要为没有扩展名的文件名设置扩展名(php 8.1):

extension=php_sqlsrv

The other 3 values are only needed if you don't want the defaults.仅当您不想要默认值时才需要其他 3 个值。

Most important is the extension_dir setting.最重要的是 extension_dir 设置。 It is recommended to use absolute path:推荐使用绝对路径:

extension_dir = "C:\Program Files\php\ext"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM