win 平台下的 php 加速度eaccelerator

根据你的PHP版本,选择要加载的DLL文件
在 php.ini 里加入
[eaccelerator]
extension=eAccelerator0951_5.2.3.dll
eaccelerator.shm_size="64"
eaccelerator.cache_dir="E:/ggg/www/tmp/eaccelerator_tmp"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="1"
eaccelerator.compress="1"
eaccelerator.compress_level="9"

下载地址

http://www.sitebuddy.com/PHP/Accelerators/eAccelerator_windows_binaries_builds

 

Attachment Size
eAccelerator 095 Final for PHP 5.1.6 120 KB
095_final_useful _files.zip 41.97 KB
eAccelerator 0.9.5 Final for PHP 5.1.5 120 KB
eAccelerator 095 Final for PHP 5.1.6 Optimized for Size 108 KB
eAccelerator 095 Final for PHP 5.2.0 120 KB
eAccelerator 095 Final for PHP 5.0.5 120 KB
eAccelerator 095 for PHP 5.0.4 (OLDER PHP VERSION) 120 KB
eAccelerator 0951 for PHP 5.2.2 120 KB
eAccelerator 0951 for PHP 5.2.1 120 KB
eAccelerator 0951 for PHP 5.2.2 Built with VC2005 SP1 128 KB
eAccelerator 0951 for PHP 5.1.4 120 KB
eAccelerator 0951 for PHP 5.2.3 120 KB
eAccelerator 0951 for PHP 5.2.0 (OLDER PHP VERSION) 120 KB

配置介绍


具体看官方说明

http://www.sitebuddy.com/PHP/Accelerators/eAccelerator

We have been using this PHP accelerator (0.9.X), on multiple servers, for a long time. It's used on some high traffic sites without any problem.

Install:
a) Download a copy of eAccelerator that is compatible with your version of PHP.
This can be an issue with eAccelerator. Sometimes it can take a little time before the Windows binaries are available for the most recent version of PHP.

Windows binaries:
Since the release of the windows binaries are not always available, I decided to start offering eAccelerator windows binaries.

b) Copy a compatible eaccelerator.dll to your PHP extensions folder (like: c:/php/extensions replace with your actual folder location).
Make sure the configuration directive extension_dir in your php.ini is properly pointing to your extensions folder.
Like: extension_dir = "c:/php/extensions"

c) Create a folder (with the appropriate permissions) for the temporary cached files.
For example: D:/tmp/eaccelerator

d) Add the following to your php.ini (as the first loaded extension):
extension="eaccelerator.dll"
eaccelerator.shm_size="64" ; 20MB per heavy site ?
eaccelerator.cache_dir="D:/tmp/eaccelerator"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="1"
; 0 should be faster but will skip checking the modified date on your cached files eaccelerator.debug="0"
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="0" ( I have used 3600 = 1 hour)
eaccelerator.shm_prune_period="0"  ( testing 1800)
eaccelerator.shm_only="0" (testing 1 this seem noticeably faster?)
eaccelerator.compress="1"
eaccelerator.compress_level="9"
eaccelerator.keys = "shm" (testing)
eaccelerator.sessions = "shm" (testing)
eaccelerator.content = "shm" (testing)
eaccelerator.admin.name="yourusername" (upto eAccelerator 0.9.4)
eaccelerator.admin.password="yourpassword" (upto eAccelerator 0.9.4)
eaccelerator.allowed_admin_path = "C:/MySites/sitebuddy/wwwroot/control.php" (NEW in eAccelerator 0.9.5)

e) Restart your Web Server.

f) WEB interface eAccelerator 0.9.4:
This accelerator provides a real nice web interface.
Use the provided eaccelerator.php (control.php in eAccelerator 0.9.5) to get data and perform certain operations. I recommend also renaming this file (for better security).

Also read the "readme" for how to implement password security between your eAccelerator 0.9.4 install and this script (a password encryption script is provided).
Basically you will end up with 2 new directives in your php.ini:
eaccelerator.admin.name="PhpAdminName"
eaccelerator.admin.password="$2$avd2.M04.$YOURAHsPASSWORDdsesENCRYPTEDdcETRmK3"

and a modified eaccelerator.php like:

<?php
$_SERVER['PHP_AUTH_USER'] = "PhpAdminName";
$_SERVER['PHP_AUTH_PW'] = "ClearVersionOfThePassword";

if (function_exists("eaccelerator")) {
eaccelerator();
} else {
echo "<html><head><title>eAccelerator</title></head><body><h1 align=/"center/">eAccelerator is not installed</h1></body></html>";
} ?>

Note: To get the encrypted password you basically type in a dos windows: "php -q eaccelerator_password.php"

g) WEB interface eAccelerator 0.9.5 (New)
With eAccelerator 0.9.5 the file eaccelerator.php was renamed control.php. I recommend also renaming this file (for better security like control545722.php).

In this file (control.php) you will see the default userID and password (you should change these values):
/** config **/
$user = "admin";
$pw = "eAccelerator";
/** /config **/
 

Please note that as of 08_10_2006 0.9.5 is still not released. We are currently using Release Candidate 1 (RC1).

Configuration Options (From the Readme file):
eaccelerator.shm_size
The amount of shared memory (in megabytes) that eAccelerator will use. "0" means OS default. Default value is "0".
eaccelerator.cache_dir
The directory that is used for disk cache. eAccelerator stores precompiled code, session data, content and user entries here. The same data can be stored in shared memory also (for quicker access). Default value is "/tmp/eaccelerator".
eaccelerator.enable
Enables or disables eAccelerator. Should be "1" for enabling or "0" for disabling. Default value is "1".
eaccelerator.optimizer
Enables or disables internal peephole optimizer which may speed up code execution. Should be "1" for enabling or "0" for disabling. Default value is "1".
eaccelerator.debug
Enables or disables debug logging. Should be "1" for enabling or "0" for disabling. Default value is "0".
eaccelerator.log_file
Set the log file for eaccelerator. When this option isn't set then the data will be logged to stderr
eaccelerator.name_space
A string that's prepended to all keys. This allows two applications that use the same key names to run on the same host by setting this in .htaccess or in the main configuration file for the whole web server.
eaccelerator.check_mtime
Enables or disables PHP file modification checking . Should be "1" for enabling or "0" for disabling. You should set it to "1" if you want to recompile PHP files after modification. Default value is "1".
eaccelerator.filter
Determine which PHP files must be cached. You may specify the number of patterns (for example "*.php *.phtml") which specifies to cache or not to cache. If pattern starts with the character "!", it means to ignore files which are matched by the following pattern. Default value is "" that means all PHP scripts will be cached.
eaccelerator.shm_max
Disables putting large values into shared memory by " eaccelerator_put() " function. It indicates the largest allowed size in bytes (10240, 10K, 1M). The "0" disables the limit. Default value is "0".
eaccelerator.shm_ttl
When eaccelerator fails to get shared memory for new script it removes all scripts which were not accessed at last "shm_ttl" seconds from shared memory. Default value is "0" that means - don't remove any files from shared memory.
eaccelerator.shm_prune_period
When eaccelerator fails to get shared memory for new script it tries to remove old script if the previous try was made more then "shm_prune_period" seconds ago. Default value is "0" that means - don't try to remove any files from shared memory.
eaccelerator.shm_only
Enables or disables caching of compiled scripts on disk. It has no effect on session data and content caching. Default value is "0" that means - use disk and shared memory for caching.
eaccelerator.compress
Enables or disables cached content compression. Default value is "1" that means enable compression.
eaccelerator.compress_level
Compression level used for content caching. Default value is "9" which is the maximum value
eaccelerator.keys
eaccelerator.sessions

eaccelerator.content
Determine where keys, session data and content will be cached. The possible values are:
"shm_and_disk" - cache data in shared memory and on disk (default value)
"shm" - cache data in shared memory or on disk if shared memory
is full or data size greater then "eaccelerator.shm_max"
"shm_only" - cache data in shared memory
"disk_only" - cache data on disk
"none" - don't cache data
eaccelerator.allowed_admin_path (NEW in eAccelerator 0.9.5)
The script paths that are allowed to get admin information and do admin controls.

This module also provides: eLoader (I never used it...)
eLoader is PHP extension that can load scripts which encoded by eAccelerator without eAccelerator. It is a PHP extension and it should be compatible with Zend Optimizer, Zend Performance Suite, ionCube loader, PHP Accelerator and other PHP extensions.

Official project page for eAccelerator.

 

你可能感兴趣的:(windows,PHP,File,平台,extension,testing)