Home Backend Development PHP Tutorial Detailed explanation of the installation and use of eAccelerator_PHP tutorial

Detailed explanation of the installation and use of eAccelerator_PHP tutorial

Jul 21, 2016 pm 03:07 PM
eaccelerator git https one and use go Install of Detailed explanation

1. PHPeAccelerator installation
Go to https://github.com/eaccelerator/eaccelerator/downloads to download the latest version of the installation package, unzip the installation package, and enter the decompressed Folder directory,

Compile:

Copy code The code is as follows:

$PHP_PREFIX/bin/phpize
./configure--enable-shared --with-php-config=$PHP_PREFIX/bin/php-config
make

Installation:
Copy the code The code is as follows:

makeinstall

Modify php.ini:
Copy code The code is as follows:

extension="eaccelerator.so"
eaccelerator.shm_size="16"
eaccelerator.cache_dir="/tmp/eaccelerator"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="1"
eaccelerator.debug=" 0"
eaccelerator.filter=""
eaccelerator.shm_ttl="0"
eaccelerator.shm_prune_period="0"
eaccelerator.shm_only="0"

Create a new cache directory:
Copy the code The code is as follows:

mkdir/tmp/eaccelerator
chmod0777 /tmp/eaccelerator

二、PHPeAccelerator配置选项
eaccelerator.shm_size
用来设置分配给eAccelerator用来缓存php的最大共享内存,单位是mb,如果设置为0,就使用默认大小。在linux系统中一个process能分配的最大内存是由/proc/sys/kernel/shmmax限制的,所以如果eA设置的内存超出了这个值,eA在初始化的时候会失败。shmmax的单位是字节(bytes

eaccelerator.cache_dir
用来设置硬盘缓存目录。eA用来存放预编译代码,session数据,内容和用户入口。默认值是"/tmp/eaccelerator"

eaccelerator.enable
用来设置是否启用或禁用eAccelerator,设置1为启用,设置0为禁用。

eaccelerator.optimizer
开启或关闭优化,用户加速代码的执行。1为开启,0为关闭,优化仅仅在脚本被编译时候发生并且是在被缓存之前。

eaccelerator.debug
开启关闭debug日志。如果设置为1,将打印很多文件命中的信息到日志中。这个在排查eAccelerator的时候很有用。

eaccelerator.check_mtime
在每次命中的时候Eaccelerator都会检查脚本的修改时间来判断是不是脚本发生的变化来决定是否需要重新编译。尽管检查比打开文件并编译要快,但仍然会带来一些开销的,因为每次都会有状态调用要完成。这个配置可以关闭这个检查。不过关闭检查带来的不利就是每次更新了文件需要认为手动的清除cache。默认检查是启用的,1是启用,0是禁用。

eaccelerator.filter
is used to determine which php file is cached. You can match php scripts that need to be cached by using wildcards (such as "*.php*.phtml"). If it starts with "!", it means there is no match. This parameter is empty by default and can cache all compiled php script needs Note that eaccelerator.filter does not work based on URL, but based on the absolute path of the file, such as defining "!/home", then all scripts in the /home directory will not be cached. If you want to define multiple matches, separate them with spaces or tabs, not commas.

eaccelerator.shm_ttl
When eAcelerator has no free shared memory, Scripts that have not been accessed for at least shm_ttl seconds will be released from the cache. The default value is 0, which means eA will not release any cache.

eaccelerator.shm_prune_period
When there is not enough memory for caching, eA Will try to clear the expired script again when the last time the cache was cleared exceeds the number of seconds set by shm_prune_period. The default value is 0, eA will not clear expired scripts from cache.

eaccelerator.shm_only
Enable or disable disk cache. This option has no effect on caching of session data and content. The default value is 0, allowing eA to use disk and memory for caching.

eaccelerator.allowed_admin_path
Enable or disable disk cache. This option has no effect on caching of session data and content. The default value is 0, allowing eA to use disk and memory for caching.

3. PHPeAccelerator monitoring and management
eAccelerator provides control.php for monitoring and managing eAccelerator cache. Place control.php in the website directory, modify the account number and password, and then you can monitor and manage the eAccelerator cache through the browser.
Lines 23 and 24 of control.php:

Copy code The code is as follows:

$user= "admin";
$pw= "password";

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/327573.htmlTechArticle1. To install PHPeAccelerator, go to https://github.com/eaccelerator/eaccelerator/downloads to download the latest version of the installation package. Unzip the installation package, enter the unzipped folder directory, compile: Copy...
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 Article Tags

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)

How to install deepseek How to install deepseek Feb 19, 2025 pm 05:48 PM

How to install deepseek

Summary of FAQs for DeepSeek usage Summary of FAQs for DeepSeek usage Feb 19, 2025 pm 03:45 PM

Summary of FAQs for DeepSeek usage

What is Bitget Launchpool? How to use Bitget Launchpool? What is Bitget Launchpool? How to use Bitget Launchpool? Jun 07, 2024 pm 12:06 PM

What is Bitget Launchpool? How to use Bitget Launchpool?

How to register for LBank Exchange? How to register for LBank Exchange? Aug 21, 2024 pm 02:20 PM

How to register for LBank Exchange?

What are the AI ​​tools? What are the AI ​​tools? Nov 29, 2024 am 11:11 AM

What are the AI ​​tools?

PHP Git practice: How to use Git to improve code quality and team efficiency? PHP Git practice: How to use Git to improve code quality and team efficiency? Jun 03, 2024 pm 12:43 PM

PHP Git practice: How to use Git to improve code quality and team efficiency?

How much margin is needed for Huobi futures contracts to avoid liquidation? How much margin is needed for Huobi futures contracts to avoid liquidation? Jul 02, 2024 am 11:17 AM

How much margin is needed for Huobi futures contracts to avoid liquidation?

As top market makers enter the crypto market, what impact will Castle Securities have on the industry? As top market makers enter the crypto market, what impact will Castle Securities have on the industry? Mar 04, 2025 pm 08:03 PM

As top market makers enter the crypto market, what impact will Castle Securities have on the industry?

See all articles