Theme editor

Guide Plesk Installing the Memcached Extension for PHP on Plesk Panel (2025 Guide)

  • Thread starter Thread starter CL4Y
  • Start date Start date
  • Views 168

CL4Y

Keyboard Ninja
Administrator
Thread owner

🚀 Installing the Memcached Extension for PHP on Plesk Panel (2025 Guide)

To enhance your website’s speed and performance, caching technologies play a crucial role.
Memcached is one of the most widely used caching solutions. It helps your PHP applications cache database queries or other heavy operations, significantly improving load times.

In this guide, you’ll learn step by step how to install and configure the Memcached extension for PHP on your Plesk Panel.



Step 1: Install Required Packages

Before installing the Memcached extension, you need to install necessary dependencies and development tools.
Run the appropriate command below based on your server’s operating system.

For CentOS/RHEL-based systems:
Bash:
wget -q -O - http://www.atomicorp.com/installers/atomic | sh && yum install make memcached gcc libmemcached-devel zlib-devel plesk-php*-devel

For Debian/Ubuntu-based systems:
Bash:
apt install memcached autoconf automake gcc libmemcached-dev libhashkit-dev pkg-config plesk-php*-dev zlib1g-dev make

jetto-plesk-memcached-install-1.gif




Step 2: Install the Memcached Extension

Once all required packages are installed, use the pecl command to install the Memcached extension.
Replace 7.4 with the PHP version you want to configure:
Bash:
/opt/plesk/php/7.4/bin/pecl install memcached

jetto-plesk-memcached-install-2.gif




Step 3: Create PHP Configuration File

After installation, create a configuration file so PHP recognizes the Memcached extension.
Use the command below to create a new .ini file:
Bash:
echo "extension=memcached.so" > /opt/plesk/php/7.4/etc/php.d/memcached.ini

jetto-plesk-memcached-install-3.gif




Step 4: Refresh Plesk PHP Handlers

Run the following command to make Plesk detect the newly added extension:
Bash:
plesk bin php_handler --reread

jetto-plesk-memcached-install-4.gif




Step 5: Restart PHP-FPM Service

Restart the PHP-FPM service for the selected PHP version to apply the changes:
Bash:
service plesk-php74-fpm restart



Step 6: Restart Web Servers

Finally, restart your web servers (Apache or Nginx) depending on your OS.

For CentOS/RHEL-based systems:
Bash:
service httpd restart

For Debian/Ubuntu-based systems:
Bash:
service apache2 restart



Step 7: Verify Installation

Check whether the Memcached extension was successfully installed by running this command:
Bash:
/opt/plesk/php/7.4/bin/php -m | grep memcached
If you see “memcached” in the output, the installation was successful.

jetto-plesk-memcached-install-5.webp
 
Thread owner
You can now start speeding up your site by using the Memcached extension in your PHP application.
 
Back
Top