In php, there is a remarkable extension called Zend OPcache. Like most of php accelerators it caches the compiled php-bytecode, thereby increasing the performance of php-applications.

But what if you have a php-application on your server that you do not need to cache this way? It can be a test installation of some framework or CMS, a rarely used application — phpMyAdmin for example, or something like that.

For this case, in the OPcache settings there is an option called "opcache.blacklist_filename", in which you can specify the path to the file containing the "black list" of files that you don't want to be cached. In addition, if you need to exclude an entire application, you can specify all of its files using wildcards, for example /var/www/phpmyadmin/*.php

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.

php.net/manual

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.

zend.com/help

But for some reason these manuals do not specify that wildcards are work correctly only in *nix systems. If you working on Windows server, the usage of the symbols "*" and "?" leads to incorrect behavior of Zend OPcache.

On VM with Windows 7 x86 SP1 there installed and configured Apache/2.4.27 and PHP/7.1.9. If OPcache blacklist file contains the string:

c:\apache\htdocs\pma\*

the folder c:\apache\htdocs\pma\ is cached, i.e. OPcache blacklist file is ignored. But if we replace the string with:

c:\apache\htdocs\pma\

then everything goes as it should — c:\apache\htdocs\ is cached and c:\apache\htdocs\pma\ is skipped.

Also, a check was performed on the popular web server stack package called XAMPP (Windows 7 x64 SP1, Apache/2.4.23, PHP/7.0.13). Unlike the first experiment, this time, when the "*" character was used, the cache did not work at all and all files were blacklisted.

POSSIBLE, this is due to the code section below

/* Resolve path relatively to state and put the real path into state */
/* returns 0 for ok, 1 for error */
CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func verify_path, int use_realpath)
{

/*
...
SOME CODE
...
*/

#ifdef ZEND_WIN32
	if (memchr(resolved_path, '*', path_length) ||
		memchr(resolved_path, '?', path_length)) {
		return 1; /* Returning a unit, as can be seen from the annotation to a function, means an error */
	}
#endif

/*
...
SOME CODE
...
*/

}

github.com/php/php-src

Conclusion

It seems that for Zend OPcache blacklist to work correctly on Windows, it is impossible to use symbols "*" and "?" in it. If you want to exclude a folder, you just need to specify the path to it, for example C:\sites\example.com\public-html\.