How To: Install Memcache on Xampp (Windows 7/8/10)

HOW TO: Install Memcache on XAMPP (Windows 7/8/10)

Here are the steps that should be followed when you install memcache.

  1. Start your xampp.
  2. Click on 'config' and open php.ini file.

search for

;extension=php_memcache.dll

If not found add

extension=php_memcache.dll
[Memcache]
memcache.allow_failover = 1
memcache.max_failover_attempts=20
memcache.chunk_size =8192
memcache.default_port = 11211

  1. Download the file php_memcache.dll from windows.php.net
    (make sure to check your php version and php_memcache.dll are same. Otherwise, it will through error.)

unzip it and paste '.dll' file in the path xampp\php\ext, in my case it is F:\xampp\php\ext (I had to rename the file to memcache.dll but when you take a look on other sites that describes the steps for this, they don't tell to rename, but I have done this in my project!).


  1. Download and install Memcache server for windows

Download the Memcache.exe from jellycan

After completion of download, unzip and put the memcache.exe file into any desired directory of your choice (e.g. C:/memcached/). make sure folder name should be memcached


  1. Open the cmd prompt with “Run as Administrator” and execute the line to install

c:/memcached/memcached.exe -d install

then type

net start "memcached server"

In case you get memcache is already installed. then just go through line net start "memcached server".

Or

For the installation purpose you can go to the path where you have copied the memcache.exe. and double click to the file, memcache is installed, now just add line net start "memcached server" and your memcache is enabled.


  1. Restart Xampp Apache

  2. Restart Memcached:

    C:\Windows\system32> net start “memcached”

    The memcached service is starting.
    The memcached service was started successfully.

    C:\Windows\system32> net stop “memcached”

    The memcached service is stopping.
    The memcached service was stopped successfully.

How to enable memcache in WAMP

Here are the steps that worked for me:

Needed Files

  • memcached.exe Direct Link
  • MSVCP71.DLL Windows DLL Files from Microsoft
  • msvcr71.dll
  • php_memcache.dll Working memcache for PHP 5.3.4 OR [REF]
    5

Steps

  1. Copy MSVCP71.DLL, msvcr71.dll to C:\windows\sysWOW64
  2. Copy memcached.exe into C:\memcached
  3. Click Windows-Key
  4. Type: CMD
  5. press: Ctrl-Shift-Enter
  6. Choose yes
  7. type: C:\memcached\memcached.exe -d install
  8. type: C:\memcached\memcached.exe -d start
  9. Copy php_memcache.dll to C:\wamp\bin\php\php5.3.4\ext
  10. Restart Apache using Wamp controls
  11. Enable WAMP -> PHP -> PHP Extensions -> php_memcache

Memcached implementation in php rise error

Probably you haven't installed memcached on your pc that's why you are getting error.

Please check following post:

HOW TO: Install Memcache on XAMPP (Windows 7/8/10)

PECL install with --configureoptions not working - Memcache

A quick fix for this (found via https://bugs.php.net/bug.php?id=56522) is to use the PHP_ZLIB_DIR variable instead of --with-zlib-dir.

i.e. PHP_ZLIB_DIR=/usr/local/Cellar/zlib/1.2.11 pecl install memcache

I've struggled with the -D option before as well - near as I can tell it's completely broken.

Configuring memcached using Docker with php7.4

your question is not clear but i am sharing some details. I hope it will work for you. the file name must be Dockerfile and add the following code to it.

RUN apt-get update && apt-get install -y libmemcached11 libmemcachedutil2 build- 
essential libmemcached-dev libz-dev
RUN pecl install memcached-2.2.0
RUN echo extension=memcached.so >> /usr/local/etc/php/conf.d/memcached.ini

after that run the build
OR
you are using xampp please fellow the HOW TO: Install Memcache on XAMPP (Windows 7/8/10)

Has anyone got memcached to work on Laravel Homestead php7 box?

The work on php-memcached for PHP7 is not yet complete, not all tests pass; You can use everything but JSON serialization, I think.

There is no pecl support for PHP7, so right now you need to install extensions manually, like this:

git clone https://github.com/php-memcached-dev/php-memcached
cd php-memcached
git checkout php7
phpize
./configure
make
sudo make install

You must make sure that phpize is the PHP7 version. Additionally, if the php in your PATH is not PHP7, then the php-config in your PATH is not either, in this case you must pass --with-php-config=/absolute/path/to/php7-config to ./configure.



Related Topics



Leave a reply



Submit