Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
VGSources
Blog

How to Install and Enable Memcached for WordPress on Ubuntu

A complete Ubuntu guide to installing Memcached, loading the correct PHP extension, enabling a persistent WordPress object-cache drop-in, and troubleshooting common failures.
Length10 min Posted Quest giverVGSources Team
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Installing Memcached for WordPress on Ubuntu requires three separate pieces: the Memcached daemon, a PHP extension loaded by the PHP runtime serving your site, and a persistent WordPress object-cache drop-in. Install the daemon with Ubuntu’s memcached package, install the matching php-memcached package for your web PHP version, restart PHP-FPM or the web server, then install one compatible wp-content/object-cache.php. Defining WP_CACHE alone does not make caching persistent.

The safest default is a daemon listening only on 127.0.0.1:11211. Verify all four layers—daemon, web PHP extension, drop-in ownership, and WordPress’s persistent-cache status—before expecting a performance change.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What you are installing

Memcached is an in-memory key-value service. It does not inspect WordPress requests or cache pages by itself. WordPress must call the service through a PHP extension and an object-cache implementation.

Layer What it does How you verify it
Memcached daemon Runs the cache service and listens on a host and port. systemctl status memcached and a listening-socket check.
PHP extension Provides the PHP client classes that communicate with the daemon. Check the PHP runtime used by the web server or PHP-FPM, not only the command-line PHP binary.
WordPress drop-in Implements persistent calls to the WordPress object-cache API. Inspect wp-content/object-cache.php; exactly one implementation must own it.
WordPress configuration Reports and uses the persistent object cache through the drop-in. Use the cache implementation’s status screen or WordPress’s cache information to confirm persistence.

WordPress’s built-in object cache is request-scoped. The WordPress Developer Resources reference states that adding define('WP_CACHE', true) has no effect unless a persistent cache plugin is installed. WP_CACHE can be present as part of a plugin’s setup, but it is not a substitute for object-cache.php.

#1 Best Overall
Sale
Gaoye Blue Light Blocking Glasses
  • BLUE LIGHT BLOCKING GLASSES: Our blue light glasses for women boast UV400 protection, blocking harmful blue rays from computer screens. With these bluelight glasses women, you can enjoy gaming, reading, or watching TV with no worries of eye strain.
  • EYE RELIEF: Our blue light glasses are engineered to reduce blurry vision or strain caused by prolonged screen time. These womens blue light glasses aid in better sleep by preventing blue light from disrupting your natural sleep cycle, helping you fall asleep faster and enjoy a more restful night's sleep, making them the perfect christmas present.
  • COMFORTABLE: Crafted from durable material, our trendy blue light glasses for woman or blue light glasses men ensure long-lasting comfort. The high-transmittance lenses accessories, gamer gifts for men, help keep your eyes relaxed. Perfect stocking stuffers, gifts for gamers men, christmas gifts for men, halloween costumes.
  • LIGHTWEIGHT: These clear blue light glasses feature a lightweight frame, meaning they’ll stay comfy for long-term wear. Perfect as blue blockers glasses for women or mens blue light glasses, these non-prescription fake glasses for men can be worn throughout the day. The blue light blocking glasses women feature polycarbonate HD lenses, which are anti-reflective and restore true color.
  • WORRY-FREE PURCHASE: If you experience any issues, our support team is ready to assist you quickly. These are the perfect costume glasses for cosplay dressing up.

Check Ubuntu and the PHP runtime first

Identify the Ubuntu release

Run the following as an administrator or through sudo:

lsb_release -a
cat /etc/os-release

Repository package names and versions vary by Ubuntu release. Do not copy a package version from another server; let your enabled repositories select the current security-supported build.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Find the PHP version serving WordPress

php -v reports the command-line binary. That binary can differ from the PHP-FPM pool or Apache module handling browser requests. Identify the active handler with commands such as:

systemctl list-units --type=service | grep -E 'php.*fpm|apache2|nginx'
php -v

For a site using PHP-FPM, note the version in the active php8.x-fpm service. For Apache, determine whether the site uses an Apache PHP module or proxies to PHP-FPM. A temporary diagnostic page that displays phpinfo() can reveal the web runtime and loaded modules; remove that page immediately after checking because it exposes server details.

Confirm package availability

Ubuntu normally provides a generic php-memcached package that resolves to the distribution’s default PHP version, and may also provide a release-specific package such as php8.2-memcached. Search your repositories before installing:

Rank #2
Windex Gaming Cleaning Wipes, Pre-Moistened Wipes to Instantly Clean all Gaming Gear and Electronics, Resealable Packaging for a Freshness Lock, 25 count (Pack of 1)
  • WINDEX GAMING WIPES: effortlessly clean all your gaming gear and gaming electronics in one easy step with our new Windex Gaming Wipes
  • AMMONIA FREE: our ammonia-free formula is safe to use on all of your favorite gaming equipment like consoles, headsets, controllers, screens, keyboards, and more
  • PRE-MOISTENED WIPES: each wipe instantly removes dust, dirt, and stubborn smudges and fingerprints leaving a streak-free shine
  • ANTI-STATIC: great for cleaning and wiping down your gaming gear and electronics leaving behind no visible residue
  • COMPACT RESEALABLE PACKAGE: store your pack of Windex Gaming Wipes anywhere in your home for whenever a quick and easy wipedown is needed
apt-cache search memcached | grep -E '^php.*memcached|^memcached'
apt-cache policy memcached php-memcached

As repository observations accessed on 2026-10-15, Ubuntu 22.04 (Jammy) listed memcached 1.6.14-1ubuntu0.3 and php-memcached 3.1.5+2.2.0-14.1; Ubuntu 24.04 (Noble) listed memcached 1.6.24-1ubuntu0.3 and php-memcached 3.2.0+2.2.0-4ubuntu3. These are repository versions, not permanent guarantees; updates can change them.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Install and secure the Memcached daemon

  1. Refresh package metadata.
    sudo apt-get update
  2. Install the service from Ubuntu’s repository.
    sudo apt-get install memcached

    Official Memcached documentation recommends the operating-system package on Debian and Ubuntu.

  3. Enable it at boot and start it now.
    sudo systemctl enable --now memcached
  4. Check the service state.
    sudo systemctl status memcached

    The status should show an active running service. If it failed, inspect the recent journal with sudo journalctl -u memcached -n 50 --no-pager.

  5. Confirm the listening socket.
    sudo ss -ltnp | grep 11211

    For a local WordPress installation, the expected endpoint is 127.0.0.1:11211.

Keep the daemon off the public network

Memcached has no reason to be internet-facing for a WordPress installation on the same host. Keep its listen address on localhost, or on a private interface only when another trusted host must connect. If you change the service configuration, apply a firewall rule and a network policy that allow only the required application hosts, then restart Memcached and verify the new address with ss. Never expose port 11211 broadly just to make a remote connection work.

Install the PHP extension that matches your web PHP

Understand the two similarly named extensions

memcached and memcache are different PHP extensions. The current Ubuntu package index uses php-memcached, which is the extension built around libmemcached. The older PECL memcache extension exposes a different API. A WordPress drop-in written for one may not work with the other.

Choose a drop-in only after checking which class your web PHP provides. A drop-in requiring Memcached needs the memcached extension; one requiring Memcache needs the legacy extension. Do not install both merely to silence an error, and do not infer compatibility from a similar package name.

Install the matching Ubuntu package

For the distribution-default PHP version:

sudo apt-get install php-memcached

If your repositories and site use a specific PHP release, install the corresponding release-specific package shown by apt-cache search, for example:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
LISEN Cell Phone Stand Phone Holder for Desk, Office Decor Gadgets for Men
  • Ergonomic & Adjustable Design: Fight "text neck" and improve your posture. Designed for comfort, it offers an adjustable height (7.1in-8.5in) (1.4in adjustable range) and angle (5°-85°) Please note: cell phone stand is only 9 inches tall—the length of a standard pencil
  • Without blocking subtitles Perfect for office desk Tiktok Face Time Zoom video—this is the ultimate kitchen desk essential for phones! Perfect viewing experience while reducing neck back strain, A must-have for gamers streamers desk, and anyone who values both style and support!
  • Sleek & Stable Design fits Otterbox Case: Say goodbye to bent cables, tangles, and tip-overs! LISEN’s stylish adjustable desk phone holder features a built-in charging hole and smart cable management, keeping your phone secure and your workspace clutter-free cool gadgets for men
  • ANTI-SLIP DESIGN free hands: The under 10.00 items easy gadgets back and the bottom of this kitchen essentials for women are fully covered by anti-skid silicone, which LISEN stand up desk decor can provide maximum protection device from any scratches and slides
  • Your Perfect Viewing Companion:If your product arrives damaged or breaks within 365 days, reach out to LISEN for a quick and hassle-free solution. Struggling with assembly, like tightening the screw? We’ve got your back! Your experience matters to us. (Product including: phone Holder stand*1, screw*1, hexagon screwdriver*1, specification*1)
sudo apt-get install php8.x-memcached

Replace 8.x with the actual version serving the site. Installing the extension for PHP 8.3 does not load it into a PHP-FPM pool running PHP 8.2.

Restart the handler

PHP loads extensions when its process starts. Restart the active handler after installation:

sudo systemctl restart php8.x-fpm

Use the real FPM service name. If Apache loads PHP directly, restart Apache instead:

sudo systemctl restart apache2

When Nginx proxies to PHP-FPM, restart the FPM service, not Nginx, unless you also changed Nginx configuration.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Verify the web-serving runtime

Checking php -m | grep memcached is useful, but it verifies only the CLI binary. Confirm the module in the PHP-FPM or Apache runtime that serves WordPress. A temporary phpinfo() page should show a memcached section; delete it immediately after the check. If the web runtime does not list the module, inspect the FPM pool’s PHP version, the enabled configuration directory, and the service you restarted.

Rank #4
Ledagic IC+RGBW USB Powered Led Light Bar with App & Remote Control, 2 Pack
  • Easy Installation: Our gaming lights have been designed to enhance your entertainment experience. Simply position the led light bar next to your TV or game console to create a game room environment with ease. They come with USB power and a 60 inch cord for direct mounting and mobility
  • Audio Syncing & Extensive Mode: The built-in high-sensitivity music sensor allows you to sync the TV led lights to your favorite music. Lights react and move to the beat of music, film and game audio, creating an incredible immersive sound and light experience – and all without the need for an additional hub. You can choose from 64+ patterns, including strobe, illusion, jump, energy, gradient, running, chasing, fluttering mode etc. Each mode can be applied to different scenes
  • 64+ Chasing IC+RGB & W Effect: The independent control design of IC+RGB and white all-in-one multifunctional rgbw led bar lights monitor backlight allows you to easily switch the led lights for desk between IC+RGB and white to enjoy a variety of lighting effects, you can choose white lighting mode with high brightness for better illumination when working, etc. Choose IC+RGB lighting mode when you need to create an entertaining atmosphere for the light show, 16 million colours of Color changing rgb light bar let you dance to the beat and create a dynamic party atmosphere
  • Dynamic and Dimmable Lights: 1%-full brightness free brightness adjustment gives you the flexibility to adjust dimmable led light bar for room decorations or a variety of occasions
  • USB Powered: USB light bars for room can be powered by powernank, usb charger, TV, Monitor, laptop PC mainframe, making behind TV led lighting bar easy to install in any location.TV led lights are powered by the TV usb interface / PC mainframe, can be turned on/off synchronously with TV / PC

Install one persistent WordPress object-cache implementation

Memcached becomes useful to WordPress only when a compatible persistent object-cache implementation is installed. That implementation supplies wp-content/object-cache.php, the drop-in that WordPress loads instead of its request-only default.

Compare the available installation approaches

Concern Manual drop-in approach Maintained dashboard installer
Extension compatibility Read the drop-in documentation carefully; some packages name PECL memcache, while Ubuntu’s current package is memcached. Use its readiness check to confirm the class and extension it expects.
Installation method Copy the implementation’s object-cache.php into wp-content and apply its documented configuration. Install and activate the plugin, choose automatic discovery or save the Memcached host and port, and let it create the drop-in.
Host and port Set the endpoint in the implementation’s documented configuration; the usual local default is 127.0.0.1:11211. Enter or confirm the host and port in the installer’s settings.
Existing drop-in handling You must inspect and replace a stale file yourself. A readiness check can refuse activation when a foreign object-cache.php already exists.
Multisite and key isolation Configure a unique WP_CACHE_KEY_SALT when sites share one daemon, if the implementation supports it. Check the installer’s documented multisite and key-salt behavior before enabling it network-wide.
Observability and fallback Use the implementation’s own diagnostics; fallback behavior is implementation-specific. Use its readiness and status screens; do not assume a failed cache connection has the same fallback behavior as another implementation.

Manual drop-in installation

  1. Choose an implementation whose documented extension requirement matches the module loaded by the web PHP runtime.
  2. Obtain its object-cache.php file using the implementation’s documented release method.
  3. Back up any existing wp-content/object-cache.php before replacing it. There must be one owner, not two competing drop-ins.
  4. Copy the selected file into the site’s wp-content directory and set the endpoint according to that implementation’s instructions. For a same-host daemon, use 127.0.0.1 and port 11211 unless you intentionally changed the daemon configuration.
  5. Load WordPress and inspect the implementation’s status output. Resolve extension or connection errors before treating the cache as active.

One commonly documented drop-in identifies the PECL memcache extension in its requirements. If your server has only Ubuntu’s memcached extension, select a package explicitly compatible with Memcached instead of assuming that similarly named software is interchangeable.

Dashboard installer installation

A maintained installer can perform readiness checks, discover a local daemon automatically, or let you save a host and port. Activate it only when its check confirms the required PHP class and a reachable service. If it reports that another wp-content/object-cache.php exists, stop and inspect that file. Remove or archive the stale implementation before trying again; never overwrite an unknown drop-in blindly.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Separate keys when services are shared

If several WordPress sites use the same Memcached daemon, configure a unique WP_CACHE_KEY_SALT for each site when the selected implementation supports it. Without distinct prefixes, unrelated sites can address the same keys and return each other’s cached values. A salt is an isolation measure; it does not replace authentication, firewall rules, or private networking.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Verify all four layers end to end

1. Verify the daemon

Confirm that systemctl status memcached reports a running service and that ss -ltnp shows the expected listen address and port. A daemon that is installed but stopped, bound to another interface, or blocked by a firewall cannot serve WordPress.

Best Value
Sale
HUANUO FlowLift™ Dual Monitor Stand, Fully Adjustable Gaming Monitor Desk Mount for 13–32″ Computer Screens, Full Motion VESA 75x75/100x100 with C-Clamp & Grommet Base, Each Arm Holds 4.4 to 19.8 lbs
  • Compatible with Wide Screens - To ensure compatibility with the dual monitor mount, your each monitor must meet three conditions at the same time: First, computer screens size range: 13 to 32 inches. Second, screen weight range: 4.4 to 19.8 lbs. Third, the back of the monitor screen must have VESA mounting holes with a pitch of 75x75mm or 100x100mm.
  • Regarding the compatibility with desks - Your desk must meet three conditions at the same time: First, desk material: Only wooden desks are recommended, plastic or glass desks cannot be used. Second, desk thickness range: 0.59" - 3.54". Third, the bottom of the desk should not have any cross beams or panels, as this will interfere with installation. We recommend carefully checking that your desk and monitors meets all above conditions before purchasing.
  • Dual C-Clamp Hold - Worried your dual monitors might wobble or slip? Our upgraded base uses a larger platform plus a dual C-clamp structure to lock the dual monitor arm firmly to your desk. Each arm safely keeps your screens steady while you type, click and game—no shaking, no sliding, just a clean and secure setup you can trust every day. It also provides Grommet Mounting installation choice, both options ensure stable and secure fixation for your 0.59" - 3.54" desk.
  • Full-Motion Adjustment For Comfortable View - Pull the screen closer when you’re deep in a spreadsheet, push it back to watch videos, or rotate to portrait for coding — moving everything smoothly with just one hand. The monitor stand offers +85°/-50° tilt, ±90° swivel and 360° rotation. Raise your monitor up to 15.75″ to support a healthy sitting posture. Whether you’re working from home, gaming through the night, or switching between video calls and documents, getting the screens to your natural line of sight helps relieve neck, shoulder and back strain so you can stay focused longer with less fatigue.
  • Keep Your Desk Organized: By lifting both screens off the desktop, this dual monitor stand opens up valuable space for your keyboard, notebook, docking station or a simple, clutter-free work area. Built-in cable management guides wires along the arms, keeping cords out of sight and out of the way. Enjoy a tidy, modern workstation that looks as good as it feels to use.

2. Verify the web PHP extension

Use the PHP runtime serving browser requests or PHP-FPM, not only CLI output. The required class must be present: a drop-in written for Memcached needs the memcached module, while one written for Memcache needs the legacy module. Restart the correct handler after any package change.

3. Verify drop-in ownership

List the file in wp-content and identify which implementation supplied it. There should be exactly one active object-cache.php. A plugin can be installed and activated while an older file remains in place, leaving WordPress to load the older code instead.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

4. Verify WordPress’s reported status

Open the selected implementation’s status or diagnostics page and check that it reports a persistent object cache, the intended host and port, and a successful connection. If WordPress reports only its default in-memory object cache, the drop-in is absent, incompatible, unreadable, or not being loaded. Do not judge success by the presence of the daemon alone: Memcached documentation explicitly notes that installing the service does not automatically cache application data; the application must be programmed to use it.

Troubleshoot common failures

“Class Memcached not found” or “PHP extension missing”

  • Check the PHP version used by the web request or FPM pool.
  • Install the matching php-memcached or release-specific package.
  • Restart that exact PHP-FPM or Apache handler.
  • Recheck the module through the web runtime, not only php -m in a shell.
  • Confirm that the drop-in’s requirement is Memcached rather than Memcache, or install a different compatible implementation.

Connection refused or timed out

  • Run systemctl status memcached and start the service if necessary.
  • Use ss -ltnp | grep 11211 to confirm the daemon is listening on the configured address.
  • Compare the drop-in’s host and port with the daemon’s actual bind address.
  • For a remote endpoint, check firewall rules, private-network routes, and the policy permitting the web server’s source address.
  • Prefer localhost for a same-host WordPress installation and remove unnecessary public exposure.

An installer says another drop-in exists

Inspect wp-content/object-cache.php, record which implementation owns it, and decide which single implementation you intend to keep. Deactivate or remove the stale/conflicting file according to its documentation, then run the new installer again. Do not leave two drop-ins in different plugin directories expecting WordPress to merge them; WordPress loads the file at the canonical path.

There is no measurable performance change

  • Confirm WordPress reports a persistent object cache rather than only a request-scoped cache.
  • Check that the active file is the drop-in you configured, not an older file.
  • Confirm the web PHP extension and endpoint are correct.
  • Remember that Memcached caches objects selected by the application; installing the daemon does not automatically cache pages or database queries.

Sites appear to share unexpected data

When multiple sites share one daemon, assign a different WP_CACHE_KEY_SALT to each site if supported by the implementation. Then flush or invalidate the old keys using the implementation’s documented method so values created under the previous namespace cannot be mistaken for current data.

Permissions, upgrades, and operational safety

WordPress must be able to read the drop-in, while the PHP process must be able to read any configuration it references. Follow the site’s existing ownership model rather than making the entire installation world-writable. Ubuntu’s WordPress guidance discusses restrictive wp-config.php permissions for hardened deployments; adapt those permissions to the account used by your PHP-FPM pool and deployment process.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

After Ubuntu or PHP upgrades, repeat the web-runtime check. A new PHP-FPM version may require a new release-specific extension package, and restarting only the old service will not load the module into the new pool. Also recheck the drop-in after plugin updates: the file can be replaced, removed, or blocked by another object-cache plugin. Keep the daemon private, monitor its service state, and treat cache loss as recoverable application behavior rather than persistent storage.

Final installation checklist

  • Ubuntu release and the web-serving PHP version are identified.
  • memcached is installed from Ubuntu’s repository, enabled, running, and listening on the intended private address.
  • The matching memcached PHP extension is installed for that PHP version and visible to the web runtime.
  • One compatible persistent object-cache implementation owns wp-content/object-cache.php.
  • The configured endpoint is correct; the local default is 127.0.0.1:11211.
  • Shared daemons use distinct key salts where supported.
  • WordPress or the implementation reports a persistent object cache, and no connection or extension errors remain.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More quests from Patch Notes

  1. How to Set Up a RedM (RDR2) Server in 2026: License Key, txAdmin and server.cfg, Step by StepBlog11min
  2. Best RedM (RDR2) Server Hosting in 2026: Comparing Four Hosts on Slots, Memory and PriceBlog10min
  3. How to Host a Mindustry Server in 2026: server-release.jar, Port 6567 and the Commands That MatterBlog7min
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.