XCache in EasyApache Does Not Enable Opcode Caching

Solokron

Well-Known Member
Aug 8, 2003
851
1
168
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.
 
Last edited:

Solokron

Well-Known Member
Aug 8, 2003
851
1
168
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
 

Solokron

Well-Known Member
Aug 8, 2003
851
1
168
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"
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,202
363
Hello :)

Have you ensured that you are using a PHP handler that supports Opcode caching (e.g. not suPHP)?

Thank you.
 

Cistech

Registered
May 12, 2015
3
0
51
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.
 
Last edited by a moderator:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,202
363
Hello,

Were you able to review the previous posts to this thread, and if so, were they not helpful?

Thank you.