Articles of curl

不能使用公共IP访问,但使用本地主机

我在Docker容器中的服务器上运行InluxDB。 这个命令是可以的,当从同一个服务器执行时: curl -G http://localhost:8086/query -u my_user –data-urlencode "q=SHOW DATABASES" authentication是好的,它打印数据库。 但是,当我将localhost更改为公共IP时,它不能在同一台服务器上运行,也不能在其他服务器上运行(这是主要目标,它应该从另一台服务器运行。 curl -G http://ip_of_the_same_server:8086/query -u my_user –data-urlencode "q=SHOW DATABASES"

不能curl到NodeJS,但可以从浏览器访问它

我可以从浏览器访问我的testing节点站点( http://18.220.168.1:8888 )就好了。 但是,当我尝试使用PHP的cURLcurl时,我得到: Array ( [curl_error] => Failed to connect to 18.220.168.1 port 8888: Connection refused [error_number] => 7 ) 我的cURL设置是: $ch = curl_init($url); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); // Temporary for testing self-signed sites curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type: '.$data_type, 'Content-Length: […]

如何使用bash引用和转义

我被给了一个url列表,生成404错误报告给我们的谷歌。 我可以用curl(从命令行)testing一个URL,像这样: curl -k –user-agent "Googlebot/2.1 (+http://www.google.com/bot.html)" https://MYURLHERE 其工作完全符合我的预期。 我想把它放在一个脚本中,所以我可以在这里列出一个列表。 #!/usr/bin/bash url=$1 curlcmd="curl -k –user-agent \"Googlebot/2.1 (+http://www.google.com/bot.html)\"" $curlcmd $url 但它不工作。 我不断收到 curl: (1) Protocol "(+http" not supported or disabled in libcurl 我不知道如何逃避这个工作。 有什么build议么 ?

调用未定义的函数curl_init()

我在Windows XP Pro上运行XAMP。 我已经在PHP.INI启用curl重新启动我的机器和Apache。 extension=php_curl.dll 仍然我在我的PHP脚本中出现以下错误: 调用未定义的函数curl_init() php_curl.dll文件位于C:\ Program Files \ xampp \ php \ ext目录下,并且有这一行 extension_dir = "C:\Program Files\xampp\php\ext\"

如何在ISS 7,PHP5和Win Server 03上安装cURL

我的问题是在标题allready“如何安装cURL的Windows Server 2003机器与ISS 7.0和PHP 5?”。 我尝试在互联网上阅读HowTos,但没有得到任何关于todo的话,我对php和命令行的东西经验太less了… 所以我希望这里的某个人知道该怎么做,并帮助我。

从HTTP头中检索文件大小而不用CURL(无头文件)下载文件

我想要做的是知道文件大小,而不是下载它。 我已经用HEAD尝试过,但服务器不响应curl_setopt($ curl,CURLOPT_NOBODY,true); 如果我放弃这个,它会,但它会下载整个文件… 所以,如果我能以某种方式告诉curl,最大接收的数据不应该通过某些字节,并停止或超时,不要等到整个文件被下载, 在正常下载中: GET /filepath HTTP/1.1 Host: host.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.6) Gecko/20100625 Firefox/3.6.6 (.NET CLR 3.5.30729) Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 115 Connection: keep-alive 响应标题 HTTP/1.0 200 OK Server: Apache/ (Debian GNU/Linux) PHP/ Content-Type: application/octet-stream ETag: "MFFPJ28A" Content-Length: 3342417 Content-Disposition: attachment Cache-Control: […]

运行SugarCRM的Ubuntu 9.10服务器上的cURL库导致Scheduler问题

运行Ubuntu 9.10,Apache 2.2,MySQL 5.1.37,PHP 5.2.10,SugarCRM Pro 5.5.4 我开始通过尝试使用Sugar函数调用Scheduler和糖抱怨: This system does not have the cURL libraries enabled/compiled into the PHP module (–with-curl=/path/to/curl_library). Please contact your administrator to resolve this issue. “Without the cURL functionality, the Scheduler cannot thread its jobs. 我确认curl,系统上安装了libcurl软件包。 但是现在我无法find在php.ini文件中指向哪个文件。 有些论坛说,我需要一个php_curl.so文件(类似于Windows中的php_curl.dll ),但我只能findcurl.so 我在哪里更改extension_dir=/path/to/libraries指向? 由于我没有php_curl.so文件,我应该使extension= curl.so ? 一些输出,当我重新启动我的apache2在这里: PHP Warning: PHP Startup: Unable to […]

IIS6,Windows Server 2003上的PHP。启用cURL会导致CGI错误

我在Windows Server 2003 R2 SP2上运行IIS6服务器。 我已经在服务器上安装了PHP,它的大多数工作正常。 但是,如果我尝试启用PHP的cURL扩展,当我尝试运行任何php脚本时,出现以下错误: CGI Error The specified CGI application misbehaved by not returning a complete set of HTTP headers. 只要我禁用cURL扩展,每个脚本工作得很好。 任何想法是怎么回事?

我如何启用curl支持php 5.3.3?

嗨,我已经安装curl和curl开发,但我仍然无法curl与PHP的工作。 我的PHPconfiguration行: './configure''–with-apxs2 = / usr / local / apache2 / bin / apxs'–with-gd''–with-mysql''–with-zlib''–enable-mbstring '–with-pdo-mysql''–prefix = / php-5.3.3''–with-config-file-path = / php-5.3.3''–with-mysqli = / usr /斌/ mysql_config” 安装卷发包: curl.i386安装了7.16.4-1.fc7 curl-devel.i386安装了7.16.4-1.fc7 安装curl#yum curl之后,它应该自动启用它的PHP,但curl仍然不能在PHP中。 提前致谢。

php curl扩展问题,ubuntu

我已经安装(作为根) aptitude install curl php5-curl libcurl3 libcurl3-dev 并添加extension = curl.so到我的php.ini(我认为这不是自动完成的,因为我使用的是Lighty而不是apache) service lighttpd restart 但仍然没有运气,当我运行phpinfo()时没有任何关于cURL的信息 curl.so位于/ usr / lib / php5 / 20090626