适用于 Windows 上的 PHP7 的 Memcache?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/34952502/
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-09-08 19:26:11  来源:igfitidea点击:

Memcache for PHP7 on Windows?

windowsmemcachedphp-7

提问by Jens Kirk

Does any one know about a Memcache version that supports PHP7 on Windows?

有人知道在 Windows 上支持 PHP7 的 Memcache 版本吗?

Memcache is working great for PHP 5.6 (on Windows), but I cannot find the version for PHP7.

Memcache 适用于 PHP 5.6(在 Windows 上),但我找不到 PHP7 的版本。

回答by nono303

Please find php_memcache.dll for php7.0.x, php7.1.x, php7.2.xhttps://github.com/nono303/PHP7-memcache-dll

请为php7.0.x、php7.1.x、php7.2.x找到php_memcache.dll https://github.com/nono303/PHP7-memcache-dll

  • vc14& vc15
  • x86& x64
  • ts& nts
  • vc14& vc15
  • x86x64
  • ts& nts

回答by Matej Kolesár

  1. At first, check phpinfo(), example:
    • Compiler: MSVC14 (Visual C++ 2015)
    • Architecture: x64
    • PHP Extension Build: API20160303,NTS,VC14
  2. Based on information in phpinfo(); choose right dll:
  3. Copy to php_memcache.dll to \PHP\v7.1\ext
  4. Enable php_memcache in php.ini, add line:
    • extension=php_memcache.dll
  5. Check presentation of 'memcache' section in phpinfo();
  6. Check errors.log
  1. 首先,检查phpinfo(),例如:
    • 编译器:MSVC14 (Visual C++ 2015)
    • 架构:x64
    • PHP 扩展构建:API20160303、NTSVC14
  2. 基于 phpinfo() 中的信息;选择正确的dll:
  3. 复制到 php_memcache.dll 到 \PHP\v7.1\ext
  4. 在 php.ini 中启用 php_memcache,添加一行:
    • 扩展名=php_memcache.dll
  5. 检查 phpinfo() 中“memcache”部分的呈现;
  6. 检查错误日志

回答by supersan

Here is the dll you can use with your PHP7 Windows installation (64 bit)

这是您可以在 PHP7 Windows 安装(64 位)中使用的 dll

https://github.com/Alvine-IO/php7-windows/blob/master/x64/ts/dll/php_memcache.dll

https://github.com/Alvine-IO/php7-windows/blob/master/x64/ts/dll/php_memcache.dll

回答by Juris Vaiders

Just in case if anyone needs dll files - https://github.com/jur4x/PHP7-memcahe-dll. Compiled for PHP 7.0.6, both thread safe and non thread safe versions.

以防万一,如果有人需要 dll 文件 - https://github.com/jur4x/PHP7-memcahe-dll。为 PHP 7.0.6 编译,线程安全和非线程安全版本。

回答by Will

The new memcachedextension doesn't work on Windows because libmemcacheddoesn't work on Windows. However, someone seems to have gotten the old memcacheextension to install on Windows. I can't find a nice pre-compiled binary, but, after a lot of digging, I found a PHP Bug Reportabout this issue. Someone there seems to have found a solution:

memcached扩展在 Windows 上不起作用,因为在 Windows 上libmemcached不起作用。但是,似乎有人已经memcache在 Windows 上安装了旧扩展。我找不到一个很好的预编译二进制文件,但是,经过大量挖掘,我找到了有关此问题的PHP 错误报告。有人似乎找到了解决方案:

[2016-01-20 23:11 UTC] php at alternize dot com

the branch "NON_BLOCKING_IO_php7" of the git repository https://github.com/websupport-sk/pecl-memcache.gitbuilds fine against php 7.0.2 in win32 x86 thread-safe mode. i have not tested it with non-thread-safe and/or x64.

to build the php_memcache.dll, i followed the instructions on https://wiki.php.net/internals/windows/stepbystepbuild#building_pecl_extensionsusing:

[2016-01-20 23:11 UTC] php at alternize dot com

git 存储库https://github.com/websupport-sk/pecl-memcache.git的分支“NON_BLOCKING_IO_php7”在 win32 x86 线程安全模式下针对 php 7.0.2 构建良好。我还没有使用非线程安全和/或 x64 对其进行测试。

为了构建 php_memcache.dll,我按照https://wiki.php.net/internals/windows/stepbystepbuild#building_pecl_extensions上的说明使用:

C:\php-sdk\phpdev\vc14\x86\php-7.0.2-src>buildconf
C:\php-sdk\phpdev\vc14\x86\php-7.0.2-src>configure --disable-all 
  --enable-cli --enable-zlib --enable-hash --enable-session 
  --without-gd --with-bz2 --enable-memcache=shared
C:\php-sdk\phpdev\vc14\x86\php-7.0.2-src>nmake