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 in EasyApache Does Not Enable Opcode Caching

Discussion in 'General Discussion' started by Solokron, Dec 20, 2014.

  1. Solokron

    Solokron Well-Known Member

    Joined:
    Aug 8, 2003
    Messages:
    849
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Seattle
    cPanel Access Level:
    DataCenter Provider
    Why is this? After enabling it in my php.ini, restarting and running a "php -i" I am surprised to find the following:

    Opcode Cache => disabled

    Why is that?

    I am considering recompiling XCache manually and re-integrating it.
     
    #1 Solokron, Dec 20, 2014
    Last edited: Dec 21, 2014
  2. Solokron

    Solokron Well-Known Member

    Joined:
    Aug 8, 2003
    Messages:
    849
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Seattle
    cPanel Access Level:
    DataCenter Provider
    Looks like the information in "php -i" is misleading. Here is my updated configuration and instructions which will give you access to the latest version and web interface which will allow you to optimize your XCache configuration. Hopefully they are of benefit to someone:

    # XCache Install and Configuration - 12/21/14 - David Turner

    cd /usr/local/src
    # Download latest stable build of XCache
    wget http://xcache.lighttpd.net/pub/Releases/3.2.0/xcache-3.2.0.tar.gz
    tar zxvf xcache-*
    cd xcache-*
    phpize
    ./configure -enable-xcache
    make && make install

    # Setup web interface
    /bin/cp -avf /usr/local/src/xcache-3*/htdocs /usr/local/apache/htdocs/xcache-admin

    # Quickly create an MD5 pass for usage in php.ini configuration:
    md5 -s "password"
    # If that doesn't work create a PHP file with the following and execute it
    <?php
    $str = "YourPass";
    echo md5($str);
    ?>

    # Edit or add to /var/lib/php.ini (If using CloudLinux whichever file associated with the PHP build.)
    [XCache Loader]
    ;; *nix & freebsd
    extension="xcache.so"
    ;; Windows
    ; extension = php_xcache.dll

    [XCache Admin]
    xcache.admin.enable_auth="On"
    xcache.admin.user="adminusernamewhateveryoulike"
    xcache.admin.pass="md5_hash_from_above"

    [XCache Settings]
    xcache.cacher="on"
    xcache.shm_scheme="mmap"
    xcache.mmap_path="/dev/zero"
    xcache.coredump_directory=""
    ; CPU count -1 typically
    xcache.count="7"
    xcache.coveragedump_directory="/tmp/pcov/"
    xcache.optimizer="On"
    ; Turn readonly protection off for better performance
    xcache.readonly_protection="Off"
    ; The amount of RAM you wish to set for XCache usage
    xcache.size="512M"
    xcache.slots="8K"
    ; Setting size to stay the same size with no expiration. Disabled variable for Shared servers
    xcache.var_size="0"
    xcache.ttl="0"
    xcache.gc_interval="0"
    ; Disable XCache tests
    xcache.coverager="Off"
    xcache.test="Off"


    # Save and restart httpd
    service httpd restart

    # Visit XCache admin interface
    http://yourserver/xcache-admin
     
  3. Solokron

    Solokron Well-Known Member

    Joined:
    Aug 8, 2003
    Messages:
    849
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Seattle
    cPanel Access Level:
    DataCenter Provider
    While logged into the web interface you can view opcache information.

    - - - Updated - - -

    If you are using scripts such as WordPress or Joomla set to utilize XCache you will want to replace xcache.var_size="0" with something along the following:

    xcache.var_count="1"
    xcache.var_gc_interval="300"
    xcache.var_maxttl="0"
    xcache.var_size="4M"
    xcache.var_slots="8K"
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,808
    Likes Received:
    667
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  5. Cistech

    Cistech Registered

    Joined:
    May 12, 2015
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Argentina
    cPanel Access Level:
    DataCenter Provider
    Hi have the same problem. Installed Xcache I'm using FastCGI with suEXEC. WHM 11.48.4. WHM VPS version on CentOS. And this is what I get from php -i:

    Code:
    XCache
    
    XCache Version => 3.1.0
    Modules Built => cacher
    
    Directive => Local Value => Master Value
    xcache.coredump_directory => no value => no value
    xcache.disable_on_crash => Off => Off
    xcache.experimental => Off => Off
    xcache.test => Off => Off
    
    XCache Cacher
    
    XCache Cacher Module => enabled
    Readonly Protection => disabled
    Page Request Time => 2015-05-16 18:14:54
    Cache Init Time => 2015-05-16 18:14:54
    Cache Instance Id => 3876
    Opcode Cache => disabled
    Variable Cache => enabled, 8,388,608 bytes, 4 split(s), with 8192 slots each
    Shared Memory Schemes => mmap
    
    Directive => Local Value => Master Value
    xcache.admin.enable_auth => On => On
    xcache.allocator => bestfit => bestfit
    xcache.cacher => On => On
    xcache.count => 4 => 4
    xcache.gc_interval => 0 => 0
    xcache.mmap_path => /dev/zero => /dev/zero
    xcache.readonly_protection => Off => Off
    xcache.shm_scheme => mmap => mmap
    xcache.size => 256M => 256M
    xcache.slots => 8K => 8K
    xcache.stat => On => On
    xcache.ttl => 0 => 0
    xcache.var_allocator => bestfit => bestfit
    xcache.var_count => 4 => 4
    xcache.var_gc_interval => 300 => 300
    xcache.var_maxttl => 0 => 0
    xcache.var_namespace => no value => no value
    xcache.var_namespace_mode => 0 => 0
    xcache.var_size => 8M => 8M
    xcache.var_slots => 8K => 8K
    xcache.var_ttl => 0 => 0
    
    ---------
    php -v
    
    PHP 5.4.40 (cli) (built: May 16 2015 13:10:50)
    Copyright (c) 1997-2014 The PHP Group
    Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
        with XCache v3.1.0, Copyright (c) 2005-2013, by mOo
        with the ionCube PHP Loader v4.6.1, Copyright (c) 2002-2014, by ionCube Ltd.
        with XCache Cacher v3.1.0, Copyright (c) 2005-2013, by mOo
        with Suhosin v0.9.36, Copyright (c) 2007-2014, by SektionEins GmbH
    --------
    
    
    I prefer to install from Easyapache, but I don't know why opcode cache is disabled.
    Thanks in advance.
     
    #5 Cistech, May 16, 2015
    Last edited by a moderator: May 16, 2015
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,808
    Likes Received:
    667
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page