Details of installation and use of eAccelerator

  • 2020-06-12 08:41:45
  • OfStack

1. PHPeAccelerator installation
To https: / / github com/eaccelerator/eaccelerator/downloads download the latest version of the installation package, extract the installation package, enter the unzipped folder directory,


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



Modify php. ini:


New cache directory:

chmod0777 /tmp/eaccelerator

2. PHPeAccelerator configuration options
This is used to set the maximum Shared memory allocated to eAccelerator to cache php in mb and the default size if set to 0. 1 process in linux system can allocate the maximum amount of memory is made up of/proc/sys/kernel/shmmax limit, so if the eA set memory beyond this value, eA at the time of initialization will fail. The units of shmmax are bytes (bytes)

Used to set the hard disk cache directory. eA is used to store precompiled code, session data, content, and user entry. The default value is "/tmp/eaccelerator".

Used to set whether to enable or disable eAccelerator, set 1 to enable and 0 to disable.

Turn optimization on or off, allowing the user to speed up code execution. 1 is on, 0 is off, and optimization occurs only when the script is compiled and before it is cached.

Turn on and off the debug log. If set to 1, many file hits are printed into the log. This is useful when looking at eAccelerator.

At each hit, Eaccelerator checks the modification time of the script to determine if the script has changed and if it needs to be recompiled. Although checking is faster than opening a file and compiling, it still incurs some overhead because there is a state call to complete each time. This configuration turns off the check. The downside of turning off checks, however, is that cache needs to be manually cleared every time a file is updated. The default check is enabled, 1 is enabled, 0 is disabled.

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 the "!" Note that eaccelerator.filter is not based on URL, but is based on the absolute path of the file, such as defined "! If /home", all /home scripts will not be cached. If you want to define multiple matches, use Spaces or tabs instead of commas.

When eAcelerator has no free Shared memory, it releases scripts from the cache that have not been accessed in at least the number of seconds set by shm_ttl. The default value is 0, which means eA will not release any cache.

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

Enable or disable disk caching. 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.

Enable or disable disk caching. 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 ES119en.php for monitoring and managing the eAccelerator cache. Put control. php in the website directory, and modify the account and password to monitor and manage the eAccelerator cache through the browser.
control.php lines 23 and 24:

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

Related articles: