The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

xcache

Discussion in 'General Discussion' started by Zion Ahead, Sep 16, 2007.

  1. Zion Ahead

    Zion Ahead Well-Known Member

    Joined:
    Nov 10, 2006
    Messages:
    347
    Likes Received:
    0
    Trophy Points:
    16
    I'm trying to install xcache on my centos 4.5 / cpanel box w/ php 5.2.4

    I followed the guideline here
    http://www.eth0.us/xcache

    Problem is this:


    root@server [~/xcache-1.2.1]# ln -s /usr/local/lib/php/extensions/no-debug-non-zts-20020429/xcache.so /usr/local/php5//lib/php/extensions/no-debug-non-zts-20060613/xcache.so
    ln: creating symbolic link `/usr/local/php5//lib/php/extensions/no-debug-non-zts-20060613/xcache.so' to `/usr/local/lib/php/extensions/no-debug-non-zts-20020429/xcache.so': No such file or directory




    root@server [~]# php -i |grep extension_dir
    Failed loading /usr/local/ioncube/ioncube_loader_lin_4.4.so: /usr/local/ioncube/ioncube_loader_lin_4.4.so: undefined symbol: zend_hash_add_or_update
    extension_dir => /usr/local/lib/php/extensions/no-debug-non-zts-20020429 => /usr/local/lib/php/extensions/no-debug-non-zts-20020429


    What am I missing here and how would I fix the other errors with ioncube / eaccelerator?




    can someone recommend optimal settings for eaccelerator? ( got it working, shows up in phpinfo now)


    [eAccelerator]
    zend_extension="/usr/lib/php/extensions/eaccelerator.so"
    eaccelerator.shm_size="6"
    eaccelerator.cache_dir="/tmp/eaccelerator"
    eaccelerator.enable="1"
    eaccelerator.optimizer="6"
    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="3"
    eaccelerator.keys="shm_and_disk"
    eaccelerator.sessions="shm_and_disk"
    eaccelerator.content="shm_and_disk"


    I have a dual xeon server with 4gb memory, php 5.2.4 (phpsuexec disabled)
     
  2. Zion Ahead

    Zion Ahead Well-Known Member

    Joined:
    Nov 10, 2006
    Messages:
    347
    Likes Received:
    0
    Trophy Points:
    16
    Made this in php.ini to correct the path and set to 10MB as well

    This is the entire end of php.ini



    Code:
    [eAccelerator]
    zend_extension="/usr/lib/php/extensions/eaccelerator.so"
    eaccelerator.shm_size="4096"
    eaccelerator.cache_dir="/tmp/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"
    eaccelerator.keys="shm_and_disk"
    eaccelerator.sessions="shm_and_disk"
    eaccelerator.content="shm_and_disk"
    
    [xcache-common]
    extension = /usr/local/src/xcache-1.2.1/modules/xcache.so
    
    [xcache.admin]
    xcache.admin.auth = On
    xcache.admin.user = ""
    xcache.admin.pass = ""
    
    [xcache]
    ; ini only settings, all the values here is default unless explained
    
    ; select low level shm/allocator scheme implemenation
    xcache.shm_scheme = "mmap"
    
    ; to disable: xcache.size=0
    ; to enable : xcache.size=64M etc (any size > 0) and your system mmap allows
    xcache.size = 10M
    
    ; set to cpu count (cat /proc/cpuinfo |grep -c processor)
    xcache.count = 1
    
    ; just a hash hints, you can always store count(items) > slots
    xcache.slots = 8K
    
    ; ttl of the cache item, 0=forever
    xcache.ttl = 0
    
    ; interval of gc scanning expired items, 0=no scan, other values is in seconds
    xcache.gc_interval = 0
    
    ; same as aboves but for variable cache
    xcache.var_size = 0M
    xcache.var_count = 1
    xcache.var_slots = 8K
    ; default ttl
    xcache.var_ttl = 0
    xcache.var_maxttl = 0
    xcache.var_gc_interval = 300
    
    xcache.test = Off
    ; N/A for /dev/zero
    xcache.readonly_protection = Off
    ; for *nix, xcache.mmap_path is a file path, not directory.
    ; Use something like "/tmp/xcache" if you want to turn on ReadonlyProtection
    ; 2 group of php won't share the same /tmp/xcache
    ; for win32, xcache.mmap_path=anonymous map name, not file path
    xcache.mmap_path = "/dev/zero"
    
    ; leave it blank(disabled) or "/tmp/phpcore/"
    ; make sure it's writable by php (without checking open_basedir)
    xcache.coredump_directory = ""
    
    ; per request settings
    xcache.cacher = On
    xcache.stat = On
    xcache.optimizer = Off
    
    [xcache.coverager]
    ; per request settings
    ; enable coverage data collecting for xcache.coveragedump_directory and xcache_coverager_start/stop/get/clean() functions 
    xcache.coverager = Off
    
    ; ini only settings
    ; make sure it's readable (care open_basedir) by coverage viewer script
    ; requires xcache.coverager=On
    xcache.coveragedump_directory = ""
    
    [Zend]
    zend_extension_manager.optimizer=/usr/local/Zend/lib/Optimizer-3.3.0
    zend_extension_manager.optimizer_ts=/usr/local/Zend/lib/Optimizer_TS-3.3.0
    zend_optimizer.version=3.3.0
    
    zend_extension = /usr/local/ioncube/ioncube_loader_lin_5.2.so
    extension=/usr/local/lib/php/extensions/no-debug-non-zts-20020429/ffmpeg.so
    zend_extension=/usr/local/Zend/lib/ZendExtensionManager.so
    zend_extension_ts=/usr/local/Zend/lib/ZendExtensionManager_TS.so

    Code:
    root@server [~]# ls -l /usr/local/src/xcache-1.2.1/modules/
    total 356
    drwxr-xr-x   2 root root   4096 Sep 17 20:31 ./
    drwxr-xr-x  10 1003  513   4096 Sep 17 19:27 ../
    -rw-r--r--   1 root root    778 Sep 17 20:31 error_log
    -rwxr-xr-x   1 root root 347439 Sep 17 19:27 xcache.so*

    Restarted httpd as well
    Code:
    root@server [~]# php -v
    PHP 5.2.4 (cli) (built: Sep 15 2007 23:28:23) 
    Copyright (c) 1997-2007 The PHP Group
    Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
        with eAccelerator v0.9.5, Copyright (c) 2004-2006 eAccelerator, by eAccelerator
        with the ionCube PHP Loader v3.1.29, Copyright (c) 2002-2007, by ionCube Ltd., and
        with Zend Extension Manager v1.2.0, Copyright (c) 2003-2007, by Zend Technologies
        with Zend Optimizer v3.3.0, Copyright (c) 1998-2007, by Zend Technologies


    xcache is still not showing up in phpinfo nor php -v
     
  3. Zion Ahead

    Zion Ahead Well-Known Member

    Joined:
    Nov 10, 2006
    Messages:
    347
    Likes Received:
    0
    Trophy Points:
    16
    can someone please help me out?
     
  4. Zion Ahead

    Zion Ahead Well-Known Member

    Joined:
    Nov 10, 2006
    Messages:
    347
    Likes Received:
    0
    Trophy Points:
    16
  5. hostmedic

    hostmedic Well-Known Member

    Joined:
    Apr 30, 2003
    Messages:
    559
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Washington Court House, Ohio, United States
    cPanel Access Level:
    DataCenter Provider
    quick ?

    are you looking to use xcache and eAccelerator together?

    just wondering if that might be what is buggering things up...
    I dont think the 2 play well together...

    Suggest you first comment out the eAccelerator - Also
    are you running php as cgi ?

    By using fastcgi, you can use the mpm worker, which has improved performance and memory management over mpm prefork. Keep in mind while php5 is threadsafe, third party modules are not likely to be. Also, by using mod_fastcgi, you end up being able to use a variety of different scripting languages, ruby, python, php5, php4, perl, and even compiled C and C++ binaries....

    So thats why to use cgi -... but... will it work with a cache system ? I don't think so ... well let me say not easily...

    One potential drawback to using php5 in cgi mode is the potential to not be able to use opcode cachers like xcache. The catch here is to setup the cgi processes to share memory...

    So in summary:

    1. are you running php in cgi mode ?
    2. are you running eAccelerator?
    3. are you running XCache?

    thanks . . .
     
  6. Networkologist

    Networkologist Well-Known Member

    Joined:
    Feb 5, 2003
    Messages:
    209
    Likes Received:
    0
    Trophy Points:
    16
    I had a similar problem with suhosin. What I did was remove "no-debug-non-zts-20020429"

    from this line "/usr/local/php5//lib/php/extensions/no-debug-non-zts-20060613/"

    and copied suhosin (in my case) into the /extension/ dir and everything worked fine; ea, zend, ioncube and suhosin

    So try doing that and copying xcache.so into the /extension/ dir and restart apache then do a php -v

    HTH
     
Loading...

Share This Page