dongwaner1367 2013-04-30 16:34
浏览 128
已采纳

PHP APC导致Apache出现故障

First, versions:

Apache 2.2.22
PHP 5.3.10
Ubuntu 12.04 LTS (everything updated)
APC 3.1.7 (installed via APT and not PEAR)

The problem I'm experiencing is that when issuing a graceful restart (sudo service apache2 graceful), PHP has a fatal error which causes Apache to seg fault. This is what I see in /var/log/apache2/error.log:

[Tue Apr 30 11:05:33 2013] [notice] Graceful restart requested, doing restart
PHP Fatal error:  PHP Startup: apc_mmap: mmap failed: in Unknown on line 0
[Tue Apr 30 11:05:34 2013] [notice] seg fault or similar nasty error detected in the parent process

/etc/php5/conf.d/apc.ini only contains the following:

extension=apc.so
apc.shm_size=256M

Linode is my host. I have the 1GB version with a 256MB swap partition, so 256M should be a reasonable value for apc.shm_size (prior to the recent Linode memory upgrade, I only had 512MB of memory, and apc.shm_size was set to 128M).

Here is some general cache information as shown in apc.php:

APC Version 3.1.7
PHP Version 5.3.10-1ubuntu3.6
APC Host    [removed]
Server Software Apache/2.2.22 (Ubuntu)
Shared Memory   1 Segment(s) with 256.0 MBytes
(mmap memory, pthread mutex Locks locking)
Start Time  2013/04/30 11:09:44
Uptime  21 minutes
File Upload Support 1

Here are my runtime settings as shown in apc.php:

apc.cache_by_default    1
apc.canonicalize    1
apc.coredump_unmap  0
apc.enable_cli  0
apc.enabled 1
apc.file_md5    0
apc.file_update_protection  2
apc.filters 
apc.gc_ttl  3600
apc.include_once_override   0
apc.lazy_classes    0
apc.lazy_functions  0
apc.max_file_size   1M
apc.mmap_file_mask  
apc.num_files_hint  1000
apc.preload_path    
apc.report_autofilter   0
apc.rfc1867 0
apc.rfc1867_freq    0
apc.rfc1867_name    APC_UPLOAD_PROGRESS
apc.rfc1867_prefix  upload_
apc.rfc1867_ttl 3600
apc.serializer  default
apc.shm_segments    1
apc.shm_size    256M
apc.slam_defense    1
apc.stat    1
apc.stat_ctime  0
apc.ttl 0
apc.use_request_time    1
apc.user_entries_hint   4096
apc.user_ttl    0
apc.write_lock  1

I've done a ton of searching around, but I just can't figure out what's causing this. Is this perhaps a PHP or APC or Apache bug? Is there some configuration value I need to add/change?

Thanks for any help!

[edit]
I just tried updating APC (removed it in apt and installed through PECL), but that didn't fix the problem. I still see seg faults with APC 3.1.13.

  • 写回答

2条回答 默认 最新

  • duanran8648 2013-04-30 23:37
    关注

    After looking around, I noticed a troublesome line in /var/log/syslog:

    kernel: apache2[11303]: segfault at ffffffff ip b7647bd8 sp bfe854b0 error 7 in libpthread-2.15.so[b763f000+17000]
    

    After a little Googling, I came across https://bugs.launchpad.net/ubuntu/+source/apache2/+bug/1159748, a confirmed bug in the Ubuntu Apache distribution. I'm glad I'm not crazy! If anyone else encounters this, be sure to follow the progress on this bug.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog