Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8772585
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T18:04:11+00:00 2026-06-13T18:04:11+00:00

I have just had memcache installed on my server. I have started the server

  • 0

I have just had memcache installed on my server. I have started the server and i am now trying to connect to it via php

The server host installed the memcached extension and not the memcache extension.

So I found the examples of memcache and thought the two extensions would be similar which does not appear to be the case.

So what I am trying to get is a simple example of actually getting memcache working with the memcached extension.

for example, I want to connect to memcache, what is the code to connect to it?

memcache would be :

$memcache = new Memcache;
$memcache->connect('localhost', 11211);

but this does not work as there is no “connect”, so how do i tell php to connect to memcache?

I have seen the “addServer” function , do I need to run that once in order for memcache to know it is there?

is it a case that once a server is added, memcached just knows its there and therefore there is no need for a “connect” call? or do i have to use the addServer function on every call?

Thanks for your help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T18:04:12+00:00Added an answer on June 13, 2026 at 6:04 pm

    The docs for the memcached extension is useful. In particular, memcached will create the connection when needed, and will use the servers you’ve added by calling addServer or addServers.

    From the manual page for Memcached::set:

    $m = new Memcached();
    $m->addServer('localhost', 11211);
    
    $m->set('int', 99);
    

    The connection will be handled internally by the memcached library when you call set.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've had these RSS feeds running for some time and have just now run
I just had one doubt: I have a form where I do server side
I have just started a new project and having had previous happy times with
I have just had to use LINQ to SQL on an SQL Server 2000
I have just had a scheduled SQL Server job run for longer than normal,
Since I have just started working with Facebook's api I had a few questions
I have just started learning java. I downloaded eclipse for linux and had an
I have just upgraded from php 5.1 to 5.3 and had previously been using
I had really a simple site written in PHP that I have just rewritten
I have just had a brain block, I have a Deck object and want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.