Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/facebook/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
检查cURL是否安装在本地?_Curl - Fatal编程技术网

检查cURL是否安装在本地?

检查cURL是否安装在本地?,curl,Curl,如何检查本地服务器实例上是否安装了cURL 我运行什么类型的服务器来检查它是否重要 是PHP服务器还是CF服务器有什么不同 在终端中,键入: $curl-V 这是版本的大写字母V,出于安全原因,大多数托管控制面板都禁用了cURL,但许多php应用程序都需要它。客户请求它并不罕见。由于启用cURL的风险很小,因此启用cURL可能比失去客户要好。它只是一个工具,可以帮助php脚本使用标准的Internet URL获取内容 要启用cURL,您将从控制面板“php高级设置”中的“禁用列表”中删除cURL

如何检查本地服务器实例上是否安装了
cURL

我运行什么类型的服务器来检查它是否重要

是PHP服务器还是CF服务器有什么不同

在终端中,键入:

$
curl-V


这是版本的大写字母
V
,出于安全原因,大多数托管控制面板都禁用了cURL,但许多php应用程序都需要它。客户请求它并不罕见。由于启用cURL的风险很小,因此启用cURL可能比失去客户要好。它只是一个工具,可以帮助php脚本使用标准的Internet URL获取内容

要启用cURL,您将从控制面板“php高级设置”中的“禁用列表”中删除cURL_exec。您还可以在各种php.ini文件中找到禁用列表;查看/etc/php.ini和控制面板可能存在的其他路径。您需要重新启动Apache才能使更改生效

重启 要确认是启用还是禁用cURL,请在系统中的某个位置创建一个文件并粘贴以下内容

<?php
echo '<pre>';
var_dump(curl_version());
echo '</pre>';
?>
http://localhost/[your_filename].php

扩展上面的答案,如果情况是这样的话,您正在使用XAMPP。在当前版本的xampp中,无法在php.ini中找到curl_exec,请尝试使用

如果结果是这样的

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.cat.pdx.edu
 * epel: mirrors.kernel.org
 * extras: mirrors.cat.pdx.edu
 * remi-php72: repo1.sea.innoscale.net
 * remi-safe: repo1.sea.innoscale.net
 * updates: mirrors.cat.pdx.edu
Package curl-7.29.0-54.el7_7.1.x86_64 already installed and latest version
Nothing to do

curl是启用的

另一种方式,比如在CentOS中,是:


假设您想要安装curl:只需执行install命令,看看会发生什么

$sudo yum安装curl


你是说libcurl还是curl命令?
http://localhost/[your_filename].php
array(9) {
  ["version_number"]=>
  int(469760)
  ["age"]=>
  int(3)
  ["features"]=>
  int(266141)
  ["ssl_version_number"]=>
  int(0)
  ["version"]=>
  string(6) "7.43.0"
  ["host"]=>
  string(13) "i386-pc-win32"
  ["ssl_version"]=>
  string(14) "OpenSSL/1.0.2e"
  ["libz_version"]=>
  string(5) "1.2.8"
  ["protocols"]=>
  array(19) {
    [0]=>
    string(4) "dict"
    [1]=>
    string(4) "file"
    [2]=>
    string(3) "ftp"
    [3]=>
    string(4) "ftps"
    [4]=>
    string(6) "gopher"
    [5]=>
    string(4) "http"
    [6]=>
    string(5) "https"
    [7]=>
    string(4) "imap"
    [8]=>
    string(5) "imaps"
    [9]=>
    string(4) "ldap"
    [10]=>
    string(4) "pop3"
    [11]=>
    string(5) "pop3s"
    [12]=>
    string(4) "rtsp"
    [13]=>
    string(3) "scp"
    [14]=>
    string(4) "sftp"
    [15]=>
    string(4) "smtp"
    [16]=>
    string(5) "smtps"
    [17]=>
    string(6) "telnet"
    [18]=>
    string(4) "tftp"
  }
}
$ yum list installed '*curl*'
Loaded plugins: aliases, changelog, fastestmirror, kabi, langpacks, priorities, tmprepo, verify,
              : versionlock
Loading support for Red Hat kernel ABI
Determining fastest mirrors
google-chrome                                                                                    3/3
152 packages excluded due to repository priority protections
Installed Packages
curl.x86_64                                        7.29.0-42.el7                                @base
libcurl.x86_64                                     7.29.0-42.el7                                @base
libcurl-devel.x86_64                               7.29.0-42.el7                                @base
python-pycurl.x86_64                               7.19.0-19.el7                                @base
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.cat.pdx.edu
 * epel: mirrors.kernel.org
 * extras: mirrors.cat.pdx.edu
 * remi-php72: repo1.sea.innoscale.net
 * remi-safe: repo1.sea.innoscale.net
 * updates: mirrors.cat.pdx.edu
Package curl-7.29.0-54.el7_7.1.x86_64 already installed and latest version
Nothing to do