Warning: eAccelerator seems to be dead, see Wikipedia
eAccelerator caches your PHP files as byte code and thereby speeds up execution considerably. Each time a new version of PHP gets released, you need a new version of it, though - at least a recompiled one. Since the publication of binaries is left to the community, you have to wait for them to randomly pop up some time after a new version is released. Also, to reduce memory overhead, doc comments are stripped from the cached PHP files, rendering
getDocComment() inert in the process. There is no simple configuration option to counter-act this, instead you have to set a flag before compiling. This time I wanted to help myself. Below you find the result and instructions on how to do it yourself.
|PHP Version||eAccelerator Version||eAccelerator Binaries (
|PHP 5.3.3 (Source, Thread-safe Binaries)||eAccelerator 0.9.6.1 (Source)||Default configuration||With Doc comment support||Microsoft Visual C++ 2008 Express Edition|
|PHP 5.3.2 (Source, Thread-safe Binaries)||eAccelerator 0.9.6 (Source)||Default configuration||With Doc comment support||Microsoft Visual C++ 2008 Express Edition|
How to compile it yourself
You will need Visual Studio (see above for versions that should work).
Download bison.exe and flex.exe
At least PHP 5.3.3 needs them for configure.bat to succeed (see below).
- Download Bison
- Unpack the Bison ZIP file (
bison-<version>-bin.zip) to a temporary directory
bin/bison.exeto a directory that is in your path (e.g.
- In case you are missing the
libintl32.dll, try googling it (LibIntl for Windows worked for me)
- Download Flex
- Unpack the Flex ZIP file (
flex-<version>-bin.zip) to a temporary directory
bin/flex.exeto a directory that is in your path (e.g.
Prepare the PHP source code
- Download the PHP source code (use the links above or download from php.net)
- Unpack it into a directory of your choice, say
- Run the
buildconf.batfrom inside the root directory of the source code (i.e.
- Run the
configure.batfrom inside the root directory of the source code (i.e.
- Download the PHP binaries (thread safe version) for the version of the source code you are using
- Copy the file
dev\php5ts.libfrom the binaries into the root directory of the source code (i.e.
- Download the eAccelerator source code
- Unpack it into
ext\eacceleratorinside the PHP source code (i.e.
c:\php-src\ext\eaccelerator) - you might have to create that directory first
- Open Visual Studio
- Click File > Open > Project/Solution...
- Click Build > Configuration Manager...
- Under "Active solution configuration", choose "Release"
- Click "Close"
- If you want eAccelerator to keep doc comments:
- Click Project > Properties
- Find Configuration Properties > C/C++ > Preprocessor
;INCLUDE_DOC_COMMENTSto the value of Preprocessor Definitions
- Click OK
- Click Build > Build eAccelerator
- Find your DLL in