Friday, January 22, 2016

Add Memcached for PHP7

Found this at https://serversforhackers.com/video/installing-php-7-with-memcached

This is for performance enhancement. It caches frequently requested features in memory for faster response times.

#Install php-memcached
sudo apt-get install php-memcached

#Restart the PHP sevice
sudo service php7.0-fpm restart

Issues:
Check that /etc/php/mods-available/memcached.ini exists and the line
extension=memcached.so
is uncommented.

Check that
/etc/php/mods-available/memcached.ini /etc/php/7.0/fpm/conf.d/20-memcached.ini
and
/etc/php/mods-available/memcached.ini /etc/php/7.0/cli/conf.d/20-memcached.ini
exist.

If they don't, create links:
sudo ln -s /etc/php/mods-available/memcached.ini /etc/php/7.0/fpm/conf.d/20-memcached.ini
sudo ln -s /etc/php/mods-available/memcached.ini /etc/php/7.0/cli/conf.d/20-memcached.ini

The directions at the link above include these steps, but they were already done for me after I installed.

No comments:

Post a Comment