Home  >  Article  >  Backend Development  >  PHP optimization configuration - speed up your VBB, phpwind, Discuz, IPB, MolyX page 1/2_PHP tutorial

PHP optimization configuration - speed up your VBB, phpwind, Discuz, IPB, MolyX page 1/2_PHP tutorial

WBOY
WBOYOriginal
2016-07-21 15:54:21894browse

Make the forum faster PHP acceleration settings PHP acceleration: Zend Optimizer optimizes PHP programs

Zend Optimizer V2.5.7 For Windows
Software language: English
Running environment: Win9x/NT/2000/XP

Zend Optimizer V2.5.7 For Windows software introduction:

Zend Optimizer uses code optimization methods to improve the execution speed of PHP 4.0 applications. The principle of implementation is to optimize the code generated by the run-time compiler (Run-Time Compiler) before being finally executed. In general, PHP programs that use Zend Optimizer are 40% to 100% faster than those that do not. This means website visitors can browse the web faster, get more done, and create better customer satisfaction. Faster response also means saving on hardware investment and enhancing the services provided by the website. Therefore, using Zend Optimizer is equivalent to improving the profitability of e-commerce. Zend Optimizer can bring many benefits to PHP users, especially those who run websites. Running PHP programs quickly can significantly reduce the CPU load on the server and can cut in half the response time, which is the time between when a visitor clicks a link and when the server starts reading the page.

Install Zend Optimizer to optimize PHP program

Zend Optimizer is a free PHP optimization software developed by Zend Technology, the creator of the PHP core engine "Zend" http://www.zend.com. According to Zend, using this software can improve performance by at least 30% in some cases! Now let's take a look at how to configure this software.

Zend Optimizer installation is very simple

1. Run the installation file. You will first be prompted to select the installation directory. Select a directory you like and click "Next".
2. The installation wizard will ask you to select the WEB server you are currently using (Apache, IIS or others). After selecting the server, click "Next"
3. The installation wizard will prompt you to confirm the location of php.ini (default It is C:WINDOWS) Click "Next", it prompts "Backup php.ini to C:WINDOWSphp.ini-Optimizer-bak, you can restore to the original php.ini when the software is uninstalled) Click "Next".
4. The installation wizard prompts "In order to continue the installation program, the IIS service needs to be restarted." Click "Yes", the installation program begins to restart the IIS service, and then the installation program will prompt "The IIS service has been successfully restarted." Click "OK" ", and then click "finish" to complete the installation.
5. After the installation is completed, the program will automatically modify php.ini according to your choice to help you start the engine. Below we will introduce the configuration options of Zend Optimizer to help you maximize Customize reasonable configuration.
zend_optimizer.optimization_level=15 //Zend_optimizer.optimization_level = 1023 in my configuration file
zend_extension_ts="C:InetpubZendlibZendExtensionManager.dll" // This is related to your installation path
zend_extension_manager.optimizer_ts="C:InetpubZendlibOptimizer-2.5.5"

Now we will introduce the meaning of the relevant contents in the above configuration files:
zend_optimizer.optimization_level " == Optimization degree, here defines how many optimization processes to start.
zend_optimizer.encoder_loader "== Whether to allow processing of PHP files encrypted by Zend Encoder, allowed by default.
zend_extension_ts "==" The directory where the optimizer is located. >zend_extension_manager.optimizer_ts "== Directory where optimizer management is located.

Optimization process zend_optimizer.optimization_level Detailed explanation

The most important part here, look carefully! Zend Opt has a total of 10 optimization processes. In theory, the more the optimization process is enabled, the better the performance. Of course, there is always a gap between theory and practice. The more optimization processes are enabled, the greater the performance consumption. The 10 optimization processes of Zend Opt are not the same. It is said that the effect is not average. The highest value (High mode) defined by Zend is 15, where 15 refers to opening the optimization process No. 1-4. Of course, many friends are not satisfied with this, after all, only 4 optimizations are enabled. The process is not even half of the total. The corresponding numerical codes (values) of each optimization process are as follows:

Not used 0 <= If this is not the case, it can save some memory!
Optimization process 1 (PASS1) 1
Optimization process 2 (PASS2) 2
Optimization process 3 (PASS3) 4
Optimization process 4 (PASS4) 8
Optimization process 5 (PASS5) 16
Optimization process 6 (PASS6) 32
Optimization process 7 (PASS7) 64
Optimization process 8 (PASS8) 128
Optimization process 9 (PASS9) 256
Optimization process 10 (PASS10) 512

The way in which the optimization process is started is controlled by adding the sum of these digital codes (values) as the parameter value of this parameter. For example, in my configuration file zend_optimizer.optimization_level = 1023, where 1023 is the sum of all digital codes (values) from optimization process 1 to optimization process 10, which means that all 10 optimization processes are enabled. The High mode value defined by the Zend company just mentioned is 15, and 15 means that optimization processes 1-4 are enabled at the same time.

Encryption code support zend_optimizer.encoder_loader detailed explanation

For this parameter, I think most friends who have not read the Zend Opt FAQ document do not know. This parameter is used to tell Zend Opt whether to support code encrypted by Zend Encoder. Zend Opt will support encrypted code by default. I recommend turning this option off if you are not using encrypted code. This function involves the process of unpacking and inverting the code, which will increase the system load. My friend has developed the corresponding decompilation tool and is expected to launch it after the Spring Festival.

The values ​​of this parameter are only two: 0 is off and 1 is on. The default is 1, and the recommended setting is 0.

Module location zend_extension_ts and zend_extension_manager.optimizer_ts need no explanation. These parameters are the installation paths of Zend Optimizer related modules on the hard disk.

6. How to know whether Zend Optimizer is running?
The answer is very simple, just use the PHP function phpinfo() to detect it, as shown below:
phpinfo();
?>

Display The part about Zend Optimizer in the results is as follows: (different PHP versions, the information may be different, mine is PHP4.3.11)


[Copy to clipboard] [ - ]CODE:
This program makes use of the Zend Scripting Language Engine:
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies with Zend Extension Manager v1.0.6, Copyright (c) 2003-2004, by Zend Technologies with Zend Optimizer v2.5.7, Copyright (c) 1998-2004, by Zend Technologies

indicates that Zend Optimizer for PHP optimization was successful.

PHP Optimization Configuration 2
Accelerate with eAccelerator (formerly Truck MMCache)
What is eAccelerator?
---------------- ----
eAccelerator is a free open source PHP accelerator, optimizer, encoder and
dynamic content cache for PHP. It increases performance of PHP scripts by
caching them in compiled state, so that the overhead of compiling is almost
completely eliminated. Also it uses some optimizations to speed up execution
of PHP scripts. eAccelerator typically reduces server load and increases the
speed of your PHP code by 1-10 times.

eAccelerator is a fork of TurckMMCache
eAccelerator (formerly Truck MMCache)

I believe many friends know MMCache, but the developer was recruited by Zend a long time ago, so MMCache has never had an official new version ...To support the latest PHP4.4.0 or PHP5.04, you need to compile the source code yourself, which is a fantasy for ordinary users...Don't be discouraged, we also have eAccelerator!

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/318489.htmlTechArticleMake the forum faster PHP acceleration settings PHP acceleration: ZendOptimizer optimizes PHP program ZendOptimizerV2.5.7ForWindows Software language: English running Environment: Win9x/NT/2000/XP ZendOptimizerV2.5.7F...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn