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.

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 2.6.18-53.1.13.el5 #1 SMP Tue Feb 12 13:01:45 EST 2008 i686

Partially solved: I found a Wordpress cache that utilizes eAccelerator instead of normal WP Cache. It seems to be working well.

Solved, had to compile eAccellerator from source because it does not support shared memory or sessions by default.

Download package to a temp folder.

(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