How to Enable Memcached on Your KamHost Hosting Plan

KamHost – Best Web Hosting: Fast, Reliable & Affordable Solutions - Visit: https://kamhost.com

Before you can use Memcached, your KamHost hosting plan must have Memcached instances available. Here’s how to get started.

Step 1: Enable the PHP Memcached Extension

If you’re using PHP, you’ll need to enable the memcached extension:

  1. Log in to your hosting control panel.
  2. Navigate to Advanced → PHP Settings.
  3. Click Edit php.ini.
  4. Find the memcached option and set it to On.
  5. Save your changes.

Note: If you don’t see the memcached option, contact your hosting provider – it may not be available on your current plan.

Step 2: Create a Memcached Instance

Your hosting plan must have at least one Memcached instance available. Here’s how to create one:

  1. In your KamHost hosting control panel, go to Advanced → Memcached.
  2. Click the CREATE INSTANCE button.
  3. Configure the instance settings:
    • Status: Set to Active
    • Memory: Select the desired memory allocation
  4. Click the Add button to create the instance.

Note: Each instance comes with 16 MB of memory by default. You can select a higher amount if available on your plan.

Step 3: Connect Your Application to Memcached

Many applications require a host and port to connect to Memcached. On our system, Memcached uses a Unix socket instead of a TCP port.

Use the following settings:

SettingValue
Memcached Hostname (IP)unix:///home/sys/memcached.sock
Memcached Port0

Example (PHP):

php

$memcached->addServer('unix:///home/sys/memcached.sock', 0);

Important: Check with your hosting provider to confirm whether your system uses a Unix socket or TCP/IP, as the format varies between hosting environments.

Frequently Asked Questions

Why does Memcached use a socket instead of a port?

Our system uses Unix sockets for Memcached because they offer better performance and security compared to TCP/IP connections. Sockets are faster because they don’t require network overhead.

How much memory does each Memcached instance provide?

Each instance provides 16 MB of memory. You can purchase multiple instances if you need more caching capacity.

What happens if I run out of Memcached memory?

When memory is full, Memcached automatically removes the oldest or least-used data (LRU eviction) to make room for new data. If you need more capacity, you can add additional instances.

Can I use Memcached with other programming languages?

Yes. While we used PHP examples in this guide, Memcached supports virtually every programming language, including Python, Java, Ruby, Node.js, and more.

Troubleshooting

IssueSolution
Memcached option not showingThe PHP extension isn’t enabled. Go back to Step 1 and enable memcached.
Application can’t connectConfirm you’re using the correct socket path: unix:///home/sys/memcached.sock
Connection refused errorThe Memcached service may not be running. Contact support for assistance.
No caching benefitYour application must be configured to use Memcached. Check your application’s caching settings.

Need Help?

 If you have questions about enabling Memcached on your hosting plan, our support team is here to help. Submit a ticket under Help Center → My Tickets in your hosting control panel, and we’ll get back to you promptly.

Leave a Comment

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

Scroll to Top