Webbstre

Registered
Dec 10, 2013
3
0
1
cPanel Access Level
Root Administrator
Hello! I'm moving to cPanel/WHM for the first time, and I'm trying to get XCache set up properly. I've got PHP compiled with XCache already, but I can't find any way to add setting options for XCache within the PHP Configuration Editor. Thus, I'd like to know how to do either of the following:

1- How to add new lines to the PHP Configuration Editor

OR

2- How to get the system to scan an additional directory for additional .ini files where I can put the XCache settings within.

The reason I'm not doing this directly via Shell is that I don't want the PHP Configuration Editor to wipe my changes any time there is an update or I alter a value somewhere.

Thanks for any help anyone can give me!
 

Webbstre

Registered
Dec 10, 2013
3
0
1
cPanel Access Level
Root Administrator
Ok, I'm making progress, but now I have an entirely new problem.

First, the answer to Number 2 above was located here: http://forums.cpanel.net/f5/proper-procedure-edit-php-ini-343971.html#post1388731

Basically, I needed to recompile PHP with Safe PHP Cgi turned on.

Now that XCache reads my settings file, I'm getting a different problem. Here are my settings, and the error in the log that loads whenever I try to load a page:

[xcache]
; ini only settings, all the values here is default unless explained

; select low level shm/allocator scheme implemenation
xcache.shm_scheme = "mmap"
xcache.size = 512M
; set to cpu count (cat /proc/cpuinfo |grep -c processor)
xcache.count = 2
xcache.slots = 128K
xcache.ttl = 600
xcache.gc_interval = 600

xcache.var_size = 512M
xcache.var_count = 2
xcache.var_slots = 128K
; default ttl
xcache.var_ttl = 600
xcache.var_maxttl = 7200
;xcache.var_gc_interval = 1800

; 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 = "/tmp/xcache"



; 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 = On

xcache.test = Off
; N/A for /dev/zero
xcache.readonly_protection = Off
[Wed Dec 11 10:08:17 2013] [notice] Apache/2.2.26 (Unix) mod_ssl/2.2.26 OpenSSL/1.0.1e-fips mod_bwlimited/1.4 mod_fcgid/2.3.6 configured -- resuming normal operations
/tmp/xcache: Permission denied
Cannot open or create file set by xcache.mmap_path, check the path permission or check xcache.size/var_size against system limitation
PHP Fatal error: Cannot open or create file set by xcache.mmap_path, check the path permission or check xcache.size/var_size against system limitation in Unknown on line 0
PHP Fatal error: XCache: Cannot create shm in Unknown on line 0
PHP Fatal error: XCache: Cannot init in Unknown on line 0
It appears to be a problem with the /tmp/xcache folder, but I've checked, and the permissions are 777 and that partition is allowed 2 GB of space, and it's only at 3% now.

Any ideas?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
Hello :)

Have you checked to make sure the /tmp partition is not at it's inodes limit? EX:

Code:
df -i
Thank you.
 

Webbstre

Registered
Dec 10, 2013
3
0
1
cPanel Access Level
Root Administrator
Yup, it was only at 3%. Additionally, after making that post I called it a night, and by the next day the problem had disappeared. XCache now runs correctly. Unfortunately, not I'm on to vBulletin-based errors :P