php 如何:在 XAMPP 上安装 Memcache (Windows 7/8/10)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/34173231/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 23:48:07  来源:igfitidea点击:

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

phplaravel-5memcached

提问by Shweta

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.

我正在 Laravel 上做一个项目。我正在尝试制作一个简单的系统,该系统使用专注于 memcache 的缓存。刚开始学习的时候,先查看了Laravel站点,发现使用Memcached缓存需要安装Memcached PECL包。

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

我搜索了它,在安装过程中遇到了一些问题。

How to install memcache?

如何安装memcache

回答by Shweta

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

以下是安装 memcache 时应遵循的步骤。

  1. start your xampp.
  2. click on 'config' and open php.ini file.
  1. 启动你的 xampp。
  2. 单击“配置”并打开 php.ini 文件。

search for

搜索

;extension=php_memcache.dll

;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.dllfrom windows.php.net(make sure to check your php version and php_memcache.dll are same. Otherwise, it will through error.)

3.php_memecache.dllwindows.php.net下载文件 (一定要检查你的php版本和php_memcache.dll是否一致,否则会报错。

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.dllbut 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!).

解压并将“.dll”文件粘贴到路径xampp\php\ext 中,在我的例子中它是F:\xampp\php\ext(我不得不将文件重命名为memcache.dll但是当你查看其他描述此步骤的网站,他们没有告诉重命名,但我已经在我的项目中完成了这个!)。

  1. Download and installing Memcache server for windows
  1. 下载并安装 Windows 版 Memcache 服务器

Download the Memcache.exefrom jellycan

jellycan下载Memcache.exe

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

下载完成后,解压memcache.exe文件并将其放入您选择的任何所需目录(例如 C:/memcached/)。确保文件夹名称应为memcached

  1. Open the cmd promptwith “Run as Administrator”and execute the line to install
  1. 使用“以管理员身份运行”打开cmd 提示符并执行该行进行安装

c:/memcached/memcached.exe -d install

c:/memcached/memcached.exe -d install

then type

然后输入

net start "memcached server"

net start "memcached server"

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

如果您已经安装了 memcache。然后只需通过线路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.

出于安装目的,您可以转到复制memcache.exe的路径。并双击该文件,安装了内存缓存,现在只需添加行net start "memcached server"并启用内存缓存。

  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.

  1. 重启 Xampp Apache

  2. 重启 Memcached:

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

    memcached 服务正在启动。memcached 服务启动成功。

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

    memcached 服务正在停止。memcached 服务已成功停止。