【问题标题】:Can't configure APC for PHP无法为 PHP 配置 APC
【发布时间】:2012-08-30 18:14:40
【问题描述】:

我的新专用服务器遇到了一个非常奇怪的问题。 它安装了 Plesk 11,我正在尝试在其中安装 APC。一切顺利,我可以在phpinfo() 上看到 APC 配置,但我无法配置它!我正在尝试各种可能的方法,但 phpinfo 中显示的配置没有改变。它没有显示 apc.ini 配置文件已加载到其他 ini 文件中,但如果我在文件中注释 extension=apc.so 行,APC 就会关闭。

我的 apc.ini 文件来了:

[APC]
extension=apc.so

apc.enabled = 1    # Turn APC cache on
apc.optimization  = 0    # Experimental keep off
apc.shm_segments = 1    # Shared memory segments
apc.shm_size = 256M  # Max shared memory dependent on OS
apc.ttl = 7200
apc.user_ttl  = 7200
apc.num_files_hint = 1024
apc.mmap_file_mask = /tmp/apc.XXXXXX
apc.enable_cli = 1 # Allow command line php to function
apc.cache_by_default  = 1 # Enabled, 0 for filters
apc.max_file_size = 10M # Maximum cached file size
apc.stat = 1 # 1 for dev, 0 for production, whether the source file is checke$
#apc.include_once_override = 1 # Use PHP5.3+ for include_once optimization

在此先感谢,并为我的英语不好感到抱歉,

维尼修斯

【问题讨论】:

  • 使用文件 apc.php 检查 apc 的执行情况。如果您托管多个网站,256M 可能会很低。确保 APC 的内存比实际使用的多 20%。

标签: php apc ini php-extension


【解决方案1】:

哦,我的错。 ini 文件中的 cmets 不应该与# 一起使用,它们与; 一起使用。真的对不起。现在它就像一个魅力。

【讨论】:

    猜你喜欢
    • 2014-09-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-03-19
    相关资源
    最近更新 更多