Running eAccelerator on OpenBSD’s Apache

OpenBSD provides an optimized and secured Apache v1.3 server. It also provides various PHP modules. But it doesn’t provide the eAccelerator PHP module (yet?).

Here’s how I compiled, installed and run eAccelerator on OpenBSD’s native Apache:

  • Prepare the environment for eAccelerator compilation:
    # pkg_add autoconf-2.63 automake-1.10.3p0 m4 libtool
  • Grab and extract eAccelerator:
    # ftp
    # tar xvjf eaccelerator-
  • Compile eAccelerator:
    # cd eaccelerator-
    # AUTOCONF_VERSION="2.63" phpize
    # ./configure --with-eaccelerator-userid=67
    # make
  • Install the module and its configuration file:
    # cp -p ./modules/ /var/www/lib/php/modules/
    # cp -p ./eaccelerator.ini /var/www/conf/php5.sample/
    # cp -p /var/www/conf/php5.sample/eaccelerator.ini /var/www/conf/php5/eaccelerator.ini
    # mkdir /var/www/tmp/eaccelerator
    # chown www:www /var/www/tmp/eaccelerator
  • Configure eAccelerator:
    # vi /var/www/conf/php5/eaccelerator.ini
    eaccelerator.log_file = "/logs/eaccelerator_log"
    eaccelerator.shm_only = "256"
  • Restart Apache.

Quite simple and fast 🙂

Installing (eAccelerator) from source:

1 Comment

  • Till Kraemer Sat, 26 Nov 2011 10:22:28 +0000 Reply

    I had tons of segmentation fault errors with APC, so thanks a lot for this great tutorial!

Leave a Reply

Your email address will not be published. Required fields are marked *


%d bloggers like this: