Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

How to install eAccelerator on a cPanel server

This guide shows you how to add eAccelerator to PHP on a Linux server. It needs root access, so it is for VPS and dedicated server owners.

cPanel2 min read9 steps

What is eAccelerator?

eAccelerator is a PHP speed-up tool. PHP is the language many websites use. Each time a visitor loads a page, PHP reads and turns the code into steps. This takes time. eAccelerator saves those steps in memory. The next visit is faster. It is like keeping a finished recipe card instead of reading the cookbook every time.

Tip: eAccelerator is old. It does not work with new PHP versions. Modern PHP has OPcache built in, which does the same job. Use OPcache if you run PHP 7 or newer. The steps here suit older PHP 5 setups.

Warning: A wrong change can break every site on the server. Take a full backup first.

Before you start

  • Log in over SSH as root.
  • Make sure the build tools exist.
    yum install -y gcc make autoconf php-devel
    This installs the tools needed to build PHP add-ons.
  • Check your PHP version with php -v.

Steps

  1. Go to a working folder.
    cd /usr/local/src
  2. Download the eAccelerator source package that matches your PHP version, from its project page. Save it in this folder.
  3. Unpack it. Change the file name to match yours.
    tar xjf eaccelerator-0.9.6.tar.bz2
    cd eaccelerator-0.9.6
    This opens the package.
  4. Prepare the build.
    phpize
    This sets up the files for your PHP version.
  5. Configure and build.
    ./configure --enable-eaccelerator=shared
    make
    make install
    These commands compile the add-on and place it in PHP's folder.
  6. Make a cache folder.
    mkdir /tmp/eaccelerator
    chmod 777 /tmp/eaccelerator
    The add-on stores its files here.
  7. Add settings to your php.ini file. Find it with php --ini.
    extension="eaccelerator.so"
    eaccelerator.shm_size="64"
    eaccelerator.cache_dir="/tmp/eaccelerator"
    eaccelerator.enable="1"
    eaccelerator.optimizer="1"
    The first line loads the add-on. The size is in megabytes.
  8. Restart Apache.
    service httpd restart
    This reloads PHP with the new add-on.
  9. Check it.
    php -v
    The output should mention eAccelerator.

On a server with WHM

cPanel servers often use EasyApache to build PHP. The older EasyApache 3 allowed eAccelerator as an option. If you use EasyApache, pick it there, rather than build by hand. Ask Hostvento support if you are not sure which fits your server.

Quick recap

  • eAccelerator speeds up PHP by caching compiled code.
  • It is old. Use OPcache with modern PHP.
  • Build it with phpize, configure, make, then edit php.ini.
  • Restart Apache and check with php -v.