opcache
How to determine if PHP OPcache is enabled or not?
Have faith in your phpinfo(), you’ve got the necessary shared module running or it wouldn’t be showing up. Also, your opcache is indeed enabled, but only for web, not cli. The default for the library is enabled for web so , to disable uncomment the line starting with a semicolon like this: opcache.enable=0 As noted, … Read more
Disable OPCache temporarily
Once your script runs, it’s too late to not cache the file. You need to set it outside PHP: If PHP runs as Apache module, use an .htaccess file: php_flag opcache.enable Off If PHP runs as CGI/FastCGI, use a .user.ini file: opcache.enable=0 In all cases, you can also use good old system-wide php.ini if you … Read more
What does a \ (backslash) do in PHP (5.3+)?
\ (backslash) is the namespace separator in PHP 5.3. A \ before the beginning of a function represents the Global Namespace. Putting it there will ensure that the function called is from the global namespace, even if there is a function by the same name in the current namespace.
How to use PHP OPCache?
Installation OpCache is compiled by default on PHP5.5+. However it is disabled by default. In order to start using OpCache in PHP5.5+ you will first have to enable it. To do this you would have to do the following. Add the following line to your php.ini: zend_extension=/full/path/to/opcache.so (nix) zend_extension=C:\path\to\php_opcache.dll (win) Note that when the path … Read more