Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to configure parameters and API for php Accelerator eAccelerator

2025-04-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article is about how to configure parameters and API for php accelerator eAccelerator. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

It can also optimize scripts to speed up their execution. Using eAccelerator can reduce the load on the server and increase the execution time of PHP code.

EAccelerator configuration options:

The copy code is 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 are described in detail:

Eaccelerator.shm_size

Specifies the amount of shared memory that eAccelerator can use, in MB. "0" represents the operating system default. The default value is "0".

Eaccelerator.cache_dir

The directory cached by the user's disk. 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). The default is "/ tmp/eaccelerator".

Eaccelerator.enable

Turns eAccelerator on or off. "1" is on and "0" is off. The default value is "1".

Eaccelerator.optimizer

Turning on or off the internal optimizer can increase the speed of code execution. "1" is on and "0" is off. The default value is "1".

Eaccelerator.debug

Turns debug logging on or off. "1" is on and "0" is off. The default value is "0".

Eaccelerator.check_mtime

Turns PHP file change checking on or off. "1" is on and "0" is off. If you want to recompile the PHP program after 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 cached and non-cached file types (such as "* .php * .phtml", etc.) if the parameter is "!" At the beginning, files that match these parameters are ignored. The default value is ", that is, all PHP files will be cached.

Eaccelerator.shm_max

When using the "eaccelerator_put ()" function, it is prohibited from storing large files in shared memory. This parameter specifies the maximum allowed storage in bytes (10240, 10K, 1m). "0" is unlimited. the default value is "0".

Eaccelerator.shm_ttl

When eAccelerator fails to get the shared memory size of the new script, it removes all script caches that cannot be accessed in the last "shm_ttl" second from the shared memory. The default value is "0", that is, no cache files are deleted from the shared inner spring.

Eaccelerator.shm_prune_period

When eAccelerator fails to get the shared memory size of the new script, he will try to remove cached scripts that are earlier than "shm_prune_period" seconds from the shared memory. The default value is "0", that is, no cache files are deleted from the shared inner spring.

Eaccelerator.shm_only

Allows or disables caching of compiled scripts on disk. This option is not valid for session data and content caching. The default value is "0", that is, using disk and shared memory for caching.

Eaccelerator.compress

Allows or disables compressed content caching. The default value is "1", that is, compression is allowed.

Eaccelerator.compress_level

Specifies the compression level of the content cache. The default is "9", which is the highest level.

Eaccelerator.name_sapce

A prefix string for all keys (keys). Setting the prefix string allows .htaccess or the main configuration file to run 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:

1. "shm_and_disk"-caches data in both shared memory and disk (default)

2. "shm"-if shared memory is exhausted or the data capacity is greater than "eaccelerator.shm_max", cache data in shared memory or disk

3. "shm_only"-caches data only in shared memory

4. "disk_only"-caches data only on disk

5. "none"-data caching is prohibited.

EAccelerator Application Program Interface (API):

Eaccelerator_put ($key, $value, $ttl=0)

Store $value in shared memory and store $tll seconds.

Eaccelerator_get ($key)

Returns the cache value stored by the eaccelerator_put () function from shared memory, or null if it does not exist or has expired.

Eaccelerator_rm ($key)

Remove $key from shared memory.

Eaccelerator_gc ()

Delete all expired keys (keys)

Eaccelerator_lock ($lock)

Creates a lock (lock) with the specified name. The lock can be released through the eaccelerator_unlock () function and is 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. Since 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)

Cache the output of $eval_code in shared memory and 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)

Cache the result of $eval_code in shared memory and cache $ttl seconds. You can call the mmcach_rm () function to delete the result of the same $key. For example:

Eaccelerator_cache_page ($key, $ttl=0)

Cache the entire page and cache $ttl seconds. For example:

Eaccelerator_rm_page ($key)

Delete 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)

Load the script encoded by the eaccelerator_encode () function.

Thank you for reading! This is the end of the article on "how to configure parameters and API for php Accelerator eAccelerator". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report