Eaccelerator installation and use of detailed _php skills

Source: Internet
Author: User

First, Phpeaccelerator installation
Go to https://github.com/eaccelerator/eaccelerator/downloads Download the latest version of the installation package, unpack the installation package, into the Unpacked folder directory,

Compile:

Copy Code code as follows:

$PHP _prefix/bin/phpize
./configure--enable-shared--with-php-config= $PHP _prefix/bin/php-config
Make

Installation:
Copy Code code as follows:

Makeinstall

Modify PHP.ini:
Copy Code code 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"

New Cache directory:
Copy Code code as follows:

Mkdir/tmp/eaccelerator
Chmod0777/tmp/eaccelerator

Second, phpeaccelerator configuration options
eaccelerator.shm_size
Used to set the assignment toEacceleratorUsed to cachePhpThe maximum shared memory, the unit isMb, if set to0, the default size is used. InLinuxIn the System AProcessThe maximum memory that can be allocated is the/proc/sys/kernel/shmmaxRestricted, so ifEaThe memory set exceeds this value.Eawill fail when initialized.ShmmaxThe Unit is byte (bytes)

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

Eaccelerator.enable
Used to set whether Eaccelerator is enabled or disabled , set 1 to Enabled, and set 0 to Disabled.

Eaccelerator.optimizer
Turn optimizations on or off, and the user accelerates code execution. 1 is turnedon, 0 is off, and optimization occurs only when the script is compiled and before it is cached.

Eaccelerator.debug
Turn off the debug log. If set to 1, many file hits are printed to the log. This is useful when you are troubleshooting eaccelerator.

Eaccelerator.check_mtime
At each hit, eaccelerator checks the script for changes to determine whether the script is changing to see if it needs to be recompiled. Although checking is faster than opening a file and compiling it, it still brings some overhead, because there is a state call to complete each time. This configuration can turn off this check. However, the disadvantage of closing the check is that every time you update the file you need to think of manual cleanup cache. The default check is enabled,1 is enabled, and0 is disabled.

Eaccelerator.filter
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 you use the "!" At the beginning, it means no match, this parameter defaults to NULL, you can cache all compiled PHP scripts Note that Eaccelerator.filter is not work based on URLs, but is based on the absolute path of the file, such as the definition of "!/ Home ", the script for all/home directories will not be cached. If you want to define multiple matches, separate them with spaces or tabs, rather than commas.

Eaccelerator.shm_ttl
When Eacelerator does not have free shared memory, a script that has not been accessed at least shm_ttl seconds is released from the cache, and the default value is 0, which means that the EA does not release any caches.

Eaccelerator.shm_prune_period
When there is not enough memory to cache,EA attempts to purge expired scripts again when the last time it clears the cache exceeds the shm_prune_period set number of seconds. The default value is 0, andEA will not purge expired scripts from the cache.

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

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

Third, phpeaccelerator monitoring and management
Eaccelerator provides control.php for monitoring and managing eaccelerator caching. Put control.php into the website directory, modify the account number, password, you can monitor and manage the Eaccelerator cache through the browser.
Control.php Line 23rd and 24:

Copy Code code 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.