协议" smb" libcurl中不支持或禁用

时间:2016-03-10 09:52:28

标签: php curl libcurl

我的卷曲版本:

Array
(
    [version_number] => 470785
    [age] => 3
    [features] => 524809
    [ssl_version_number] => 0
    [version] => 7.47.1
    [host] => x86_64-pc-linux-gnu
    [ssl_version] => 
    [libz_version] => 1.2.8
    [protocols] => Array
        (
            [0] => dict
            [1] => file
            [2] => ftp
            [3] => gopher
            [4] => http
            [5] => imap
            [6] => pop3
            [7] => rtsp
            [8] => smtp
            [9] => telnet
            [10] => tftp
        )

)

如何启用此协议smb?

curl_setopt($ch, CURLOPT_PROTOCOLS, CURLPROTO_SMB); //not working 

3 个答案:

答案 0 :(得分:2)

libcurl从7.40.0开始支持SMB。

确保安装了禁用协议的libcurl版本。您显示的支持的协议列表表明您的设置有限。从流行的Linux发行版安装的普通libcurl将支持更多协议,包括协议列表中缺少的基于TLS的协议(HTTPS,FTPS,POP3S,IMAPS等)

还要确保使用TLS库构建libcurl(如果您自己构建),因为SMB代码需要NTLM支持,而NTLM代码仅使用libcurl支持的一个TLS库中的某些加密函数。 / p>

完成后,您根本不需要使用CURLOPT_PROTOCOLSCURLPROTO_SMB,因为libcurl默认会支持它。

答案 1 :(得分:0)

在7.40.0 - 2015年1月8日修正

的变化:

http_digest: Added support for Windows SSPI based authentication
version info: Added Kerberos V5 to the supported features
Makefile: Added VC targets for WinIDN
config-win32: Introduce build targets for VS2012+
SSL: Add PEM format support for public key pinning
smtp: Added support for the conversion of Unix newlines during mail send
smb: Added initial support for the SMB/CIFS protocol
Added support for HTTP over unix domain sockets, via CURLOPT_UNIX_SOCKET_PATH and --unix-socket
sasl: Added support for GSS-API based Kerberos V5 authentication 

文件读取不起作用或我不知道如何使用

答案 2 :(得分:0)

好吧我安装了7.43 libcurl和 排列 (     [version_number] => 469760     [age] => 3     [features] => 968605     [ssl_version_number] => 0     [版本] => 7.43.0     [host] => x86_64的-PC-Linux的GNU     [ssl_version] => OpenSSL的/ 1.0.2d     [libz_version] => 1.2.8     [protocols] =>排列         (             [0] =>字典             [1] =>文件             [2] => FTP             [3] => FTPS             [4] =>地鼠             [5] => HTTP             [6] => HTTPS             [7] => IMAP             [8] => IMAPS             [9] => LDAP             [10] => LDAPS             [11] => POP3             [12] => POP3S             [13] => RTMP             [14] => RTSP             [15] => SMB             [16] =>中小企业             [17] => SMTP             [18] => SMTPS             [19] =>远程登录             [20] => TFTP         )

我可以从smb获取文件内容但是如何获取目录列表文件?