nginx+php-fpm 502 bad gateway

输出日志配置:

http://blog.****.net/wzy_1988/article/details/8486888

解决方案:

http://www.cnblogs.com/jackluo/p/3366612.html

http://leezqang.blog.51cto.com/1525874/1365140

有关file_get_contents引起的502解决方案:

http://www.111cn.net/phper/php-function/55873.htm

http://www.qetee.com/share/php-fpm-cpu100.html

参考

http://yige.org/p/867

使用自己封装的file_get_content函数代替系统自带的file_get_contents

function _file_get_content($str) { 
$ctx = stream_context_create(array(   
   'http' => array(   
       'timeout' => 10 //设置一个超时时间,单位为秒   
       )   
   )   
);   
return file_get_contents($str, 0, $ctx);   
}