xcache

Discussion in 'Server Operation' started by Chad, Sep 21, 2007.

  1. Chad

    Chad New Member

    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:
    xcache is still not showing up in phpinfo nor php -v

    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
     
  2. falko

    falko Super Moderator Howtoforge Staff

    You should use just one PHP caching technology, not three or four. What happens if you disable eAccelerator, IonCube, and Zend? Does it work then?
     
  3. Chad

    Chad New Member

    Zend and ioncube are encoders, not caching programs.

    I need both anyway for software.

    Eaccelerator and xcache have been reviwed by many together with good results, so there is no reason not to run both together.
     
  4. chuckl

    chuckl New Member

    1. Should you not be loading it as a zend_extension.
    2. Would it not be wise, if loading it as a zend_extension, to load it before all other zend_extensions?
     
  5. Chad

    Chad New Member

    I forgot about that part, but now I get this error

    Code:
    root@server [~]# php -v
    Failed loading /usr/local/lib/php/extensions/no-debug-non-zts-20020429/xcache.so:  /usr/local/lib/php/extensions/no-debug-non-zts-20020429/xcache.so: undefined symbol: zend_function_dtor
    PHP 4.4.7 (cli) (built: Sep 18 2007 15:47:46)
    Copyright (c) 1997-2007 The PHP Group
    Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
        with eAccelerator v0.9.5.2, 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


    Code:
    root@server [~]# ls /usr/local/lib/php/extensions/no-debug-non-zts-20020429
    ./  ../  error_log*  mailparse.so*  xcache.so*

    I have it set that way...

    zend_extension = /usr/local/lib/php/extensions/no-debug-non-zts-20020429/xcache.so


    xcache and EA are both before zend optimizer itself in php.ini as well
     
  6. Chad

    Chad New Member

    I googled the error and found this:

    http://xcache.lighttpd.net/wiki/BuildingFromSource#Specialpath

    I have no idea really what its telling me, perhaps someone here can help.

    root@server [/usr/local/src/xcache-1.2.1]# which php
    /usr/local/bin/php

    Code:
    root@server [/usr/local/src/xcache-1.2.1]# php -v
    Failed loading /usr/local/lib/php/extensions/no-debug-non-zts-20020429/xcache.so:  /usr/local/lib/php/extensions/no-debug-non-zts-20020429/xcache.so: undefined symbol: zend_function_dtor
    PHP 4.4.7 (cli) (built: Sep 18 2007 15:47:46)
    Copyright (c) 1997-2007 The PHP Group
    Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
        with eAccelerator v0.9.5.2, 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
     
  7. falko

    falko Super Moderator Howtoforge Staff

    What happens if you disable eAccelerator, IonCube, and Zend (for testing purposes)? Does it work then?
     
  8. Chad

    Chad New Member

    Still does not work anyway

    root@server [~]# php -v
    Failed loading /usr/local/lib/php/extensions/no-debug-non-zts-20020429/xcache.so: /usr/local/lib/php/extensions/no-debug-non-zts-20020429/xcache.so: undefined symbol: zend_function_dtor
    PHP 4.4.7 (cli) (built: Sep 18 2007 15:47:46)
    Copyright (c) 1997-2007 The PHP Group
    Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
     
  9. chuckl

    chuckl New Member

    In your first post above, a php -V was reporting phpversion 5.2.4. In your subsequent posts, php -V is reporting php 4.4.7.

    If you are using two versions of PHP on your machine, I'd suggest you be very careful about which version of phpize you run when compiling xcache. The xcache documentation - 'special path'. I think you're in 'mix-and-match' mode here.
     
  10. Chad

    Chad New Member

    Sorry for confusion. I'm only using one version, php 4.4.7 right now. I simply downgraded for other reasons.
     
  11. Chad

    Chad New Member

    I really hope someone else can figure this out as I'd like to try out the xcache vbulletin mod that some created on vb org
     
  12. falko

    falko Super Moderator Howtoforge Staff

    I'm not sure if it makes a difference, but can you try

    Code:
    extension="/usr/local/src/xcache-1.2.1/modules/xcache.so"
    instead of
    Code:
    extension = /usr/local/src/xcache-1.2.1/modules/xcache.so
    ?
     
  13. chuckl

    chuckl New Member

    As I said before, you had PHP 5.2.4 on your machine. You created the xcache extension with the usual phpize, configure, make, make install.

    You have now gone back to PHP 4.4.7. If you have not redone the phpize etc, you are trying to load a PHP 5.2.4 extension on PHP 4.4.7. The most likely result of that is undefined symbols.

    If it's not that, then it's probably the --enable-versioning flag that needs to be off when compiling PHP - see xcache faq, forum etc.
     

Share This Page