解決Apache錯(cuò)誤zend_mm_heap corrupted、Segmentation fault (11)
2016-11-23 20:16:46
12925
最近有一臺(tái)Linux服務(wù)器間隙的報(bào)錯(cuò),Apache每過一段時(shí)間就會(huì)假死,web環(huán)境是LNMPA。
檢查Apache日志error_log,發(fā)現(xiàn)錯(cuò)誤如下:
[Thu Jul 28 15:21:45 2016] [notice] child pid 16842 exit signal Segmentation fault (11)
[Thu Jul 28 15:22:29 2016] [notice] child pid 16839 exit signal Segmentation fault (11)
[Thu Jul 28 15:22:40 2016] [notice] child pid 16994 exit signal Segmentation fault (11)
[Thu Jul 28 15:24:28 2016] [notice] child pid 17169 exit signal Segmentation fault (11)
zend_mm_heap corrupted
zend_mm_heap corrupted
zend_mm_heap corrupted
zend_mm_heap corrupted
這個(gè)時(shí)候,nginx是正常的,靜態(tài)資源可以訪問,絕大多數(shù)php頁面也是可以訪問的,但是一旦php頁面需要調(diào)用底層命令的時(shí)候,就報(bào)錯(cuò)了,比如Laravel的生成配置緩存命令:
$exitCode1 = Artisan::call('config:cache', []);//重新生成配置緩存
$exitCode2 = Artisan::call('route:cache', []);//重新生成路由緩存
$exitCode3 = Artisan::call('optimize', []);//生成編譯文件
此時(shí)Apache無法正常執(zhí)行php頁面。
網(wǎng)上搜搜,發(fā)現(xiàn)了stack overflow上的一篇POST: http://www.tjdsmy.cn/questions/2247977/what-does-zend-mm-heap-corrupted-mean,里面提供了一個(gè)思路,導(dǎo)致這個(gè)問題的原因在于 opcache,只要把 opcache的cli方式關(guān)閉就可以了,打開php.ini:
opcache.enable_cli=0
會(huì)員登錄
賬號(hào)登錄還沒有賬號(hào)?立即注冊