Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
875 views
in Technique[技术] by (71.8m points)

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

I am doing a project on Laravel. I'm trying to make a simple system that uses cache focused on memcache. When I started studying, I checked Laravel site first and then I found that using the Memcached cache requires the Memcached PECL package to be installed.

I searched through it and I got some problems during installation.

How to install memcache?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

3. download the file php_memecache.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 xamppphpext, in my case it is F:xamppphpext (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 installing 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:Windowssystem32> net start “memcached”

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

    C:Windowssystem32> net stop “memcached”

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...