【问题标题】:Unable to install SQL Server 2017 driver for PHP无法为 PHP 安装 SQL Server 2017 驱动程序
【发布时间】:2017-12-30 19:58:50
【问题描述】:

我从视频教程中学习了如何为 PHP 安装 SQL Server 2017 - 我完全按照教程所说的那样做 - 但我仍然看不到 PHP 信息列表中的扩展。

我安装了:

PHP 版本 7.1.9
Xampp 服务器 v3.2.2
微软 SQL Server 2017
SQL 原生客户端

我添加了具有以下名称的文件:

;extension=php_sqlsrv_7_nts_x64.dll
;extension=php_pdo_sqlsrv_7_nts_x64.dll
;extension=php_pdo_sqlsrv_7_ts_x64.dll
;extension=php_sqlsrv_7_ts_x64.dll

到我的 php.ini 文件中,当然我也把它们放到了我的 ext 目录中。

这是我的 SQL 信息输出:

PHP Version 7.1.9
System  Windows NT DESKTOP-JTKEMP6 10.0 build 15063 (Windows 10) i586
Build Date  Aug 30 2017 18:33:21
Compiler    MSVC14 (Visual C++ 2015)
Architecture    x86
Configure Command   cscript /nologo configure.js "--enable-snapshot-build" "--enable-debug-pack" "--with-pdo-oci=c:\php-snap-build\deps_aux\oracle\x86\instantclient_12_1\sdk,shared" "--with-oci8-12c=c:\php-snap-build\deps_aux\oracle\x86\instantclient_12_1\sdk,shared" "--enable-object-out-dir=../obj/" "--enable-com-dotnet=shared" "--with-mcrypt=static" "--without-analyzer" "--with-pgo"
Server API  Apache 2.0 Handler
Virtual Directory Support   enabled
Configuration File (php.ini) Path   C:\Windows
Loaded Configuration File   C:\xampp\php\php.ini
Scan this dir for additional .ini files (none)
Additional .ini files parsed    (none)
PHP API 20160303
PHP Extension   20160303
Zend Extension  320160303
Zend Extension Build    API320160303,TS,VC14
PHP Extension Build API20160303,TS,VC14
Debug Build no
Thread Safety   enabled
Zend Signal Handling    disabled
Zend Memory Manager enabled
Zend Multibyte Support  provided by mbstring
IPv6 Support    enabled
DTrace Support  disabled
Registered PHP Streams  php, file, glob, data, http, ftp, zip, compress.zlib, compress.bzip2, https, ftps, phar
Registered Stream Socket Transports tcp, udp, ssl, sslv3, tls, tlsv1.0, tlsv1.1, tlsv1.2
Registered Stream Filters   convert.iconv.*, mcrypt.*, mdecrypt.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, dechunk, zlib.*, bzip2.*
Zend logo This program makes use of the Zend Scripting Language Engine:
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
Configuration
apache2handler
Apache Version  Apache/2.4.27 (Win32) OpenSSL/1.0.2l PHP/7.1.9
Apache API Version  20120211
Server Administrator    postmaster@localhost
Hostname:Port   localhost:80
Max Requests    Per Child: 0 - Keep Alive: on - Max Per Connection: 100
Timeouts    Connection: 300 - Keep-Alive: 5
Virtual Server  No
Server Root C:/xampp/apache

【问题讨论】:

    标签: php sql-server php-extension


    【解决方案1】:

    您不需要单独安装 php。 Xampp 默认包含 php。

    停止 xampp 服务器并取消注释这行您的 php.ini:

    extension=php_sqlsrv_7_nts_x64.dll
    extension=php_pdo_sqlsrv_7_nts_x64.dll
    extension=php_pdo_sqlsrv_7_ts_x64.dll
    extension=php_sqlsrv_7_ts_x64.dll
    

    然后再次启动 xampp。

    【讨论】:

    • 我需要安装 Microsoft SQL Server 驱动程序而不是 PHP 。因为我想将 SuiteCRM 与 Microsoft SQL Server 2017 数据库集成
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-09-24
    • 2020-12-03
    • 1970-01-01
    • 2016-04-23
    • 2019-01-26
    • 2017-04-13
    • 1970-01-01
    相关资源
    最近更新 更多