eAccelerator for PHP



Learn Web Hosting Help and Information on mps-web-hosting.com. eAccelerator for PHP article will help answer your questions on Web Hosting Help and Information.We at mps-web-hosting.com specialize in Web Hosting Help and Information. Web Hosting Help and Information at mps-web-hosting.com provides the most up to date news and articles. If you have questions please do not hesitate to contact us.

What is eAccelerator? ---------------------- eAccelerator is a free open source PHP accelerator, optimizer, encoder and dynamic content cache for PHP. It increases performance of PHP scripts by caching them in compiled state, so that the overhead of compiling is almost completely eliminated. Also it uses some optimizations to speed up execution of PHP scripts. eAccelerator typically reduces server load and increases the speed of your PHP code by 1-10 times.

eAccelerator is a fork of TurckMMCache ( http://sourceforge.net/project/turckmm-cache/ by Dmitry Stogov )

eAccelerator stores compiled PHP scripts in shared memory and executes code directly from it. It creates locks only for short time, while searching compiled PHP script in the cache, so one script can be executed simultaneously by several engines. Files that can't fit in shared memory are cached on disk only.

eAccelerator contains a PHP encoder and loader. You can encode PHP scripts using encoder.php in order to distribute them without sources. Encoded files can be run on any site which runs PHP with eAccelerator. The sources of encoded scripts can't be restored because they are stored in a compiled form and the encoded version doesn't contain the source. Of course, some internals of the scripts can be restored with different reverse engineering tools (disassemblers, debuggers, etc), but it is not trivial.

eAccelerator is compatible with Zend Optimizer's loader. Zend Optimizer must be installed after eAccelerator in php.ini. If you don't use scripts encoded with Zend Encoder then we do not recommend you install Zend Optimizer with eAccelerator.

eAccelerator does not work in CGI mode.

===================== ===================== How to Install eaccelerator

cd /

wget http://unc.dl.sourceforge.net/source...-0.9.2a.tar.gz

tar xvzf eaccelerator-0.9.2a.tar.gz

cd eaccelerator

export PHP_PREFIX='/usr/local'

$PHP_PREFIX/bin/phpize

./configure --enable-eaccelerator=shared --with-php-config=$PHP_PREFIX/bin/php-config

make install

pico -w /usr/local/lib/php.ini

CTRL w

Find this: ;Windows Extensions

for zend

zend_extension='/eaccelerator/modules/eaccelerator.so' eaccelerator.shm_size='16' #^-The amount of shared memory (in megabytes) that eAccelerator will use eaccelerator.cache_dir='/home/eaccelerator' #^-This is the folder where it cash the compiled scripts # you can use a second drive to be faster such as '/backup/eaccelerator' 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'

for PHP

extension='/eaccelerator/modules/eaccelerator.so' eaccelerator.shm_size='16' #^-This is the folder limit (16mb), you can make it larger if you wish eaccelerator.cache_dir='/home/eaccelerator' #^-This is the folder where it cash the compiled scripts # you can use a second drive to be faster such as '/backup/eaccelerator' 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'

mkdir /home/eaccelerator

chmod 0777 /home/eaccelerator

httpd restart

or

service httpd restart

===================== =====================

Configuration Options ---------------------

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 more quick 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.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 tryes 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 API ----------------

eaccelerator_put($key, $value, $ttl=0) puts the $value into shard memory for $ttl seconds.

eaccelerator_get($key) returns the value from shared memory which was stored by eaccelerator_put() or null if it is not exists or was expired.

eaccelerator_rm($key) removres the $key from shared memory

eaccelerator_gc() removes all expired keys from shared memory

eaccelerator_lock($lock) creates a lock with specified name. The lock can be released by function eaccelerator_unlock() or automatic on the end of request. For Example:

eaccelerator_cache_page($key, $ttl=0) caches the full page for $ttl seconds.

Original: http://www.ukwebmasterforums.com/t4908-eaccelerator-for-php.html

Web Hosting UK (http://www.session9.co.uk/ )

Webmaster Forums ( http://www.ukwebmasterforums.com/ )

Web Hosting Affiliate ( http://www.session9.co.uk/web-hosting-affiliate/ )

Domain Reseller ( http://www.domainvendor.co.uk/ )


Here's your daily hosting industry briefing for Friday, July 14, 2006


Article Index: | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31


More Articles:


1. Good Web Hosting – What Is It? By Ryan Fyfe
With hundreds of web hosting companies to choose from today it can be hard to know which ones are actually worth using. Below is a guide of things to look for in a web host: Services - A lot of times we are sold on the idea that bigger is better. I like to look at web hosting companies with a quality over quantity perspective. If lets say you need a site to just simply host your little guy’s minor league soccer team, do you really need a terabyte of bandwidth? Are you ever going to make use of…

2. Choosing A Web Hosting Provider On A Budget
If you are currently looking for web hosting, there is no shortage of companies that are willing to be of service. But because of so many choices out there, it can be an almost dizzying experience to select the one that is right for you. This is especially true if you need to find a host that won't require a part time job to afford it. When looking for a cheap web host, you must be very careful to read all the fine print. Often, there will be certain restrictions to be aware of. On…

3. Web Hosting Provider Weblinkhosting.com Donates $20,000 To Katrina Relief Group.
Web Hosting Provider Weblinkhosting.com Donates $20,000 To Katrina Relief Group. Weblinkhosting.com, known as the affordable web hosting provider has donated $20,000 to the Katrina relief group and has promised to give 10% of every signup to the Red Cross as well. This comes a week after the disastrous proceedings that occurred a week ago in Baton Rouge and Mississippi. This donation comes right after their marketing strategy to give away 19' LCD DELL monitors every week through a raffle to thei…

4. Choosing the Perfect Deluxe Web Site Hosting Plan By Gary Gresham
If you are looking for a deluxe web site hosting plan there are some important considerations before you make a choice. Everyone has different needs so what is deluxe for you might be completely different for someone else. You want to end up with a complete web hosting package without paying for something you don't need.ReliabilityThis is the percentage of uptime the host guarantees and don't accept anything under 99.5% of uptime. Look for what safeguards and backup servers a hosting compan…