PHP eAccelerator with FCGId


I'm running eAccelerator on my server, and it's caching scripts for the virtual servers running PHP as apache under mod_php. However, for the sites/virtualservers running PHP as owner under FCGId, eAccelerator is not caching scripts. (not listed in the cache via control.php)

I've installed the eAccelerator plugin on a Wordpress 2.5 and a 2.3.3 site with the same results... not broken, but apparently not caching.

I know it should work, I have seen several references to it being possible & optimal:

Any advice on what I need to do to make it work?

Apparently if there is a version mismatch between the version of PHP eaccelerator was compiled for & the reported version, the scripts of fcgid enabled virtual servers will not be cached:

eAccelerator [shm:mmap_anon sem:fcntl]
PHP 5.1.6 [ZE 2.1.0]
Using apache2handler on Linux CentOS 5 2.6.18-53.1.13.el5


Mostly Harmless
Staff member

Is there a version mismatch?
Solved, had to compile eAccellerator from source because it does not support shared memory or sessions by default.

I'm running CentOS 5 / Red Hat EL 5 -- so the pathing below is for that system in default installation.

Download package to a temp folder.
wget the appropriate package from

(note -- you must have gcc and php-devel installed to compile from source -- they are easy to find as RPMs)

(note -- PHP_PREFIX is the path to your shared /bin)

export PHP_PREFIX="/usr"
./configure -enable-eaccelerator=shared -with-php-config=$PHP_PREFIX/bin/php-config -with-eaccelerator-shared-memory -with-eaccelerator-sessions -with-eaccelerator-content-caching -with-eaccelerator-debug -with-libdir=/usr/lib/php/modules/ -exec-prefix=/usr
make install
make test
service httpd restart
Last edited:


Mostly Harmless
Staff member
Glad you got it fixed, and thanks for sharing the steps you took to resolve the problem!