PHP crashing during oAuth scripts
- by FunkyChicken
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 :(