Need to Add PHP Extension memcached

I'm trying to add memcached php extension, but it seems Wordpress and zeslecp can't see it. I've done the global install of memcached using
Code:
sudo yum install memcached
Done all the typical config and confirmed it is definitely running on the server.

I've also tried installing it into the buried php I found using:
Code:
yum install ze-php81-php memcached

I've added the line extension=memcached.so into every php ini file I can find, both from withing the zeslecp ini editor as well as other php.ini files I found in the file system, but I just can't seem to make wordpress (running php 8.1 by the way) recognize that memcached is there and running.

Any ideas how to get it installed? I'm honestly surprised such a common extension recommended by Wordpress wasn't included by default.
 
Anything on this? I'm willing to throw you a few $$$ for your time (maybe by buying a license, or just paying you for an hour of your time).

I've been trying for two days to install it into this nested php, but can't find a way to make it work. I need to run some custom database operations on a server I just moved to Zesle, and memcached is necesary to do it efficiently sometime this century (it's a big database with lots of mess to search/replace/fix/clean/etc.).
 

admin

Administrator
Staff member
Hello Jared,

When we try to install php extensions by native commands like apt-get install php-memcached, it messup zeslecp installation, I highly recommend you to run install command, it will just do fixes

Here guide to install/compile memcached php extension

Code:
#!/usr/bin/bash

set -ex

ROOT=$(pwd)

sudo apt-get update
sudo apt-get install build-essential
sudo apt-get install autoconf

# dependencies
sudo apt-get install zlib1g-dev
sudo apt install libmemcached-dev

# Install build package
sudo apt-get install ze-php81-dev

# download and extract extension source files
sudo rm -rf $ROOT/memcached-3.2.0*
sudo wget -O $ROOT/memcached-3.2.0.tgz https://pecl.php.net/get/memcached-3.2.0.tgz && sudo tar -xvf $ROOT/memcached-3.2.0.tgz

# change source directory
cd $ROOT/memcached-3.2.0

# Build extension
sudo /opt/zesle/ze-php81/root/usr/bin/phpize
sudo ./configure --with-php-config=/opt/zesle/ze-php81/root/usr/bin/php-config
sudo make && sudo make install

cat >/opt/zesle/ze-php81/root/etc/php.d/30-memcached.ini <<EOF
; Enable memcached extension module
extension=memcached.so
EOF
 
Last edited:

admin

Administrator
Staff member
Use this script for RHEL

Code:
#!/usr/bin/bash

set -ex

ROOT=$(pwd)

sudo yum update
sudo yum -y groupinstall 'Development Tools'

# dependencies
sudo yum install zlib-devel
sudo yum install libmemcached-devel

# Install build package
sudo yum install ze-php81-php-devel

# download and extract extension source files
sudo rm -rf $ROOT/memcached-3.2.0*
sudo wget -O $ROOT/memcached-3.2.0.tgz https://pecl.php.net/get/memcached-3.2.0.tgz && sudo tar -xvf $ROOT/memcached-3.2.0.tgz

sudo wget -O memcached-3.2.0.tgz https://pecl.php.net/get/memcached-3.2.0.tgz && sudo tar -xvf memcached-3.2.0.tgz

# change source directory
cd $ROOT/memcached-3.2.0

# Build extension
sudo /opt/zesle/ze-php81/root/usr/bin/phpize
sudo ./configure --with-php-config=/opt/zesle/ze-php81/root/usr/bin/php-config
sudo make && sudo make install

cat >/opt/zesle/ze-php81/root/etc/php.d/30-memcached.ini <<EOF
; Enable memcached extension module
extension=memcached.so
EOF
 
Thank you! That worked. I didn't know there was a ze-php81-php-devel package we could install. That was the missing piece for me, couldn't compile the memcache.so for the nested php without it.

Much appreciated!
 
1685495609909.png

Thank you memcached and zesle admin! I've never hit a 99 on performance before. Especially on a live, active website running on a somewhat underpowered VPS. Now to get this database mess cleaned up.
 
Top