使用Zend Opcache将目录列入黑名单 [英] Blacklist a directory with Zend Opcache
问题描述
我如何告诉Zend Opcache 不缓存特定目录中的任何文件.
例如/var/www/public_html/devzone/*
How can i tell Zend Opcache not to cache any files from a specific directory.
For e.g /var/www/public_html/devzone/*
我将PHP 5.5.13
与Zend OPcache v7.0.4-dev
一起使用
推荐答案
You should set the opcache.blacklist_filename
configuration value with a file path to your blacklist.
OPcache黑名单文件的位置.黑名单文件是一个文本文件,其中包含不应加速的文件名,每行一个.允许使用通配符,也可以提供前缀.以分号开头的行将被忽略为注释.
The location of the OPcache blacklist file. A blacklist file is a text file containing the names of files that should not be accelerated, one per line. Wildcards are allowed, and prefixes can also be provided. Lines starting with a semi-colon are ignored as comments.
例如,创建一个新文件:
For example, create a new file:
/etc/php5/opcache-blacklist.txt
使用通配符设置保存:
/var/www/public_html/devzone/*
并将黑名单文件路径添加到您的php.ini
:
And add the blacklist file path to your php.ini
:
opcache.blacklist_filename=/etc/php5/opcache-blacklist.txt
这篇关于使用Zend Opcache将目录列入黑名单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!