Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 36295 - dev-php/php-accelerator: SHM cache doesn't work, or isn't accessible.
Summary: dev-php/php-accelerator: SHM cache doesn't work, or isn't accessible.
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High major (vote)
Assignee: PHP Bugs
Depends on:
Reported: 2003-12-22 05:04 UTC by Sune Foldager
Modified: 2004-03-29 11:12 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Note You need to log in before you can comment on or make changes to this bug.
Description Sune Foldager 2003-12-22 05:04:43 UTC
With the default setup, the php-accelerator's shm cache doesn't seem to work. After installing and starting up apache, typing phpa_cache_admin -mv gives:
No shm cache available with key 0x0c0deb00. The cache may not exist or you may have insufficient permissions to access it.

Reproducible: Always
Steps to Reproduce:
1. Have apache (1 or 2), php and php-accelerator installed.
2. Start or restart apache to activate. php_info verifies that the accelerator IS running.
3. Log in as root or something, and type phpa_cache_admin -mv
Actual Results:  
It says:
No shm cache available with key 0x0c0deb00. The cache may not exist or you may have 
insufficient permissions to access it.

Expected Results:  
It should say something like:
shm size 8.0MB bytes
mempool size 8.0MB
mempool bytes allocated 267.1KB
mempool max bytes allocated 282.4KB
mempool bytes free 1.7MB
mempool overhead 12.1KB
cache enabled

There is a FIX for it. It seems that adding:
phpa.shm_user = apache
phpa.shm_group = apache
To the php.ini does the trick. It does say in the php-accelerator manual that this step should no 
longer be needed, but I guess it can't figure out the right user and accidentally created the shm 
cache as root (and thus can't access it as 'apache').

I use a the normal 2.4.22 gentoo-sources kernel, although with grsecurity enabled (mode 
'medium'). I haven't tried without grsecurity, and I don't know if it's related to the bug or not.

Finally, here is 'emerge info'.. not that I think it will be needed, but the instructions say to include it 

Portage 2.0.49-r15 (default-x86-1.4, gcc-3.2.3, glibc-2.3.2-r3, 2.4.22-gentoo-r2)
System uname: 2.4.22-gentoo-r2 i686 Celeron (Mendocino)
Gentoo Base System version
ccache version 2.3 [enabled]
CFLAGS="-march=pentium2 -O3 -pipe"
CONFIG_PROTECT="/etc /var/qmail/control /usr/share/config /usr/kde/2/share/config /usr/kde/
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
CXXFLAGS="-march=pentium2 -O3 -pipe"
FEATURES="sandbox autoaddcvs ccache"
USE="x86 oss apm arts avi crypt cups encode foomaticdb gif gtk2 imlib jpeg libg++ mad mikmod 
motif mpeg ncurses nls opengl png quicktime sdl spell xml2 xmms xv zlib gdbm berkdb slang 
readline aalib svga gpm tcpd pam libwww ssl perl python oggvorbis -X -gnome -kde -gtk -qt 
-truetype -java -pdflib apache2 ruby18 ruby mysql sasl"
Comment 1 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2004-01-04 19:50:57 UTC
fixed in cvs (-r1 has it).
Comment 2 Sune Foldager 2004-01-05 12:00:48 UTC
Right, but you added the user/group additions to pkg_postinst, but this is done after merging so.. doesn't make it into the filesystem. Worked if I did ebuild ... postinst myself before ebuild ... qmerge, but otherwise I suppose moving it to pkg_preinst will fix it.
Comment 3 Stuart Herbert (RETIRED) gentoo-dev 2004-01-05 13:25:14 UTC
Fixed in CVS - both 1.3.3 and 1.3.3-r1.

Comment 4 Stuart Herbert (RETIRED) gentoo-dev 2004-03-29 11:12:30 UTC
Old bug, closing.