nginx+php-fpm 502 bad gateway

输出日志配置:

http://blog.csdn.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);   
}

 

posted on 2014-12-13 17:33  walter371  阅读(249)  评论(0编辑  收藏  举报

导航