Installation and Use of eAccelerator

Source: Internet
Author: User

1. Install PHPeAccelerator
To renew,

Compile:

Copy codeThe Code is as follows: $ PHP_PREFIX/bin/phpize
./Configure -- enable-shared -- with-php-config = $ PHP_PREFIX/bin/php-config
Make

Installation:
Copy codeThe Code is as follows: makeinstall

Modify php. ini:
Copy codeThe 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 cache directory:
Copy codeThe Code is as follows: mkdir/tmp/eaccelerator
Chmod0777/tmp/eaccelerator

Ii. PHPeAccelerator configuration options
Eaccelerator. shm_size
Used to set the maximum shared memory allocated to eAccelerator for caching php. The unit is mb. If set to 0, the default size is used. In linux, the maximum memory that a process can allocate is limited by/proc/sys/kernel/shmmax, so if the memory set by eA exceeds this value, eA fails during initialization. The shmmax unit is bytes)

Eaccelerator. cache_dir
Used to set the hard disk cache directory. EA is used to store pre-compiled code, session data, content, and user portals. The default value is "/tmp/eaccelerator ".

Eaccelerator. enable
It is used to set whether to enable or disable eAccelerator, set 1 to enable, and set 0 to disable.

Eaccelerator. optimizer
Enable or disable optimization to accelerate code execution. 1 is enabled, 0 is disabled, and optimization only occurs when the script is compiled and before it is cached.

Eaccelerator. debug
Turn Off debug logs. If it is set to 1, the hit information of many files will be printed into the log. This is useful when troubleshooting eAccelerator.

Eaccelerator. check_mtime
During each hit, the Eaccelerator checks the modification time of the script to determine whether the script has changed and whether re-compilation is required. Although checking is faster than opening a file and compiling it, it still brings about some overhead, because every time a stateful call is completed. This configuration can disable this check. However, the disadvantage of disabling the check is that the cache needs to be cleared manually each time the file is updated. The default check is enabled, 1 is enabled, and 0 is disabled.

Eaccelerator. filter
Used to determine which PHP file is cached. You can use wildcards (for example, "*. php *. phtml") to match the php script to be cached. If "! ", Indicating that it does not match. This parameter is blank by default. You can cache all compiled php scripts with eaccelerator. filters are not URL-based, but absolute file paths. For example, they define "! /Home ", all scripts in the/home directory will not be cached. To define multiple matches, use spaces or tabs instead of commas.

Eaccelerator. shm_ttl
When the eAcelerator does not have free shared memory, the script that has not been accessed in the shm_ttl setting will be released from the cache. The default value is 0, indicating that the 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 is cleared exceeds the number of seconds set by shm_prune_period. The default value is 0. eA will not clear expired scripts from the cache.

Eaccelerator. shm_only
Enable or disable disk caching. This option has no effect on the cache of session data and content. The default value is 0, which allows eA to cache data using disks and memory.

Eaccelerator. allowed_admin_path
Enable or disable disk caching. This option has no effect on the cache of session data and content. The default value is 0, which allows eA to cache data using disks and memory.

3. Monitoring and Management of PHPeAccelerator
EAccelerator provides control. php for monitoring and managing eAccelerator cache. Put control. php In the website directory, modify the account and password, and you can monitor and manage the eAccelerator cache through the browser.
Control. php 23rd and 24 rows:

Copy codeThe Code is as follows: $ user = "admin ";
$ Pw = "password ";

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: info-contact@alibabacloud.com 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.