eAccelerator
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.
Windows Binaries
PHP Version | eAccelerator Version | eAccelerator Binaries (.dll ) |
Compiler | ||
---|---|---|---|---|---|
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 - Copy
bin/bison.exe
to a directory that is in your path (e.g.c:\Windows\
) - 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 - Copy
bin/flex.exe
to a directory that is in your path (e.g.c:\Windows\
)
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
c:\php-src
- Run the
buildconf.bat
from inside the root directory of the source code (i.e.c:\php-src\buildconf.bat
) - Run the
configure.bat
from inside the root directory of the source code (i.e.c:\php-src\configure.bat
) - Download the PHP binaries (thread safe version) for the version of the source code you are using
- Copy the file
dev\php5ts.lib
from the binaries into the root directory of the source code (i.e.c:\php-src\php5ts.lib
)
Compile eAccelerator
- Download the eAccelerator source code
- Unpack it into
ext\eaccelerator
inside 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...
- Choose
win32\eAccelerator.vcproj
(i.e.c:\php-src\ext\eaccelerator\win32\eAccelerator.vcproj
) - 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
- Append
;INCLUDE_DOC_COMMENTS
to the value of Preprocessor Definitions - Click OK
- Click Build > Build eAccelerator
- Find your DLL in
win32\Release\eAccelerator.dll
(i.e.c:\php-src\ext\eaccelerator\win32\Release\eAccelerator.dll
)