|
|

01-15-2013, 02:02 AM
|
|
Senior Member
|
|
Join Date: Jan 2013
Posts: 95
|
|
+1 the scripts would be quite simple :
On user 1 :
PHP Code:
<?php xcache_set("mona_test150112", 'This data was set by user 1', 120); print('mona_test15112 was set by user 1 for 120 seconds'); ?>
On user 2
PHP Code:
<?php if (xcache_isset("mona_test150112")) { print xcache_get("mona_test150112"); } else { print ('mona_test150112 is not set.'); } ?>
I haven't tested them as I don't have xcache yet
|

01-18-2013, 01:53 AM
|
|
LiteSpeed Staff
|
|
Join Date: Sep 2009
Posts: 2,226
|
|
tested on our cPanel box, unfortunately, the issue exists.
add following code to print out current user id:
PHP Code:
$gid = `id`;
echo "<pre>gid=".$gid;
echo "</pre>";
restart lsws,
step 1: access http://www.lstest3.com/xcache.php
Quote:
gid=uid=507(lstest3) gid=503(lstest3) groups=503(lstest3)
mona_test150112 is not set.
|
step 2: access http://www.lstest.com/xcache.php
Quote:
gid=uid=504(lstestc) gid=501(lstestc) groups=501(lstestc)
mona_test15112 was set by user 1 for 120 seconds
|
step 3:access http://www.lstest3.com/xcache.php again:
Quote:
gid=uid=507(lstest3) gid=503(lstest3) groups=503(lstest3)
This data was set by user 1
|
so test result: so far don't use variable cache in suExec daemon mode in shared hosting. opcode cache is ok.
it may not be difficult for xcache to add such feature: each user(by check php process's user id) to have its own name space to store variables. or may be it already has similar feature -- configurable, need read its manual first 
|

01-18-2013, 02:04 AM
|
|
Senior Member
|
|
Join Date: Jan 2013
Posts: 95
|
|
|
Seems to be exactly the same issue with XCache as with APC.
I've seen some patches for Xcache 2 that say they do this but not for Xcache 3 or APC.
Do you know if it's possible to deactivate this function ?
|

01-18-2013, 02:06 AM
|
|
Senior Member
|
|
Join Date: Jan 2013
Posts: 95
|
|
|
Xcache 3 version says it has "namespace support" but I haven't found any documentation about this so I don't know if it works with gid's or not
|

01-18-2013, 02:17 AM
|
|
Senior Member
|
|
Join Date: Jan 2013
Posts: 95
|
|
Looks promissing in the xcache.ini for Xcache 3.0.1 :
Code:
; mode:0, const string specified by xcache.var_namespace
; mode:1, $_SERVER[xcache.var_namespace]
; mode:2, uid or gid (specified by xcache.var_namespace)
xcache.var_namespace_mode = 0
xcache.var_namespace = ""
I presume we would use the following :
Code:
; mode:0, const string specified by xcache.var_namespace
; mode:1, $_SERVER[xcache.var_namespace]
; mode:2, uid or gid (specified by xcache.var_namespace)
xcache.var_namespace_mode = 2
xcache.var_namespace = "gid"
Could you give it a go and see if it fixes the issue ?
Last edited by Monarobase; 01-18-2013 at 02:22 AM..
|

01-18-2013, 04:16 AM
|
|
LiteSpeed Staff
|
|
Join Date: Sep 2009
Posts: 2,226
|
|
hi, it took me much time to set up the test environment.
initially, same result as before -- but figured out it's because of xcache 2.0.1. it just ignore
xcache.var_namespace_mode = 2
xcache.var_namespace = "gid"
finally build latest php 5.4.11 + xcache 3.0.1, yes, just what we want!
in step 3, the output is
Quote:
gid=uid=507(lstest3) gid=503(lstest3) groups=503(lstest3)
mona_test150112 is not set.
|
same as step 1.
this is a good news -- to summary in short:
lsphp5 suExec daemond + xcache 3.0.1, all users on a shared host can use opcode cache and variable cache in memory, and can't access each other's variables.
in php.ini, xcache.var_namespace_mode should set to 2:
Quote:
; mode:0, const string specified by xcache.var_namespace
; mode:1, $_SERVER[xcache.var_namespace]
; mode:2, uid or gid (specified by xcache.var_namespace)
xcache.var_namespace_mode = 2
xcache.var_namespace = "gid"
|
|

01-18-2013, 04:35 AM
|
|
Senior Member
|
|
Join Date: Jan 2013
Posts: 95
|
|
|
Great, will be installing LiteSpeed + Xcache 3.0.1 soon (probably tomorrow).
Will be my first litespeed install, so I hope all goes well !
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 11:46 PM.
|
|