502-PHP-FPM Nginx Request HTTPS with Curl 502 error

Source: Internet
Author: User
Tags php compiler
The URL with php Curl request HTTPS 502 error, ask to help resolve.

PHP Version: 5.6.7
Nginx Version: 1.8.0

The code is as follows:

$ch = curl_init();curl_setopt($ch, CURLOPT_URL, 'https://www.baidu.com');curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);curl_setopt($ch, CURLOPT_TIMEOUT, 10);curl_exec($ch);

PHP-FPM log:

[28-Jun-2015 04:04:20] NOTICE: [pool www] child 21701 started[28-Jun-2015 04:07:33] WARNING: [pool www] child 21692 exited on signal 11 (SIGSEGV) after 222.256700 seconds from start[28-Jun-2015 04:07:33] NOTICE: [pool www] child 21735 started

Reply content:

The URL with php Curl request HTTPS 502 error, ask to help resolve.

PHP Version: 5.6.7
Nginx Version: 1.8.0

The code is as follows:

$ch = curl_init();curl_setopt($ch, CURLOPT_URL, 'https://www.baidu.com');curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);curl_setopt($ch, CURLOPT_TIMEOUT, 10);curl_exec($ch);

PHP-FPM log:

[28-Jun-2015 04:04:20] NOTICE: [pool www] child 21701 started[28-Jun-2015 04:07:33] WARNING: [pool www] child 21692 exited on signal 11 (SIGSEGV) after 222.256700 seconds from start[28-Jun-2015 04:07:33] NOTICE: [pool www] child 21735 started

The code is right ...

Having the same problem, the whole morning was gone. The same question ~ ~

Recompile PHP and disable the SQLite module.

It looks ridiculous, but it does.

I have encountered such a wonderful problem before, your PHP compiler problem, may be a conflict with a module, re-minimum compile or change a machine to try

$return = curl_exec ($ch);

    $return = curl_exec ($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/600.3.18 (KHTML, like Gecko) Version/8.0.3 Safari/600.3.18");    模拟浏览器 不报502 但是 这是为什么呢~          -------------------------------------------    经过两三个小时 google  百度  无果;又不想重装         看了下 curl -V 既支持 ssl 又支持 https;        由于本人是使用 brew 安装的php56 所以 打算重新装下curl试试;        brew uninstall curl;    brew install curl --with-openssl;         重启 我了个草的 修复了~      总结 curl本身不支持 openssl

HTTPS request, Curlopt_ssl_verifypeer set to True
No need to add curlopt_ssl_verifyhost, try!

Is your OpenSSL system self-bringing? Some of the Mirror's own OpenSSL and curl have compatibility issues, will be reflected in the PHP HTTPS request, re-install the OpenSSL test.

Ubuntu 14.04 Self-compiled version of NTS PHP5.4 and PHP7 RC2, with the SQLite extension, run the code of the landlord, there is no problem. Dependent Curl Libraries are libcurl3:amd64 7.35.0-1ubuntu2.5 :

dpkg -S /usr/lib/x86_64-linux-gnu/libcurl.so.4.3.0

The same problem API HTTPS also does not access MAC Brew installation PHP

I'm running fine.

HTTPS problem, add Fastcgi_param https on after fastcgi_pass this configuration; We should be able to solve the problem.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.