Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I just installed Nginx 1.2.4 and PHP 5.4.0 (from svn) (php fpm). CentOs 5.8 64

The problem I have is that PHP crashes the moment I run any social oAuth scripts. I have tried to log into Facebook, Twitter and Google with various scripts that I know work on my other servers. When I load the scripts I get a 502 error from Nginx. And I find these errors in the log:

in php-fpm log:

WARNING: [pool www] child 23821 exited on signal 11 (SIGSEGV) after 1132.862984 seconds from start

in nginx log:

ERROR: recv() failed (104: Connection reset by peer) while reading response header from upstream

From what I can see, it goes wrong when PHP tries to make a request to any of the oAuth servers.

https://github.com/mahmudahsan/PHP-SDK-3.0---Graph-API-base-Facebook-Connect-Tutorial-Source for example is one of the scripts that works perfectly on my other machines, but causes PHP to crash.

I found: http://stackoverflow.com/questions/3616191/nginx-php-fpm-502-bad-gateway which seems to be a similar problem, but I cannot find a way to solve it.

+++ UPDATE +++

Now I have been doing some debugging in 1 of the scripts that is playing up.

If you go to line 808 http://pastebin.com/gSnzRtXb it runs the curl_exec() command.

When that is ran, it crashes. If i echo'test';exit; just above that line, it echo's correctly, if i do it below that line, php crashes.

Which means it's that line 808 which causes the crash.

So I made a very simple script to do some testing: http://pastebin.com/Rshnyhcm which also uses curl_exec, but that runs just fine.

So I started to dig deeper into that query from the facebook script to see what values the $opts array contains from line 806.

Output of that array is: http://pastebin.com/Cq9ffd3R

What the problem is, I still have no clue :(

share|improve this question
    
Your problem sounds like a mismatch between libcurl version and php-curl module. Do you have more than one libcurl installed? When you compiled PHP it may have used a different version of libcurl than the one it's trying to use now. –  DerfK Oct 29 '12 at 13:40
    
How could I find out if this is the case? –  Mr.Boon Oct 29 '12 at 14:37
    
Did you say PHP 5.4.0? I'm quite sure there have been several bug-fix releases since then... –  Michael Hampton Oct 29 '12 at 16:25
    
Found out what is causing the problem. cURL requests in PHP that request an https:// link cause PHP to crash. http:// links work fine. Weirdly enough cURL is configured with https support though: i.imgur.com/zfkj5.png so I have no idea how to fix it. –  Mr.Boon Oct 29 '12 at 16:35
    
That means it's likely a difference between libcurl's openssl library and either PHP or apache's openssl library –  DerfK Oct 29 '12 at 20:55

1 Answer 1

up vote 0 down vote accepted

Was solved by upgrading to PHP 5.4.8

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.