Articles of curl

NGINX工人还不够

我对nginx的工作人员不太熟悉,所以我需要一些帮助。 我有一个服务器上的两个网站 http://example.com http://example-second.com 第二个是通过第一个API调用接收json数组。 这是情况。 在http://example-second.com/api_call.php文件中有 function get_curl($url) { $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_HEADER, false); $result = curl_exec($curl); curl_close($curl); return $result; } $url=get_curl("http://example.com/api.php?ID=foo"); 在http://example.com/api.php function get_curl_from_api($url) { $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_RETURNTRANSFER => 1, CURLOPT_URL => $url, CURLOPT_HEADER=> 0, CURLOPT_RETURNTRANSFER=> 0, CURLOPT_SSL_VERIFYPEER=> 1, CURLOPT_SSL_VERIFYHOST=>2 )); $resp = […]

cURL错误60:对方的证书颁发者不被识别

我有一个商店build立wordpres提供wordpress模板,它有一个更新系统。 我的服务器是centos 6.9,使用了virtualmin。 Comodo SSL和php7但是当人们尝试更新他们的主题时他们得到的消息Download faild.cURL error 60: Peer's Certificate issuer is not recognized. 对不起,我不是一个服务器的专家,但林非常混淆这个问题,如果任何人知道解决scheme的任何帮助将非常赞赏。Thankyou。 另外,将我的域名移动到SSL后,我看到我在谷歌排名下降,也许是因为这个问题?

Curl收到过期的cookies

为什么curl收到一个过期的cookie? 在对某个url的响应中,服务器发送一个302 Found响应和一个cookie。 在Firefox中,这个cookie被无缝地设置。 Firebug说: Set-Cookie somekookie=91b115e3d4a5889ed93e70a7ddb24957a1eb0e27cbcd96a3342a8064; expires=Sun, 24-Oct-2010 23:28:55 GMT; path=/; domain=.somedomain.ru 然而,当curl请求相同的URL时,cookie已经过期,curl的输出: * Added cookie somecookie="deleted" for domain somedomain.com, path /, expire 1224891945 < Set-Cookie: somecookie=deleted; expires=Fri, 24-Oct-2008 23:45:45 GMT; path=/; domain=.somedomain.com 为什么date似乎如此之久以及如何解决这个问题?

从PHP缓慢curl,其他

最近切换到不同的服务器,一些PHP文件使用curl,似乎本来运行良好,但不是那么多了。 这里是google.com的curl_getinfo array(20) { ["url"]=> string(22) "http://www.google.com/" ["content_type"]=> string(24) "text/html; charset=UTF-8" ["http_code"]=> int(200) ["header_size"]=> int(504) ["request_size"]=> int(1136) ["filetime"]=> int(-1) ["ssl_verify_result"]=> int(0) ["redirect_count"]=> int(1) ["total_time"]=> float(20.098232) ["namelookup_time"]=> float(0.006034) ["connect_time"]=> float(0.020963) ["pretransfer_time"]=> float(0.020999) ["size_upload"]=> float(0) ["size_download"]=> float(5481) ["speed_download"]=> float(272) ["speed_upload"]=> float(0) ["download_content_length"]=> float(5481) ["upload_content_length"]=> float(0) ["starttransfer_time"]=> float(0.047948) ["redirect_time"]=> float(20.035229) } 有1redirect,这是不知何故花了20秒,基本上100%的时间,我等待。 还有其他一些奇怪的延迟,login到ssh需要20-30秒才能在密码之后进行身份validation/拒绝,而且以前是瞬间的。 有任何想法吗?

用最新的openssl和curl编译php

我想用最新的curl和openssl(1.0.1l)编译php 5.4.36,我已经编译openssl到一个分离的文件夹 我的系统是CentOS。 当我尝试编译PHP与 ./configure …etc… –with-curl=/usr/local/curlfolder –with-openssl=/usr/local/opensslfolder 我得到这个错误: checking whether to enable FTP support… yes checking OpenSSL dir for FTP… /usr/local/opensslfolder checking for pkg-config… /usr/bin/pkg-config configure: error: Cannot find OpenSSL's libraries curl和openssl编译没有任何问题

将curl升级到最新的CentOS 7

我需要在运行CentOS 7的VPS上升级cURL。 我得到的错误为: cURL Error(35): Cannot communicate securely with peer: no common encryption algorithm(s) 我已经使用了前面给出的答案:将curl升级到最新的CentOS 6.3但是到RPM文件的链接已经死了,我不知道从yum-repo页面的列表中select哪一个。 帮助如何升级curl高度赞赏。 谢谢。

PHPcurl破碎

打电话时,Curl似乎挂起。 这是打破wordpress / wp-admin网站和用于IP-SMS的twillio助手库。 这个问题出现在安装vsftpd和创build新用户之后。 脚本来testingcurl:(从谷歌) function nxs_cURLTest($url, $msg, $testText){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.73 Safari/537.36"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 10); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); $response = curl_exec($ch); $errmsg = curl_error($ch); $cInfo = curl_getinfo($ch); curl_close($ch); echo "Testing … ".$url." – ".$cInfo['url']."<br />"; […]

支付宝的Centos 5.11 OpenSSL TLS 1.2

我在运行Centos 5.11的服务器上运行一个网站 – EOL现在我知道,但升级是不可能的一段时间。 该网站运行与Paypal集成的Sellerdeck软件进行支付。 在接下来的一个月左右,PayPal将要求我使用TLS 1.2 [1]来连接它们,这是5.11(0.9.8b)中安装的默认OpenSSL版本所不支持的。 我遵循指示[2]安装第二版的OpenSSL,第二版的Curl链接到新版本的OpenSSL,它将支持TLS 1.2,但它仍然没有通过贝宝testing。 在/ usr / local /中使用OpenSSL 1.0.2k的Centos 5.11 /usr/local/bin/curl https://tlstest.paypal.com curl: (35) Unknown SSL protocol error in connection to tlstest.paypal.com:443 CentOS 6.9与OpenSSL 1.0.1e-fips curl https://tlstest.paypal.com PayPal_Connection_OK 任何人都可以帮助指出我正确的方向,为什么连接不与更新的OpenSSL? 非常感谢 凯文 1 – https://www.paypal-knowledge.com/infocenter/index?page=content&widgetview=true&id=FAQ1914&viewlocale=zh_CN 2 – https://miteshshah.github.io/linux/centos/how-to-enable-openssl-1-0-2-a-tlsv1-1-and-tlsv1-2-on-centos-5-and- RHEL5 / 详细的非工作输出: /usr/local/bin/curl -Ivvv https://tlstest.paypal.com * Rebuilt URL to: https://tlstest.paypal.com/ […]

getaddrinfo(3)失败

我试图连接到一个使用PHP包装(这是使用下面的curl)web服务。 在我运行PHP 5.3的本地linux机器上,它完美的工作。 但是,当我移动到远程服务器(也在Linux上运行PHP 5.3)时,Web服务URL的调用返回: getaddrinfo(3) failed for http://server.host.com:8080/login 但是,当我从命令行发出curl请求时,它将返回所需的URL。 任何人都可以在这个问题上的任何亮光? 谢谢!

不能curl大文件

我正在使用下面的curl语法将文件复制到另一台服务器,并按预期工作。 curl -F file=@/home/abc.txt.gz http://1.2.3.4/upload.php 但是,如果文件abc.txt.gz的大小超过2 MB或3 MB,则会失败,并返回错误代码1.是curl命令的文件大小限制部分还是networking问题?