It is also able to optimize scripts to speed up their execution. Using Eaccelerator can reduce the load on the server and increase the execution time of the PHP code.
Eaccelerator configuration options:
Copy the Code code as follows:
Zend_extension_ts= "X:appphp-5.2.13-win32exteaccelerator.dll"
Eaccelerator.shm_size= "32″
eaccelerator.cache_dir= "X:appphp-5.2.13-win32 emp"
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:appendendoptimizer-3.3.0liboptimizer-3.3.0″
Zend_extension_ts= "X:appendendoptimizer-3.3.0libendextensionmanager.dll"
Zend_optimizer.optimization_level= "512″
Eaccelerator Configuration Parameters Detailed Description:
Eaccelerator.shm_size
Specifies the amount of shared memory that Eaccelerator can use, in megabytes. "0″ represents the operating system default. The default value is "0″."
Eaccelerator.cache_dir
Directory of user disk caches. Eaccelerator stores pre-compiled code, session data, content, and so on in this directory. The same data can also be stored in shared memory (for faster access). The default value is "/tmp/eaccelerator".
Eaccelerator.enable
Turn eaccelerator on or off. "1″ is turned on," 0″ is off. The default value is "1″."
Eaccelerator.optimizer
Turning on or off the internal optimizer can improve code execution speed. "1″ is turned on," 0″ is off. The default value is "1″."
Eaccelerator.debug
Turn debug logging on or off. "1″ is turned on," 0″ is off. The default value is "0″."
Eaccelerator.check_mtime
Turn PHP file change checking on or off. "1″ is turned on," 0″ is off. If you want to recompile the PHP program after the modification, you need to set it to "1″." The default value is "1″."
Eaccelerator.filter
Determine which PHP files must be cached. You can specify the cache and non-cached file types (such as "*.php *.phtml", etc.), and if the arguments start with "!", the files that match those parameters are ignored by the cache. The default value is "", that is, all PHP files will be cached.
Eaccelerator.shm_max
When you use the "eaccelerator_put ()" function, it is forbidden to store too large files in shared memory. This parameter specifies the maximum value that is allowed to be stored in bytes (10240, 10K, 1M). "0″ is not limited. The default value is "0″."
Eaccelerator.shm_ttl
When Eaccelerator gets the shared memory size of a new script fails, it removes all script caches that cannot be accessed in the last "Shm_ttl" seconds from shared memory. The default value is "0″, which is: Do not delete any cache files from the shared inner spring."
Eaccelerator.shm_prune_period
When Eaccelerator gets the shared memory size of a new script fails, he tries to remove the cache script that is older than "shm_prune_period" seconds from shared memory. The default value is "0″, which is: Do not delete any cache files from the shared inner spring."
Eaccelerator.shm_only
Allows or disables the caching of compiled scripts on disk. This option is not valid for session data and content caching. The default value is "0″, which is: caching using disk and shared memory."
Eaccelerator.compress
Allows or disables the compression of the content cache. The default value is "1″, which is: Allow compression."
Eaccelerator.compress_level
Specifies the compression level of the content cache. The default value is "9″, which is the highest level."
Eaccelerator.name_sapce
A prefix string for all key (keys). Setting this prefix string allows the. htaccess or master configuration file to run two identical key names on the same host.
Eaccelerator.keys
Eaccelerator.sessions
Eaccelerator.content
Determine which keys, session data, and content will be cached. The available parameter values are:
1. "Shm_and_disk" – caches data in both shared memory and disk (default);
2. "SHM" – if the shared memory is exhausted or the data capacity is greater than "Eaccelerator.shm_max", the data is cached in shared memory or on disk;
3. "Shm_only" – caches data only in shared memory;
4. "Disk_only" – caches data only on disk;
5. "None" – suppresses the 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, or null if it does not exist or has expired.
EACCELERATOR_RM ($key)
Removes 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 by the Eaccelerator_unlock () function and automatically unlocked at the end of the request. For example:
Eaccelerator_unlock ($lock)
Unlocks the specified name (lock).
Eaccelerator_set_session_handlers ()
Install the eaccelerator session handle. After PHP 4.2.0, you can install the Eaccelerator handle by setting "Session.save_handler=eaacelerator" in php.ini.
Eaccelerator_cache_output ($key, $eval _code, $ttl =0)
Caches $eval _code output in shared-in-memory cache $ttl seconds. You can call the MMCACH_RM () function to delete the output of the same $key. For example:
Eaccelerator_cache_result ($key, $eval _code, $ttl =0)
Caches $eval _code results in shared-in-memory cache $ttl seconds. You can call the MMCACH_RM () function to delete the results of the same $key. For example:
Eaccelerator_cache_page ($key, $ttl =0)
Caches the entire page and caches $ttl seconds. For example:
Eaccelerator_rm_page ($key)
Removes 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 a script that has been encoded by the Eaccelerator_encode () function.
http://www.bkjia.com/PHPjc/765165.html www.bkjia.com true http://www.bkjia.com/PHPjc/765165.html techarticle It is also able to optimize scripts to speed up their execution. Using Eaccelerator can reduce the load on the server and increase the execution time of the PHP code. Eaccelerator configuration options: ...