DennisKehrig.de

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).

  1. Download Bison
  2. Unpack the Bison ZIP file (bison-<version>-bin.zip) to a temporary directory
  3. Copy bin/bison.exe to a directory that is in your path (e.g. c:\Windows\)
  4. In case you are missing the libintl32.dll, try googling it (LibIntl for Windows worked for me)
  5. Download Flex
  6. Unpack the Flex ZIP file (flex-<version>-bin.zip) to a temporary directory
  7. Copy bin/flex.exe to a directory that is in your path (e.g. c:\Windows\)

Prepare the PHP source code

  1. Download the PHP source code (use the links above or download from php.net)
  2. Unpack it into a directory of your choice, say c:\php-src
  3. Run the buildconf.bat from inside the root directory of the source code (i.e. c:\php-src\buildconf.bat)
  4. Run the configure.bat from inside the root directory of the source code (i.e. c:\php-src\configure.bat)
  5. Download the PHP binaries (thread safe version) for the version of the source code you are using
  6. 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

  1. Download the eAccelerator source code
  2. 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
  3. Open Visual Studio
  4. Click File > Open > Project/Solution...
  5. Choose win32\eAccelerator.vcproj (i.e. c:\php-src\ext\eaccelerator\win32\eAccelerator.vcproj)
  6. Click Build > Configuration Manager...
  7. Under "Active solution configuration", choose "Release"
  8. Click "Close"
  9. If you want eAccelerator to keep doc comments:
    1. Click Project > Properties
    2. Find Configuration Properties > C/C++ > Preprocessor
    3. Append ;INCLUDE_DOC_COMMENTS to the value of Preprocessor Definitions
    4. Click OK
  10. Click Build > Build eAccelerator
  11. Find your DLL in win32\Release\eAccelerator.dll (i.e. c:\php-src\ext\eaccelerator\win32\Release\eAccelerator.dll)