View Discussion Show Improve Article Save Article View Discussion Improve Article Save Article The OPCache is used for improving the performance of PHP as it stores the precompiled bytecode, in result deleting the need for loading and parsing the PHP scripts upon each request. Requirements: Packages such as Zend OPCache are required for the purposeful use. The zendOPCache package contains PHP versions 5.2, 5.3 and 5.4. This package is used with the basic fulfillment of the need for opcode caching and hence optimization. It will improve the performance of PHP by storing the precompiled bytecode in the shared memory and eliminating the need of reading the code
from the disk and compiling it for future access.
Enabling OPCache extensions:
Information regarding New Releases, Downloads, ChangeLog and additional information can be found here. Advised php.ini setting:
A full list of configuration directive supported by OPcache is also available. OPCache Functions:
How can I tell if PHP Opcache is enabled?Answer. Check which PHP handler is used by the website at Domains > example.com > PHP Settings > PHP support ( PHP version ...) ... . Check if Opcache is enabled for the domain at Domains > example.com > PHP Settings > Performance Settings > opcache.enable "on". Can PHP files be cached?The Windows Cache Extension for PHP includes a file cache that is used to store the content of the PHP script files in shared memory, which reduces the amount of file system operations performed by PHP engine. Resolve File Path Cache - PHP scripts very often include or operate with files by using relative file paths.
What is PHP OpCode cache?What are OpCode Caches? OpCode Caches are a performance enhancing extension for PHP. They do this by injecting themselves into the execution life-cycle of PHP and caching the results of the compilation phase for later reuse. It is not uncommon to see a 3x performance increase just by enabling an OpCode cache.
How does PHP store data in cache?The easiest is to serialize() the data and store it in your database. When you need to retrieve the database, query it from the database, unserialize() it, and use it as before. As second approach is to add memcache to your PHP installation and access your data via the memcache functions.
|