apache2 与 APC 兼容后出现的问题

发布于 2024-11-08 04:35:21 字数 1424 浏览 0 评论 0原文

问题是在 apache2 优雅之后 apc 将无法正常工作。 apache error.log 中有一条错误消息,内容为“无法重新声明类 bughandlerabstract。

通常有一个具有此名称的类,但正确的名称是 BugHandlerAbstract。apache2

重新启动后它将再次工作。

我尝试了一些更改apc.ini,但现在没有任何作用。我也尝试使用 apc.filters 从 apc 中排除 BugHandlerAbstract.php,但问题没有解决,

然后我在关闭中执行了 Zend_Session::writeClose();处理程序但也没有解决问题,

这是 apc 的设置:

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 BugHandlerAbstract.php
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    768M
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

General Cache Information
APC Version 3.1.7
PHP Version 5.3.3-7
APC Host    app6.xxxxxxxxxxxx.de
Server Software Apache/2.2.16 (Debian)
Shared Memory   1 Segment(s) with 768.0 MBytes
(mmap memory, pthread mutex Locks locking)
Start Time  2011/05/20 11:18:48
Uptime  34 minutes
File Upload Support 1

谢谢。

The problem is that after a apache2 graceful the apc won't work correctly. There is an error message in the apache error.log with "cannot redeclare class bughandlerabstract.

Normaly there is a class with this name, but the correct name ist BugHandlerAbstract.

After a apache2 restart it will work again.

I've tried some changes in the apc.ini, but nothing work right now. I tried also to exclude the BugHandlerAbstract.php from apc with apc.filters, but the problem was not solved.

Then i've done a Zend_Session::writeClose(); in our shutdown handler but also not solving the problem.

Here are the settings of the apc:

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 BugHandlerAbstract.php
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    768M
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

General Cache Information
APC Version 3.1.7
PHP Version 5.3.3-7
APC Host    app6.xxxxxxxxxxxx.de
Server Software Apache/2.2.16 (Debian)
Shared Memory   1 Segment(s) with 768.0 MBytes
(mmap memory, pthread mutex Locks locking)
Start Time  2011/05/20 11:18:48
Uptime  34 minutes
File Upload Support 1

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

绝影如岚 2024-11-15 04:35:22

我的开发盒中也遇到了同样的问题,说实话,我无法使用任何建议的解决方案来解决它。

APC 非常好,但我想这个问题没有解决方案。
我猜它在 APC 中存在错误,所以我建议您将缓存主机 app6.xxxxxxxxxxxx.de 转换为 xcache,您将能够在不到1小时,节省时间。

I had the same problem in my development box and to be honest I wasn't able to fix it with any proposed solution .

APC is very good but i guess there is no solution to this issue .
I guess its bug in APC so I would advise you to convert your cache host app6.xxxxxxxxxxxx.de to xcache and you would be able to convert to it easily in less than 1 hour , so save your time .

屋檐 2024-11-15 04:35:22

Dirk,

PHP 5.3.7 不是稳定的 PHP 5.3.1.7 被认为已过时且存在已知错误。运行最新的稳定版本可能会解决您的问题。当您在未打开 APC 的情况下运行时,是否会遇到关闭和无法重新声明类错误?是什么让阿帕奇表现得很优雅?

通常出现无法重新声明函数或类错误是因为类或函数加载了 2 次,而不是因为是否被缓存。 PHP 非常聪明。也许

apc.filters 需要正则表达式。要排除该类,请尝试:

apc.filters "\BugHandlerAbstract\.php$"

尝试更改这些部分。

apc.ttl 3600
apc.user_ttl  3600
apc.include_once_override   1
apc.lazy_classes    1
apc.lazy_functions  1

Dirk,

PHP 5.3.7 isn't a stable PHP 5.3.1.7 is considered outdated and has known bugs. Running latest stable might solve your problem. Do you get shutdowns and the can't redeclare class error when you run without APC turned on? Whats causing Apache to do a graceful?

Usually with a can't redeclare function or class error it's because the class or function is loading 2 times not because of being cached or not. PHP is pretty smart. Maybe

the apc.filters requires a regex. To exclude the class try:

apc.filters "\BugHandlerAbstract\.php$"

Try changing these sections.

apc.ttl 3600
apc.user_ttl  3600
apc.include_once_override   1
apc.lazy_classes    1
apc.lazy_functions  1
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文