日期:2011-07-02  浏览次数:20523 次

最近由于update了ubuntu的源,导致原来新源与本地系统库一些lib冲突,导致系统桌面显示异常,后来只有重装,新安装了php5.4.9,还安装了redis,php-redis扩展,php-redis扩展2,10。但把原来的项目一放上去,就报nginx 502错误(nginx 502错误真是个很头疼的问题)。打开nginx日志查看
 
[error] 29229#0: *1403 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 127.0.0.1, server:
 
不知道所云。后来打开php-fpm错误日志,得到的log日志
 
[08-Oct-2013 21:22:23] WARNING: [pool www] child 12026 exited on signal 11 (SIGSEGV - core dumped) after 5.997917 seconds from start
 
[08-Oct-2013 21:22:23] NOTICE: [pool www] child 12034 started
 
可以确定的一点,是php-fpm在一个时间点后重启了一个进程。还是毫无头绪。在网上搜了一大遍,有个有用的跟踪方法。
 
1、设置php-fpm,只起一个work进程
 
2、重启php-fpm, 执行ps aux grep php-fpm 得到work进程号pid
 
3、strace -p  pid 
 
下面是我得到的信息
 
getcwd("/home/www/wms2.xxxx.com", 4096) = 26
 
lstat("/home/www/wms2.xiaomi.com/./RWebUser.php", 0x7ffff4e30a10) = -1 ENOENT (No such file or directory)
 
lstat("/home/www/wms2.xiaomi.com/protected/vendor/wms/api/RWebUser.php", 0x7ffff4e30a10) = -1 ENOENT (No such file or directory)
 
lstat("/home/www/wms2.xiaomi.com/protected/vendor/wms/RWebUser.php", 0x7ffff4e30a10) = -1 ENOENT (No such file or directory)
 
lstat("/home/www/wms2.xiaomi.com/protected/extensions/log/RWebUser.php", 0x7ffff4e30a10) = -1 ENOENT (No such file or directory)
 
lstat("/home/www/wms2.xiaomi.com/protected/modules/rights/components/RWebUser.php", {st_mode=S_IFREG0777, st_size=2945, ...}) = 0
 
lstat("/home/www/wms2.xiaomi.com/protected/modules/rights/components", {st_mode=S_IFDIR0777, st_size=4096, ...}) = 0
 
lstat("/home/www/wms2.xiaomi.com/protected/modules/rights", {st_mode=S_IFDIR0777, st_size=4096, ...}) = 0
 
lstat("/home/www/wms2.xiaomi.com/protected/modules", {st_mode=S_IFDIR0777, st_size=4096, ...}) = 0
 
open("/home/www/wms2.xiaomi.com/protected/modules/rights/components/RWebUser.php", O_RDONLY) = 5
 
fstat(5, {st_mode=S_IFREG0777, st_size=2945, ...}) = 0
 
fstat(5, {st_mode=S_IFREG0777, st_size=2945, ...}) = 0
 
fstat(5, {st_mode=S_IFREG0777, st_size=2945, ...}) = 0
 
fstat(5, {st_mode=S_IFREG0777, st_size=2945, ...}) = 0
 
mmap(NULL, 2945, PROT_READ, MAP_SHARED, 5, 0) = 0x7fd9b4804000
 
mmap(NULL, 266240, PROT_READPROT_WRITE, MAP_PRIVATEMAP_ANONYMOUS, -1, 0) = 0x7fd9b442f000
 
munmap(0x7fd9b4804000, 2945)            = 0
 
close(5)                                = 0
 
getcwd("/home/www/wms2.xxx.com", 4096) = 26
 
lstat("/home/www/wms2.xxx.com/./XMCCacheHttpSession.php", 0x7ffff4e31060) = -1 ENOENT (No such file or directory)
 
lstat("/home/www/wms2.xxx.com/protected/vendor/wms/api/XMCCacheHttpSession.php", 0x7ffff4e31060) = -1 ENOENT (No such file or directory)
 
lstat("/home/www/wms2.xxx.com/protected/vendor/wms/XMCCacheHttpSession.php", 0x7ffff4e31060) = -1 ENOENT (No such file or directory)
 
lstat("/home/www/wms2.xxx.com/protected/extensions/log/XMCCacheHttpSession.php", 0x7ffff4e31060) = -1 ENOENT (No such file or d