Table of Contents
1. Install eaccelerator-0.9.5 (also supports ZendOptimizer-3.2.2)
2. Detailed explanation of eaccelerator configuration information (translated according to the official English description)
Home Backend Development PHP Tutorial Install and configure eaccelerator-0.9.5 to accelerate PHP-5.2.1

Install and configure eaccelerator-0.9.5 to accelerate PHP-5.2.1

Oct 15, 2019 am 09:50 AM
eaccelerator zendoptimizer optimization accelerate

Operating system: Linux

1. Install eaccelerator-0.9.5 (also supports ZendOptimizer-3.2.2)

1. First install ZendOptimizer -3.2.2

  # wget http://www.vista.ac.cn/linux/down/ZendOptimizer/ZendOptimizer-3.2.2-linux-glibc21-i386.tar.gz
  # tar zxvf ZendOptimizer-3.2.2-linux-glibc21-i386.tar.gz
  # cd ZendOptimizer-3.2.2-linux-glibc21-i386
  # ./install.sh
Copy after login

In Please specify the location for installing ZendOptimizer: enter the ZendOptimizer installation path after the prompt, for example /data/webserver/zend

In Confirm the location of your php.ini file: prompt and enter the directory where the php.ini file is located, such as /data/webserver/php/etc

. In Specify the full path to the Apache control utility (apachectl): prompt and enter apachectl absolute Path, such as /data/webserver/apache/bin/apachectl

2. Install eaccelerator-0.9.5 acceleration software (recommended learning: PHP video tutorial)

  # wget http://www.vista.ac.cn/linux/down/eaccelerator/eaccelerator-0.9.5.tar.bz2
  # tar jxvf eaccelerator-0.9.5.tar.bz2
  # cd eaccelerator-0.9.5
Copy after login

Specify the path where php is located:

  # export PHP_PREFIX="/data/webserver/php"
  # $PHP_PREFIX/bin/phpize
  # ./configure --enable-eaccelerator=shared --with-php-config=$PHP_PREFIX/bin/php-config
  # make
  # make install
Copy after login

At this time, eaccelerator will be installed in the php directory, and the screen will display the path where eaccelerator.so is located, for example:

Installing shared extensions: /data/webserver/php/lib/php/extensions/no-debug-zts-20060613/

Remember this path.

Eaccelerator can be installed as a PHP extension or as a zend extension. The following installation is a PHP extension.

If the /etc/php.d directory exists, you need to copy eaccelerator.ini to the directory and then modify the default value. If it does not exist, modify php.ini and add the following content before [zend] (note: it must be placed before [zend]):

[eaccelerator]
  extension="/data/webserver/php/lib/php/extensions/no-debug-zts-20060613/eaccelerator.so"
  eaccelerator.shm_size="32"
  eaccelerator.cache_dir="/data/cache/eaccelerator"
  eaccelerator.enable="1"
  eaccelerator.optimizer="1"
  eaccelerator.check_mtime="1"
  eaccelerator.debug="0"
  eaccelerator.filter=""
  eaccelerator.shm_max="0"
  eaccelerator.shm_ttl="0"
  eaccelerator.shm_prune_period="0"
  eaccelerator.shm_only="0"
  eaccelerator.compress="1"
  eaccelerator.compress_level="9"
Copy after login

Create a cache directory:

    # mkdir -p /data/cache/eaccelerator
  # chmod 0777 /data/cache/eaccelerator
Copy after login

Restart Apache:

 # service httpd restart
Copy after login

3. Check whether ZendOptimizer and eaccelerator are installed successfully

Create a phpinfo.php file with the following content:

  <?php
      phpinfo();
  ?>
Copy after login

Place the file in Website directory, access it in the browser, if the following content appears, the installation is successful:

  This program makes use of the Zend Scripting Language Engine:
  Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
      with eAccelerator v0.9.5, Copyright (c) 2004-2006 eAccelerator, by eAccelerator
      with Zend Extension Manager v1.0.11, Copyright (c) 2003-2006, by Zend Technologies
      with Zend Optimizer v3.2.2, Copyright (c) 1998-2006, by Zend Technologies
Copy after login

2. Detailed explanation of eaccelerator configuration information (translated according to the official English description)

extension="/data/webserver/php/lib/php/extensions/no-debug-zts-20060613/eaccelerator.so"
Copy after login

Explanation: The path of the PHP extension eaccelerator.so.

--------------------

eaccelerator.shm_size="32"
Copy after login

Explanation: The size of shared memory that can be used by eaccelerator (unit for MB).

Under Linux, the maximum memory usage of a single process is limited by the number (in bytes) set in /proc/sys/kernel/shmmax. For example, the default shmmax value of CentOS 4.4 is 33554432 bytes ( 33554432bytes/1024/1024=32MB).

Temporarily change the value:

# echo 字节数 > /proc/sys/kernel/shmmax
Copy after login

Follow the above method and the value will be automatically restored each time the system is restarted. If you want to make permanent changes, you can modify the /etc/sysctl.conf file and set:

  kernel.shmmax = 字节数
Copy after login

--------------------

  eaccelerator.cache_dir="/data/cache/eaccelerator"
Copy after login

Explanation: For the cache path, you can use the command mkdir -p /data/cache/eaccelerator to create the directory, and then use the command chmod 0777 /data/cache/eaccelerator to set the directory permissions to 0777

-- ------------------

    eaccelerator.enable="1"
Copy after login

Explanation: Turn on or off eaccelerator. "1" means on, "0" means off. The default value is "1".

--------------------

  eaccelerator.optimizer="1"
Copy after login

Explanation: Turn on or off code optimization. Turning on can speed up the execution of the code. speed. "1" means on, "0" means off. The default value is "1".

--------------------

  eaccelerator.check_mtime="1"
Copy after login

Explanation: When this item is turned on, eaccelerator will Check the modification time of the php file to see if it has been modified. This will take a while. If the php file has been modified, eaccelerator will recompile and cache the php file. When this option is turned off, if the PHP file is modified, the eaccelerator cache needs to be manually deleted before the modified PHP file can be displayed. "1" means on, "0" means off. The default value is "1".

--------------------

  eaccelerator.debug="0"
Copy after login

Explanation: Turn on or off debugging logging. When turned on, eaccelerator will log every request for a cache file. Turning this on is only beneficial when debugging whether the eaccelerator has bugs. "1" means on, "0" means off. The default value is "0".

--------------------

  eaccelerator.filter=""
Copy after login

Explanation: Determine which PHP files should be cached. You can specify a range (such as "*.php *.phtml"), so that the specified files will be cached. If the range begins with !, the specified file will not be cached. The default value is "", which means to cache all PHP files.

--------------------

  eaccelerator.shm_max="0"
Copy after login

Explanation: A user can use a function such as eaccelerator_put to share Maximum data loaded in memory. The default value is "0", which means no limit. (Unit is bytes)

--------------------

  eaccelerator.shm_ttl="0"
Copy after login

Explanation: When there is not enough free sharing When memory attempts to buffer a new script, files that have not been accessed for at least shm_ttl seconds ago will be deleted. The default value is "0", which means no attempt will be made to remove any old scripts from shared memory. (Unit is seconds)

--------------------

  eaccelerator.shm_prune_period="0"
Copy after login

解释:当没有足够的空闲共享内存去尝试缓冲一个新脚本时,将删所有旧脚本,前提是这个尝试在超过shm_prune_period秒之前被执行过。默认值为"0",表示不尝试从共享内存中删除任何旧的脚本。(单位为秒)

--------------------

  eaccelerator.shm_only="0"
Copy after login

解释:打开或者关闭在磁盘上缓存编译过的脚本。这个参数对会话数据和内容缓存没有效果。默认值为"0",表示使用磁盘和共享内存来缓存。

--------------------

  eaccelerator.compress="1"
Copy after login

解释:打开或者关闭缓存内容压缩。"1"指打开,"0"指关闭。默认值为"1"。

--------------------

  eaccelerator.compress_level="9"
Copy after login

解释:内存压缩的级别。默认值为"9",表示最大压缩。

  参考资料:

  1、Installing from source (http://www.eaccelerator.net/wiki/InstallFromSource)

  2、eAccelerator settings (http://www.eaccelerator.net/wiki/Settings)

The above is the detailed content of Install and configure eaccelerator-0.9.5 to accelerate PHP-5.2.1. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1659
14
PHP Tutorial
1257
29
C# Tutorial
1231
24
How to optimize settings and improve performance after receiving a new Win11 computer? How to optimize settings and improve performance after receiving a new Win11 computer? Mar 03, 2024 pm 09:01 PM

How do we set up and optimize performance after receiving a new computer? Users can directly open Privacy and Security, and then click General (Advertising ID, Local Content, Application Launch, Setting Recommendations, Productivity Tools or directly open Local Group Policy Just use the editor to operate it. Let me introduce to you in detail how to optimize settings and improve performance after receiving a new Win11 computer. How to optimize settings and improve performance after receiving a new Win11 computer. One: 1. Press the [Win+i] key combination to open Settings, then click [Privacy and Security] on the left, and click [General (Advertising ID, Local Content, App Launch, Setting Suggestions, Productivity) under Windows Permissions on the right Tools)】.Method 2

C++ program optimization: time complexity reduction techniques C++ program optimization: time complexity reduction techniques Jun 01, 2024 am 11:19 AM

Time complexity measures the execution time of an algorithm relative to the size of the input. Tips for reducing the time complexity of C++ programs include: choosing appropriate containers (such as vector, list) to optimize data storage and management. Utilize efficient algorithms such as quick sort to reduce computation time. Eliminate multiple operations to reduce double counting. Use conditional branches to avoid unnecessary calculations. Optimize linear search by using faster algorithms such as binary search.

Decoding Laravel performance bottlenecks: Optimization techniques fully revealed! Decoding Laravel performance bottlenecks: Optimization techniques fully revealed! Mar 06, 2024 pm 02:33 PM

Decoding Laravel performance bottlenecks: Optimization techniques fully revealed! Laravel, as a popular PHP framework, provides developers with rich functions and a convenient development experience. However, as the size of the project increases and the number of visits increases, we may face the challenge of performance bottlenecks. This article will delve into Laravel performance optimization techniques to help developers discover and solve potential performance problems. 1. Database query optimization using Eloquent delayed loading When using Eloquent to query the database, avoid

In-depth interpretation: Why is Laravel as slow as a snail? In-depth interpretation: Why is Laravel as slow as a snail? Mar 07, 2024 am 09:54 AM

Laravel is a popular PHP development framework, but it is sometimes criticized for being as slow as a snail. What exactly causes Laravel's unsatisfactory speed? This article will provide an in-depth explanation of the reasons why Laravel is as slow as a snail from multiple aspects, and combine it with specific code examples to help readers gain a deeper understanding of this problem. 1. ORM query performance issues In Laravel, ORM (Object Relational Mapping) is a very powerful feature that allows

Discussion on Golang's gc optimization strategy Discussion on Golang's gc optimization strategy Mar 06, 2024 pm 02:39 PM

Golang's garbage collection (GC) has always been a hot topic among developers. As a fast programming language, Golang's built-in garbage collector can manage memory very well, but as the size of the program increases, some performance problems sometimes occur. This article will explore Golang’s GC optimization strategies and provide some specific code examples. Garbage collection in Golang Golang's garbage collector is based on concurrent mark-sweep (concurrentmark-s

Laravel performance bottleneck revealed: optimization solution revealed! Laravel performance bottleneck revealed: optimization solution revealed! Mar 07, 2024 pm 01:30 PM

Laravel performance bottleneck revealed: optimization solution revealed! With the development of Internet technology, the performance optimization of websites and applications has become increasingly important. As a popular PHP framework, Laravel may face performance bottlenecks during the development process. This article will explore the performance problems that Laravel applications may encounter, and provide some optimization solutions and specific code examples so that developers can better solve these problems. 1. Database query optimization Database query is one of the common performance bottlenecks in Web applications. exist

How to optimize the startup items of WIN7 system How to optimize the startup items of WIN7 system Mar 26, 2024 pm 06:20 PM

1. Press the key combination (win key + R) on the desktop to open the run window, then enter [regedit] and press Enter to confirm. 2. After opening the Registry Editor, we click to expand [HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionExplorer], and then see if there is a Serialize item in the directory. If not, we can right-click Explorer, create a new item, and name it Serialize. 3. Then click Serialize, then right-click the blank space in the right pane, create a new DWORD (32) bit value, and name it Star

What are some ways to resolve inefficiencies in PHP functions? What are some ways to resolve inefficiencies in PHP functions? May 02, 2024 pm 01:48 PM

Five ways to optimize PHP function efficiency: avoid unnecessary copying of variables. Use references to avoid variable copying. Avoid repeated function calls. Inline simple functions. Optimizing loops using arrays.

See all articles