HOW TO: Install Memcache on XAMPP (Windows 7/8/10)
Here are the steps that should be followed when you install memcache.
- Start your xampp.
- 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
- 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!).
- 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
- 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.
Restart Xampp Apache
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 LinkMSVCP71.DLL
Windows DLL Filesfrom Microsoftmsvcr71.dll
php_memcache.dll
Working memcache for PHP 5.3.4 OR [REF]
5
Steps
- Copy
MSVCP71.DLL
,msvcr71.dll
toC:\windows\sysWOW64
- Copy
memcached.exe
intoC:\memcached
- Click Windows-Key
- Type: CMD
- press: Ctrl-Shift-Enter
- Choose
yes
- type:
C:\memcached\memcached.exe -d install
- type:
C:\memcached\memcached.exe -d start
- Copy
php_memcache.dll
toC:\wamp\bin\php\php5.3.4\ext
- Restart Apache using Wamp controls
- 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
Do I Need to Escape Backslashes in PHP
Download of .Zip File Runs a Corrupted File PHP
Why Do I Get "Resource Id #4" When I Apply Print_R() to an Array in PHP
Programmatically Determine Whether to Describe an Object with "A" or "An"
Why Preg_Replace Throws Me a "Unknown Modifier" Error
PHP Timezone Database Is Corrupt Error
How to Read a .Txt File with PHP
How to Set Short Tag(<) in PHP
Pdo and MySQL Fulltext Searches
Php: Determine Where Function Was Called From
How to Log in to PHPmyadmin with Wamp, What Is the Username and Password
How to Implement a Chat Room Using Jquery/Php
How to Display the Users Profile Pic Using the Facebook Graph API