PHP encryption method-use Zend Encoder to encrypt PHP files and optimize PHP configuration (PHP file encryption)

Source: Internet
Author: User
Encrypt PHP files and optimize PHP configuration with Zend Encoder
When you publish a PHP program that you have written, are you worried that the results you have worked so hard on will be taken by others? In fact, we can use Zend Encoder to add a protective shell to our PHP file.
Software version: 2.0.1
Software size: 10.2M
Applicable platform: Win9X / 2000 / XP
Official Website:
The use of the software is very simple, first select "File"-"New Project" to create a new project, and then add the files or folders you want to encrypt under the project. Enter the path to the encrypted PHP file in the "Target Directory" option on the right. Then click the "Encode" button to encrypt the PHP files in the current project. You can also save the current project so that your PHP files are re-encrypted after the update. After the PHP file is encrypted, the file size also becomes much smaller. Previously, a 30K file was encrypted only 14K.
Tip: In the "Tools"-"Settings" dialog box, "Extensions to Encoder" text box, you can specify the file extensions to be encrypted (multiple extensions are separated by spaces), so that Zend Encoder only applies to these files encryption.
The encrypted PHP file requires Zend Optimizer on the server for normal display. Generally, the file can be found in the "optimizer_packages" directory of the "Zend Encoder" compressed package. /free download. After the installation is completed, restart the WEB server to browse the encrypted PHP file normally. The general PHP space should support Zend Optimizer.

One of PHP optimized configuration?
Make forums faster PHP acceleration settings PHP acceleration: Zend Optimizer optimizes PHP programs?

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

Zend Optimizer V2.5.7 For Windows software introduction:?

Zend Optimizer uses code optimization to improve the execution speed of PHP 4.0 applications. The implementation principle is to optimize the code generated by the Run-Time Compiler before it is finally executed. In general, executing PHP programs using Zend Optimizer is 40% to 100% faster than not using them. This means that website visitors can browse the web faster, thereby completing more transactions and creating better customer satisfaction. Faster response also means it can save hardware investment and enhance 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 operate websites. Running PHP programs quickly can significantly reduce the server's CPU load and reduce response time in half, 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 programs?

Zend Optimizer is a free PHP optimization software run by the PHP core engine "Zend"? Http: // Founder Zend Technologies. According to Zend, using this software can improve performance by at least 30% in some cases! Now let's see how to configure this software. ?

How easy is Zend Optimizer installation?

1. Run the installation file, first prompt you to choose the installation directory, choose a directory you like, and click "Next". ?
2. The installation wizard will ask you to select the current web server (Apache, IIS or other). After selecting the server, click "Next"?
3. The installation wizard prompts you to confirm the location of php.ini (the default is C: \ WINDOWS \), click "Next", and prompt "Back up php.ini to C: \ WINDOWS \ php.ini-Optimizer-bak. Software can be restored to the original php.ini) Click "Next".
4. The installation wizard prompts "IIS service needs to be restarted in order to continue the installation process." Click "Yes", the installation program starts to restart the IIS service, and then the installation program will prompt "IIS service restarted successfully." Click OK, and Click "finish" to complete the installation.
5. After installation, the program will automatically modify php.ini according to your choice to help you start this engine. Let's introduce the configuration options of Zend Optimizer to help you maximize the reasonable and reasonable configuration. ?

zend_optimizer.optimization_level = 15 ?? // zend_optimizer.optimization_level = 1023 in my configuration file?
zend_extension_ts = "C: \ Inetpub \ Zend \ lib \ ZendExtensionManager.dll" ???? // This is related to your installation path?
zend_extension_manager.optimizer_ts = "C: \ Inetpub \ Zend \ lib \ Optimizer-2.5.5"?

Now let ’s introduce the meaning of the relevant content in the above configuration files:?
zend_optimizer.optimization_level "== Optimization level. Here we define how many optimization processes are started. ?
zend_optimizer.encoder_loader << = Whether to allow PHP files encrypted by Zend Encoder to be processed. Allowed by default. ?
zend_extension_ts << = The directory where the optimizer is located. ?
zend_extension_manager.optimizer_ts << = The directory where the optimizer manages. ?

The optimization process zend_optimizer.optimization_level explained in detail?

The most important part here, take a closer look! Zend Opt has a total of 10 optimization processes. Theoretically, the more performance, the better. Of course, there is always a gap between theory and reality. The more the optimization process is started, the larger the performance consumption is. The 10 optimization processes of Zend Opt are not the same, that is, the effect is not average. Zend company defined the highest value (High mode) is 15, where 15 refers to the optimization process of opening 1-4. Of course, many friends are not satisfied with this. After all, only four optimization processes are started at most, not even half of the total. The corresponding numerical code (value) of each optimization process is as follows:?

Do not use 0 <= If this is better not to install, but also save a bit of 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 to start the optimization process is controlled by the sum of these digital codes (values) and the parameter value as this parameter. For example, zend_optimizer.optimization_level = 1023 in my configuration file, 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 turned on. The High mode value defined by the Zend company just mentioned is 15, and 15 means that the optimization process 1-4 is started at the same time. ?

Encryption code support zend_optimizer.encoder_loader Detailed explanation?

Regarding this parameter, I think most of the 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. If you do not use encrypted code, I recommend that you turn off this option. This function involves the process of unpacking the inverse code, which will cause the system load to increase. My friend has developed the corresponding decompiler tool and it is expected to be launched after the Spring Festival. ?

The value of this parameter is only two. 0 is off and 1 is on. The default is 1, and the recommended setting is 0. ?

Module positioning 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 do I know if Zend Optimizer is running? ?
The answer is very simple, as long as the PHP function phpinfo () is used to detect, as follows:?
phpinfo () ;?

The part of the displayed result about Zend Optimizer looks like the following: (The PHP version is different, the information may be different, mine is PHP4.3.11)?

CODE: [Copy to clipboard] 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 ???
This indicates that Zend Optimizer for PHP optimization was successful.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.