Enhancing 80 million pages.

Register FAQ Members List Social Groups Calendar Search Today's Posts Mark Forums Read

Pensamientos al azar acerca de vBSEO y www.bmwfaq.com

Enable caching functions get and put in eAccelerator

Posted 10-16-2007 at 07:33 AM by dbembibre
Updated 10-16-2007 at 12:38 PM by dbembibre
eAccelerator_get and eAccelerator_put functions are now disabled by default. These functions have been disabled because when leaving them on without any precautions these functions can be used for a local DoS attack by keep putting data in shared memory.

http://eaccelerator.net/ticket/37

The correct way to enable it is configure with the following atribute

Code:
--with-eaccelerator-shared-memory
Configure and install secuence

Code:
export PHP_PREFIX="/usr"
 
$PHP_PREFIX/bin/phpize
 
./configure --enable-eaccelerator=shared --with-php-config=$PHP_PREFIX/bin/php-config --with-eaccelerator-shared-memory
 
make
 
make install

Test page with functions and cached data

PHP Code:
<?php
$rfunc 
get_extension_funcs'eaccelerator' );
print_r($rfunc);
 
function 
ea ($str)
{
        
eaccelerator_put("testkey"$str);
        for (
$i 0$i 1e5$i++)
        {
                
$r eaccelerator_get("testkey");
        }
        return 
$r;
}
 
$str str_repeat("1234567890"1024); // 10 KB
$r ea($str);
echo 
strlen($r);
 
?>
Output from my server

PHP Code:
Array ( 
[
0] => eaccelerator_put 
[1] => eaccelerator_get 
[2] => eaccelerator_rm 
[3] => eaccelerator_gc 
[4] => eaccelerator_lock 
[5] => eaccelerator_unlock 
[6] => eaccelerator_caching 
[7] => eaccelerator_optimizer 
[8] => eaccelerator_clear 
[9] => eaccelerator_clean 
[10] => eaccelerator_info 
[11] => eaccelerator_purge 
[12] => eaccelerator_cached_scripts 
[13] => eaccelerator_removed_scripts 
[14] => eaccelerator_list_keys 
[15] => eaccelerator_encode 
[16] => eaccelerator_load 
[17] => _eaccelerator_loader_file 
[18] => _eaccelerator_loader_line 

 
10240 
vBSEO Working with eAccelerator


Attached Thumbnails
Click image for larger version

Name:	vbSeo_ea_storage.JPG
Views:	817
Size:	25.0 KB
ID:	5  
Views 1797 Comments 7 Email Blog Entry
Total Comments 7

Comments

  1. Old
    After build your way i run the testpage you suggested and the testkey is shown, but i don't see the vbseo keys? Did i miss something?
    permalink
    Posted 10-19-2007 at 10:09 AM by Predator Predator is offline
  2. Old
    Danny Bembibre's Avatar
    Your vBSEO is configured to use eAccelerator as cache ??
    permalink
    Posted 10-19-2007 at 04:09 PM by Danny Bembibre Danny Bembibre is offline
  3. Old
    Sorry maybe i'm blind but i can't find this option in the cp of vbseo. Maybe i'm really blind
    permalink
    Posted 10-20-2007 at 02:41 PM by Predator Predator is offline
  4. Old
    Danny Bembibre's Avatar
    The caching options only are available at vBSEO 3.0.1
    permalink
    Posted 10-20-2007 at 04:10 PM by Danny Bembibre Danny Bembibre is offline
  5. Old
    LOL ok so i'm not blind, so need to wait but as the test shows i'm prepared now for 3.0.1. Thanks for your reply.
    permalink
    Posted 10-20-2007 at 04:26 PM by Predator Predator is offline
  6. Old
    MadK's Avatar
    Woo, thanks!
    permalink
    Posted 08-26-2008 at 04:01 PM by MadK MadK is offline
  7. Old
    MadK's Avatar
    Nope, I got a problem:

    Thank you for using PHP.

    Notice: Following unknown configure options were used:

    --with-eaccelerator-shared-memory
    permalink
    Posted 08-26-2008 at 04:50 PM by MadK MadK is offline
 
Total Trackbacks 0

Trackbacks


All times are GMT -4. The time now is 05:58 PM.


Powered by vBulletin Version 3.8.0 Release Candidate 1
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.5 ©2008, Crawlability, Inc.