Php 启用apc后,magento站点无法正常工作

Php 启用apc后,magento站点无法正常工作,php,magento,apc,magento-1.8,Php,Magento,Apc,Magento 1.8,我在我的magento站点中使用apc操作码缓存,我在php.ini文件中完成了以下配置: apc.enabled=1 apc.shm_size=512M apc.num_files_hint=10000 apc.user_entries_hint=10000 apc.ttl=7200 apc.user_ttl=7200 apc.max_file_size=5M apc.stat=0 apc.optimization=0 apc.shm_segments=1 apc.enable_cli=1 a

我在我的magento站点中使用apc操作码缓存,我在php.ini文件中完成了以下配置:

apc.enabled=1
apc.shm_size=512M
apc.num_files_hint=10000
apc.user_entries_hint=10000
apc.ttl=7200
apc.user_ttl=7200
apc.max_file_size=5M
apc.stat=0
apc.optimization=0
apc.shm_segments=1
apc.enable_cli=1
apc.cache_by_default=1
apc.include_once_override=0
还完成了app/etc/local.xml中的代码,但我的网站上没有显示产品详细信息页面,也显示了一些意外行为 请提供适当的指导以启用它

谢谢:)

**Magento推荐的APC配置**
默认情况下,不针对Magento调整APC配置。在某些情况下,您会在服务器日志中看到致命错误,例如“PHP致命错误:无法重新声明类”。要修复此类错误,您需要更改PHP.INI文件或APC.INI中的默认APC配置(取决于您的配置)。
以下是Magento社区和企业的推荐APC设置:
apc.enabled=1
apc.shm_尺寸=512M
apc.num\u文件\u提示=10000
apc.user\u entries\u hint=10000
apc.max_文件大小=5M
apc.stat=0
apc.optimization=0
apc.shm_段=1
apc.enable_cli=1
apc.cache\u默认值=1
apc.include_once_override=1
如果使用APC字节码缓存,则必须禁用修改时间检查选项(APC.stat)。
**在Magento配置中激活APC支持**
为了激活Magento core中的APC支持,您应该修改/app/etc/local.xml配置文件。
在全局标记之间添加以下行:
...
apc
MYSTORE_
...
“Prefix”值是一个简短的描述符,允许您对同一服务器上的多个Magento存储使用APC缓存,它对于您拥有的每个Magento存储都应该是唯一的。
如果要为Magento启用2级缓存,可以使用local.xml中的slow_backend标记。
Magento有两级缓存:快速缓存和慢速缓存。如果可能,Magento将使用快速级别,如果APC中没有可用内存,它将恢复到慢速级别缓存。它将消除与缓存内存问题相关的任何停机时间。
您可以为slow\u后端定义“数据库”或“文件”值:
...
apc
数据库
MYSTORE_
...
保存local.xml并测试Magento storefront。如果您注意到任何错误,请确保正确修改了local.xml。

有关更多详细信息:

感谢Needhi抽出宝贵的时间
**Recommended APC configuration for Magento**

By default APC configuration is not adjusted for Magento. In some cases you will see fatal errors in server logs, e.g. "PHP Fatal error: Cannot redeclare class". To fix such errors you need to change default APC configuration in PHP.INI file or APC.INI (depending on your configuration).

Here are recommended APC settings for Magento Community and Enterprise:

apc.enabled=1
apc.shm_size=512M
apc.num_files_hint=10000
apc.user_entries_hint=10000
apc.max_file_size=5M
apc.stat=0
apc.optimization=0
apc.shm_segments=1
apc.enable_cli=1
apc.cache_by_default=1
apc.include_once_override=1

In case of using APC bytecode cache, the modification time check option (apc.stat) must be disabled.

**Activate APC support in Magento configuration**

In order to activate APC support in Magento core, you should modify /app/etc/local.xml configuration file.
Add these lines between GLOBAL tags:

<global>
        ...
        <cache>
            <backend>apc</backend>
<prefix>MYSTORE_</prefix>
        </cache>
        ...
</global>
The "Prefix" value is a short descriptor that will allow you to use APC caching for several Magento stores on the same server, it should be unique for each Magento store you have.

If you want to enabled 2 level cache for your Magento, you can use slow_backend tag in local.xml.

Magento has two levels cache: a fast level and a slow level cache. Magento will use the fast level if possible, and if there is no memory available in APC, it will revert to the slow level cache. It will eliminate any down time connected with cache memory issues.

You can define "database" or "file" values for slow_backend:


<global>
        ...
        <cache>
            <backend>apc</backend>
            <slow_backend>database</slow_backend>
<prefix>MYSTORE_</prefix>
        </cache>
        ...
</global>
Save local.xml and test Magento storefront. If you will notice any errors, make sure that local.xml was modified correctly.