1

一些基本信息:

Linux:2.6.32(64位)

PHP: 5.4.15

阿帕奇:2.4.4

MySQL:5.6.11

装甲运兵车:3.1.9

Wordpress:3.5.1,带有 Woocommerce(2.0.10)

问题是,当我启用 APC 时,会出现以下错误:

Warning: register_shutdown_function(): Invalid shutdown callback 'wpdb::__destruct' passed in /usr/local/httpd/htdocs/wp-includes/wp-db.php on line 537

Fatal error: Call to undefined method wpdb::init_charset() in /usr/local/httpd/htdocs/wp-includes/wp-db.php on line 542

这是我在 php.ini 中的 APC 配置:

[APC]
; Reference: http://www.php.net/manual/en/apc.configuration.php
extension=apc.so

apc.enabled=1

apc.shm_segments=1

; 32MB per Wordpess install.  Ref: http://gregrickaby.com/the-perfect-apc-configuration/
apc.shm_size=320M

;Relative to the number of cached files (you may need to watch your stats for a day or two to find out a good number)
apc.num_files_hint=10000

;Relative to the size of WordPress
apc.user_entries_hint=10000

;The number of seconds a cache entry is allowed to idle in a slot before APC dumps the cache
apc.ttl=7200
apc.user_ttl=7200
apc.gc_ttl=3600

;Setting this to 0 will give you the best performance, as APC will
;not have to check the IO for changes. However, you must clear 
;the APC cache to recompile already cached files. If you are still
;developing, updating your site daily in WP-ADMIN, and running W3TC
;set this to 1
apc.stat=1

;This MUST be 0, WP can have errors otherwise!
apc.include_once_override=0

;Only set to 1 while debugging
apc.enable_cli=0

;Allow 2 seconds after a file is created before it is cached to prevent users from seeing half-written/weird pages
apc.file_update_protection=2

;Leave at 2M or lower. WordPress does't have any file sizes close to 2M
apc.max_file_size=2M

;Ignore files
apc.filters = "/usr/local/httpd/htdocs/apc.php,/usr/local/httpd/htdocs/phpinfo.php,wp-cache-config"

apc.cache_by_default=1
apc.use_request_time=1
apc.slam_defense=0
;apc.mmap_file_mask=/tmp/apc.XXXXXX
apc.stat_ctime=1
apc.canonicalize=1
apc.write_lock=1
apc.report_autofilter=0
apc.rfc1867=0
apc.rfc1867_prefix =upload_
apc.rfc1867_name=APC_UPLOAD_PROGRESS
apc.rfc1867_freq=0
apc.rfc1867_ttl=3600
apc.lazy_classes=0
apc.lazy_functions=0
apc.file_md5=0

以下是我尝试过的一些组合:

apc.stat = 0, apc.stat_ctime=0

apc.stat = 1, apc.stat_ctime=1

apc.stat = 0, apc.stat_ctime=1

apc.stat = 0, apc.stat_ctime=0

但是,APC 仍然无法使用。只有当我禁用 APC 时,该站点才能正常工作。

谁能告诉我是什么问题?

先感谢您。

图片中的 APC 配置

4

2 回答 2

1

可能 APC 没有正确解释 register_shutdown_function 的语法。使用此函数定义静态方法回调有两种方法:

  1. register_shutdown_function('someClass::someMethod');
  2. register_shutdown_function(array('someClass', 'someMethod'));

您可以参考文档和评论以获取更多信息: http ://php.net/manual/en/function.register-shutdown-function.php

于 2013-05-31T10:55:01.057 回答
0

当我从 php.ini 禁用 apc 时,Wordpress 也为我工作

于 2013-12-13T14:21:53.447 回答