Use Zend Opcache to speed up PHP, zendopcache_PHP tutorial
Use Zend Opcache to accelerate PHP. zendopcache
Optimizer is a closed-source but free-to-use PHP optimization acceleration component developed by Zend. It is the first and fastest opcode caching tool. . Now, Zend Technologies has open sourced Optimizer as Zend Opcache under the PHP License.
Zend OPcache provides faster PHP execution through opcode caching and optimization. It stores precompiled script files in shared memory for later use, thus avoiding the time consumption of reading code from disk and compiling it. At the same time, it also applies some code optimization modes to make the code execute faster.
1. What is opcode cache?
When the interpreter completes the analysis of the script code, it generates intermediate code that can be run directly, also known as opcode (Operate Code, opcode). The purpose of Opcode cache is to avoid repeated compilation and reduce CPU and memory overhead. If the performance bottleneck of dynamic content lies not in CPU and memory, but in I/O operations, such as the disk I/O overhead caused by database queries, then the performance improvement of opcode cache is very limited. But since opcode cache can reduce CPU and memory overhead, this is always a good thing - in an environmentally friendly manner, consumption should be reduced as much as possible, right? :D
Modern opcode caches (Optimizer, APC2.0, others) use shared memory for storage and can execute files directly from them without having to "deserialize" the code before execution. This results in significant performance speedups, often lower overall server memory consumption, and few downsides.
2. Comparison of the advantages and disadvantages of Optimizer and APC
Optimizer was renamed Opcache in mid-March 2013.
According to discussions on the PHP wiki, Zend Opcache is about to be integrated into php 5.5. As a competitor of APC, the new Zend Opcache is likely to replace APC's position, although OptimizerPlus does not have a user cache function like APC.
Advantages of OPTIMIZER over APC
Advantages of APC over OPTIMIZER
3. Use Zend Opcode
It is now possible to use Zend Opcache instead of APC as a PHP optimization acceleration tool. The current Zend Opcode is compatible with PHP 5.2.*, 5.3.*, 5.4.* and PHP-5.5 development version. However, support for PHP 5.2 will be removed in the future.
Note: Zend Opcache conflicts with eaccelerator. To install Zend Opcache, you may need to uninstall eaccelerator first - if you use this acceleration module.
Install and configure from source
The source code of Zend Opcache is hosted on github, and it is still called ZendOptimizerPlus.
For detailed installation steps, please refer to its README file.
Note:
By the way, php-devel is required when compiling and installing from source code. It is used at the beginning of the quick installation section in README,
$PHP_DIR/bin/phpize
If you don’t know the path of phpize, you can,
whereis phpize
There are also corresponding recommended optimization settings in the README file.
Install and configure from EPEL source
I don’t like to compile and install programs from source code. One is because of my limited skills, and the other is because I am afraid of trouble. The following describes how to install Zend Opcache from the EPEL installation source, taking the operation on CentOS as an example, based on the configuration of my VPS.
The EPEL community has provided an installation package for Zend Opcache, which can be installed directly using yum. Of course, the premise is that the EPEL installation source has been configured and used. If not, you can refer here.
As a reminder, the PHP on the REMI installation source is already version 5.4. Since some people have tested that WordPress performs better on PHP 5.4 than on PHP 5.3 (10% faster and lower ram consuming), it’s not a bad thing to upgrade PHP by the way.
Operation steps:
Check to see if it started correctly:
php -v
The output is similar to:
PHP 5.4.14 (cli) (built: Apr 11 2013 11:04:35) Copyright (c) 1997-2013 The PHP Group Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies with Zend OPcache v7.0.1, Copyright (c) 1999-2013, by Zend Technologies<br /><br /><br /><span><strong><span>原文转载于:http://cnzhx.net/blog/zendopcache-accelerate-php</span></strong>/ 感谢原著</span>

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



PHP implementation framework: ZendFramework introductory tutorial ZendFramework is an open source website framework developed by PHP and is currently maintained by ZendTechnologies. ZendFramework adopts the MVC design pattern and provides a series of reusable code libraries to serve the implementation of Web2.0 applications and Web Serve. ZendFramework is very popular and respected by PHP developers and has a wide range of

How to use ACL (AccessControlList) for permission control in Zend Framework Introduction: In a web application, permission control is a crucial function. It ensures that users can only access the pages and features they are authorized to access and prevents unauthorized access. The Zend framework provides a convenient way to implement permission control, using the ACL (AccessControlList) component. This article will introduce how to use ACL in Zend Framework

PHP does not recognize ZendOptimizer, how to solve it? In PHP development, sometimes you may encounter a situation where PHP cannot recognize ZendOptimizer, which will cause some PHP codes to not run properly. In this case, we need to take some measures to solve the problem. Some possible workarounds are described below, along with specific code examples. 1. Confirm whether ZendOptimizer is installed correctly: First, we need to confirm that ZendOptimizer

The Windows 2003 installation package includes Zend, PHP5.2.17, PHPWind8.7 and PHPMyadmin3.5.2. You can download the installation package directly to save time searching for resources. However, since MySQL has exceeded the upload limit, you need to go to the MySQL official website to download. Then unzip and copy to the D drive, as shown below: MySQLinDdisk Install and configure WindowsIIS+FTP Click Start>Control Panel>Add or Remove Programs.AddingordeletingaPG Click Add/Remove Windows Components (A). Addingorde

With the explosive growth of Internet information, search engines have become one of the preferred ways for people to obtain information. Now, as the number of websites continues to increase, the rapid response and accuracy of search engines have become more and more important, which requires search engines to have high performance. In this article, I will introduce how to use the PHP framework Zend to develop a high-performance search engine. 1. Why use Zend Framework? Zend Framework is a high-performance PHP framework that has excellent performance and scalability.

With the rapid development of information technology, more and more enterprises are beginning to realize the necessity of information management. ERP (Enterprise Resource Planning) management platform is an important tool for modern enterprise management, which can help enterprises realize resource planning, collaboration, control, optimization and management. Among them, the PHP framework Zend is an excellent development tool that can help developers develop ERP systems quickly and efficiently. This article will introduce how to use Zend to develop an efficient ERP management platform. 1. Determine requirements analysis before starting the development process

With the continuous development of Internet applications, the demand for the development of large-scale applications is also increasing. In this context, it is particularly important to choose a development framework that suits you. Laravel and Zend are two widely used PHP frameworks. They each have their own advantages, but which one is more suitable for developing large-scale applications? Laravel is a popular development framework that has become one of the preferred frameworks for PHP developers. It adopts a modern design concept and has a variety of powerful built-in functions and tools, such as EloquentOR

PHP is a widely used dynamic web programming language. Developers can make use of different frameworks to simplify their web development work. Symfony and ZendFramework are one of the two most popular frameworks in PHP. Beginners are often confused when choosing between Symfony3 and ZendFramework3. Here we will compare these two frameworks to see which one is easier to get started with. Symfony3Symfony is a PH based on the MVC model
