Skip to content

FAQ: Installation: PHP Modules

Frederick Townes edited this page Dec 18, 2018 · 4 revisions

Installation

The following modules are recommended for installation in order to support various caching methods:

  • php-redis
  • php-memcache
  • php-memcached
  • php-opcache

Ubuntu/Debian

apt-get -y install php-redis php-memcache php-memcached php-opcache
service php*-fpm restart

Install Memcached Module

Using PECL:

pecl install memcached

Or manually:

cd /usr/local/src
wget http://pecl.php.net/get/memcache-2.2.6.tgz
tar -xzf memcache-2.2.6.tgz
cd memcache-2.2.6
phpize && ./configure
make && make install

Use the memcache.ini file we prepared for you:

cp /path/to/your/website/wp-content/plugins/w3-total-cache/ini/memcache.ini /etc/php.d/

Restart Apache:

/etc/init.d/httpd restart

Test module:

php -r 'phpinfo();' | grep 'memcache'

Install Alternative PHP Cache (APC) Module

Install APC using PECL:

pecl install apc

Or manually:

cd /usr/local/src
wget http://pecl.php.net/get/APC-3.1.9.tgz
tar -xzf APC-3.1.9.tgz
cd APC-3.1.9
phpize
./configure --enable-apc --enable-apc-mmap --with-apxs=/usr/sbin/apxs --with-php-config=/usr/bin/php-config
make && make install

The paths for --with-apxs= and ---with-php-config= should be the same as the output of:

whereis php-config
whereis apxs

Installation was successful if the output looks like this:

Installing shared extensions: /usr/lib/php/modules/

Configure APC

Use the apc.ini file we prepared for you:

cp /path/to/your/website/wp-content/plugins/w3-total-cache/ini/apc.ini /etc/php.d/

Restart apache when ready:

/etc/init.d/httpd restart

Test the module:

php -r 'phpinfo();' | grep 'apc'

Install XCache Module

cd /usr/local/src
wget http://xcache.lighttpd.net/pub/Releases/1.3.2/xcache-1.3.2.tar.gz
tar -xzf xcache-1.3.2.tar.gz
cd xcache-1.3.2
phpize && ./configure --with-php-config=/usr/bin/php-config --enable-xcache --enable-xcache-optimizer --enable-xcache-coverager
make && make install

The path for ---with-php-config= should be the same as the output of:

whereis php-config

Installation was successful if the output looks like this:

Installing shared extensions: /usr/lib/php/modules/

Configure XCache Module

Use the xcache.ini file we prepared for your:

cp /path/to/your/website/wp-content/plugins/w3-total-cache/ini/xcache.ini /etc/php.d/

Restart apache when ready:

/etc/init.d/httpd restart

Test the module:

php -r 'phpinfo();' | grep 'xcache'

Install eAccelerator Module

cd /usr/local/src
wget http://autosetup1.googlecode.com/files/eaccelerator-0.9.5.3.tar.bz2
tar -xjf eaccelerator-0.9.5.3.tar.bz2
cd eaccelerator-0.9.5.3
phpize && ./configure --with-eaccelerator-shared-memory --with-php-config=/usr/bin/php-config
make && make install

The path for ---with-php-config= should be the same as the output of:

whereis php-config

Installation was successful if the output looks like this:

Installing shared extensions: /usr/lib/php/modules/

Configure eAccelerator Module

Use the eaccelerator.ini file we prepared for your:

cp /path/to/your/website/wp-content/plugins/w3-total-cache/ini/eaccelerator.ini /etc/php.d/

Restart apache when ready:

/etc/init.d/httpd restart

Test the module:

php -r 'phpinfo();' | grep 'eaccelerator'

New Relic Module

Find requirements and installation instructions on New Relic website: Installing New Relic for PHP.

To see if this server supports New Relic click "compatibility check" on the Dashboard tab. Other key resources can be found below: