1

いくつかの基本情報:

Linux: 2.6.32 (64 ビット)

PHP: 5.4.15

アパッチ: 2.4.4

MySQL: 5.6.11

APC: 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 の構文を正しく解釈していません。この関数で静的メソッド コールバックを定義するには、次の 2 つの方法があります。

  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 に答える