zenid

Well-Known Member
Aug 22, 2004
62
0
156
Hello,

I have running at this moment: Apache 2.2.22 with PHP 5.3.10 in Mod Ruid2 (before SuPHP, but Mod Ruid2 is a lot faster.)

I have a lot of PHP website like Wordpress, Joomla, forums. I was wondering if it a good option is to run:
Eaccelerator or xcache? or both?. Now i have both disabled
 

Gene Steinberg

Well-Known Member
May 26, 2007
163
3
168
Unless things have changed, I'd use the eAccelerator add-on with cPanel. The xCache installer failed to include most of the key options required for performance improvements. That is, unless they've changed it (and the EasyApache documentation doesn't seem to indicate such changes). So you're left with manually replacing an xCache configuration in php.ini yourself.
 

johnburk

Well-Known Member
Jun 23, 2006
241
0
166
xCache will not work or will not work correctly if you install it with Easyapache. My experience is that is does perform better than eacceleratoe, but you have to install it manually.
 

Gene Steinberg

Well-Known Member
May 26, 2007
163
3
168
Actually, the issue is mostly the preferences that have to be manually added and set. Then you should be OK, although eAccelerator is reasonably well configured with the cPanel install (except for needing to give the cache more memory). But I ended up with APC, because it was recommended for some of the commercial forum systems.
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
43
348
somewhere over the rainbow
cPanel Access Level
Root Administrator
If the xCache options aren't added and might be helpful, I would suggest adding a feature request to add options similar to what happens for eAccelerator:

Feature Requests for cPanel/WHM
 

jpearl

Member
Oct 28, 2011
20
0
51
AZ
cPanel Access Level
Root Administrator
I did an easy write up on how to install and configure xcache on your server. The guy above is right about it not working correctly if installed with easy apache. I dont know if I am allowed to put up my link on here but pm me and I will give it to you.
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
43
348
somewhere over the rainbow
cPanel Access Level
Root Administrator
Rather than linking it, how about posting here how to do it? We rather have the details on the forum on how to actually do things. Links can expire or cease working, then the information is lost. Better to have it on the forum itself. Thanks!
 

-GR-

Active Member
May 2, 2012
42
0
56
cPanel Access Level
Root Administrator
It installs correctly but the default config settings in php.ini basically have xcache turned off. So you won't notice a difference unless you setup the configuration values.

Code:
;extension="xcache.so"
;xcache.admin.enable_auth="on"
;xcache.admin.pass="******"
;xcache.admin.user="****"
;xcache.cacher="On"
;xcache.coredump_directory=""
;xcache.count="7"
;xcache.coveragedump_directory="/tmp/pcov/"
;xcache.coverager="Off"
;xcache.gc_interval="1800"
;xcache.mmap_path="/dev/zero"
;xcache.optimizer="On"
;xcache.readonly_protection="On"
;xcache.size="300M"
;xcache.slots="8K"
;xcache.test="Off"
;xcache.ttl="86400"
;xcache.var_count="1"
;xcache.var_gc_interval="300"
;xcache.var_maxttl="0"
;xcache.var_size="4M"
;xcache.var_slots="8K"
;xcache.var_ttl="0"
A default install has the xcache.var_size and xcache.size set to 0 so it won't cache. Above is my config settings but I currently have xcache disabled (note the comments ; in front of each line) as I am doing some testing with APC to see which one I prefer.
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
43
348
somewhere over the rainbow
cPanel Access Level
Root Administrator
EAccelerator and xCache are different options. Neither require the other. EAccelerator can be enabled by itself or xCache can be. The only requirement is that you are using DSO or FCGI. suPHP won't work with OPCode Caching Engines.
 

SoftDux

Well-Known Member
May 27, 2006
1,023
5
168
Johannesburg, South Africa
cPanel Access Level
Root Administrator
how would I configure xchace on a shared hosting server, specifically to be used with Wordpress and possibly other applications?

Let me be a bit more direct: Is it safe to give the "xcache.admin.pass=" & xcache.admin.user="****" valued to end users, which the pretty much defeats the purpose of having a username and password to begin with. Or, how does one configure it to still be secure?
 

jpearl

Member
Oct 28, 2011
20
0
51
AZ
cPanel Access Level
Root Administrator
EAccelerator and xCache are different options. Neither require the other. EAccelerator can be enabled by itself or xCache can be. The only requirement is that you are using DSO or FCGI. suPHP won't work with OPCode Caching Engines.
I never posted it because it was so long. Thats why I linked it. Here it is. It might be a lil outdated but the process is the same.

Configure Xcache on your linux server.

Now that you have installed Xcache its time to configure it for your server. If you haven’t set it up yet then install Xcache first.

You have the default config so I will show you what I use and why. Open your php.ini file and edit it.

[xcache-common]

zend_extension = “/usr/local/lib/php/extensions/no-debug-non-zts-20090626/xcache.so”
zend_extension = “/usr/local/Zend/lib/Guard-5.5.0/php-5.3.x/ZendGuardLoader.so”

[xcache.admin]
xcache.admin.enable_auth = Off <——- If you have problems logging into the admin, set to off.
xcache.admin.user = “myname”
; xcache.admin.pass = md5($your_password)
xcache.admin.pass = “md5ofwhateveryourpasswordis”

[xcache]

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 = 256M <————-I have 4G of ram so I set it high.
; set to cpu count (cat /proc/cpuinfo |grep -c processor)
xcache.count = 8 <———–I have 8 processors
; just a hash hints, you can always store count(items) > slots
xcache.slots = 8K
; ttl of the cache item, 0=forever
xcache.ttl = 3600 <———–this is seconds, set to 0 if you dont want it to ever get deleted.
; interval of gc scanning expired items, 0=no scan, other values is in seconds
xcache.gc_interval = 300

; same as aboves but for variable cache
xcache.var_size = 64M <———You dont have to set this.
xcache.var_count = 8 <———–I have 8 processors
xcache.var_slots = 8K
; default ttl
xcache.var_ttl = 3600
xcache.var_maxttl = 3600
xcache.var_gc_interval = 300

xcache.readonly_protection = Off
xcache.mmap_path = “/dev/zero”

; make sure it’s writable by php (open_basedir is not checked)
xcache.coredump_directory = “”

xcache.cacher = On
xcache.stat = On
xcache.optimizer = Off

xcache.test = Off
xcache.experimental = Off

xcache.coverager = Off

xcache.coveragedump_directory = “”

Restart apache when you are finished and look at a phpinfo.php file to verify that Xcache is working.

/etc/init.d/httpd restart

Admin panel setup

If you followed my first tutorial, you have the source files in the /opt dir. Copy the whole admin folder in the xcache folder to one of your websites public_html folders.

cp -Rf /opt/xcache-2.0.0 /home/your-user/public_html

Change the ownership of the folder and files to your apache user or cpanel user and make them executable.

chown -R user:user /home/your-user/public_html/admin

chmod +x /home/your-user/public_html/admin

You should now be able to go into your admin folder and see your cache being stored by the site.

http://yoursite.com/admin

It should look similar to this. http://xcache.lighttpd.net/demo/admin/