0

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: 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 :(

Community
  • 1
  • 1
Mr.Boon
  • 2,024
  • 7
  • 35
  • 48
  • In your test you are just making an HTTP requests, but the request to FB’s servers go out via HTTPS. Maybe that’s where the problem lies, cURL not correctly configured for HTTPS, firewall blocking outgoing request, etc. – CBroe Oct 29 '12 at 15:56
  • Good thinking! I changed my test script: http://pastebin.com/Rshnyhcm to an https connection, and indeed it crashes. With http it worked just fine. I use iptables, but allow all outgoing connections. Is there something else what I can check which causes this https cURL problem? – Mr.Boon Oct 29 '12 at 16:12

1 Answers1

0

solved it by updating PHP to 5.3.8

Mr.Boon
  • 2,024
  • 7
  • 35
  • 48