Win2003 Server uses Zend and eaccelerator to accelerate _win server at the same time under IIS6

Source: Internet
Author: User
Tags eval win32 vps server zend
It also optimizes the script to accelerate its execution efficiency. So that your PHP program code can be increased by 1-10 times efficiency;

Official homepage: http://eaccelerator.net

Run Eaccelerator on the basis of Zend Optimizer, my PHP test environment is mainly Windows iis6+ php-5.2.13 environment, I installed on the local server and remote VMware host easily configured successfully, but installed on a remote VPS server, but how did not install successfully, PHP version and corresponding eaccelerator from PHP5.2.13 has been reduced to PHP5.2.11 , PHP5.2.10, php5.2.9-2 can not use, toss for half the night reason is still unclear, directory folders and permission settings are certainly no problem, has been reduced to the PHP5.2.8 version and the corresponding Eaccelerator version to run correctly, but the steps are basically the same as the following:

1, download and PHP version of the corresponding eaccelerator file

2, unzip, copy DLL file to the Ext directory of PHP

3. New Cache Temp Directory folder

4, and then append to modify the php.ini files in Windows, such as:

[Zend]
Zend_extension_ts= "X:\App\php-5.2.13-Win32\ext\eaccelerator.dll"
Eaccelerator.shm_size= "32″
Eaccelerator.cache_dir= "X:\App\php-5.2.13-Win32\temp"
Eaccelerator.enable= "1″
Eaccelerator.optimizer= "1″
Eaccelerator.check_mtime= "1″
Eaccelerator.debug= "0″
Eaccelerator.filter= ""
eaccelerator.shm_max= "0″
Eaccelerator.shm_ttl= "0″
Eaccelerator.shm_prune_period= "0″
Eaccelerator.shm_only= "0″
Eaccelerator.compress= "1″
Eaccelerator.compress_level= "9″
Zend_extension_manager.optimizer_ts= "X:\app\zend\zendoptimizer-3.3.0\lib\optimizer-3.3.0″
Zend_extension_ts= "X:\App\Zend\ZendOptimizer-3.3.0\lib\ZendExtensionManager.dll"
Zend_optimizer.optimization_level= "512″

### #配置选项 #

Eaccelerator.shm_size
Specifies the amount of shared memory that Eaccelerator can use in megabytes (MB).
"0″ represents the operating system defaults. The default value is 0″.

Eaccelerator.cache_dir
Directory for user disk caching. Eaccelerator Stores precompiled code, session data, content, and so on in this directory.
The same data can also be stored in shared memory (for faster access speed). The default value is "/tmp/eaccelerator".

Eaccelerator.enable
Turn eaccelerator on or off. "1″ is turned on," 0″ is closed. The default value is 1″.

Eaccelerator.optimizer
Turn on or off the internal optimizer to increase code execution speed. "1″ is turned on," 0″ is closed. The default value is 1″.

Eaccelerator.debug
Turn debug logging on or off. "1″ is turned on," 0″ is closed. The default value is 0″.

Eaccelerator.check_mtime
Turn on or off the PHP file change check. "1″ is turned on," 0″ is closed. If you want to recompile PHP after you modify it
The program needs to be set to "1″." The default value is 1″.

Eaccelerator.filter
Determine which PHP files must be cached. You can specify the cached and not cached file types (such as "*.php *.phtml", and so on)
If the arguments begin with "!", the files that match the parameters are ignored. The default value is "", that is, all PHP files
will be cached.

Eaccelerator.shm_max
Prevents large files from being stored in shared memory when the Eaccelerator_put () function is used. This parameter specifies the allowed
Maximum storage value, in bytes (10240, 10K, 1M). "0″ is not limited." The default value is 0″.

Eaccelerator.shm_ttl
When Eaccelerator fails to get the shared memory size of the new script, it will remove all in the shared memory from the
The last "Shm_ttl" second script cache that cannot be accessed. The default value is 0″, which is: Do not remove from shared spring
Any cached files.

Eaccelerator.shm_prune_period
When Eaccelerator fails to get the shared memory size of the new script, he will attempt to remove it from shared memory earlier than
Cache script for "shm_prune_period" seconds. The default value is 0″, which is: Do not remove from shared spring
Any cached files.
Eaccelerator.shm_only
Allows or disables caching of compiled scripts on disk. This option is not valid for session data and content caching. Default
The value is 0″, that is, caching using disk and shared memory.

Eaccelerator.compress
Allows or disables the compression of content caching. The default value is 1″, which is: Allow compression.

Eaccelerator.compress_level
Specifies the compression level for the content cache. The default value is 9″, which is the highest level.

Eaccelerator.name_sapce
A prefix string for all keys (keys). If the prefix string is set, the. htaccess or master configuration is allowed.
The file runs two identical key names on the same host.

Eaccelerator.keys
Eaccelerator.sessions
Eaccelerator.content
Determine which keys (keys), session data, and content will be cached. The available parameter values are:
"Shm_and_disk" – caching data both in shared memory and on disk (default);
"SHM" – if shared memory runs out or the data capacity is greater than "Eaccelerator.shm_max"
Caching data in shared memory or disk;
"Shm_only" – Caching data only in shared memory;
"Disk_only" – Caching data only on disk;
' None '-disables caching of data.

Eaccelerator Application Interface (API)

Eaccelerator_put ($key, $value, $ttl =0)
Stores the $value in shared memory and stores $tll seconds.

Eaccelerator_get ($key)
Returns the cached value stored by the Eaccelerator_put () function from shared memory if it does not exist or is already
Expires, NULL is returned.

EACCELERATOR_RM ($key)
Deletes the $key from shared memory.

EACCELERATOR_GC ()
Delete all expired keys (keys)

Eaccelerator_lock ($lock)
Creates a lock with the specified name. The lock can be lifted through the Eaccelerator_unlock () function, in the request
It is also unlocked automatically at the end. For example:

Eaccelerator_unlock ($lock)
Unlocks the specified name (lock).

Eaccelerator_set_session_handlers ()
Installs the eaccelerator session handle.
After you have 4.2.0 from PHP, you can set the "Session.save_handler=eaacelerator" in php.ini
Install the eaccelerator handle.

Eaccelerator_cache_output ($key, $eval _code, $ttl =0)
$eval _code output is cached in shared memory, $ttl seconds are cached.
You can call the MMCACH_RM () function to delete output from the same $key. For example:

Eaccelerator_cache_result ($key, $eval _code, $ttl =0)
Cache $eval _code results in shared memory, $ttl seconds cached.
You can call the MMCACH_RM () function to delete the results of the same $key. For example:

Eaccelerator_cache_page ($key, $ttl =0)
The entire page is cached and $ttl seconds are cached. For example:

Eaccelerator_rm_page ($key)
Deletes the same $key page created by the Eaccelerator_cache_page () function from the cache.

Eaccelerator_encode ($filename)
Returns the compiled encoding of the $filename file.

Eaccelerator_load ($code)
Loads the script encoded by the Eaccelerator_encode () function.

5, set up the restart Web server can be completed.

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.