Php

在 Windows 上使用 PHP 連接到 memcached

  • April 29, 2020

我有一個 memcached 伺服器(在 AWS ElastiCache 上),需要在 Windows 上使用 PHP(IIS 不是 WAMP)連接到它。

這可能嗎?

我發現php_memcache.dll了,但這似乎不適用於 memcached。我想我需要php_memcached.dll

這是否存在,我在哪裡可以找到它?

PHP有兩個主要的memcached客戶端, memcachememcached您可以在此處查看兩個版本的比較。最大的區別可能是 memcached 擴展對libmemcached的依賴。這為 memcached 客戶端提供了許多附加功能。不過,在我的搜尋中,我一直無法為 memcached 客戶端庫找到工作的 dll。這意味著 memcache 庫基本上是您在 Windows 上的唯一選擇,除非您想嘗試自己編譯它(基於缺少可用的 dll 這可能非常困難)或使用像xslib-memcached這樣的純 PHP 庫,但是您可能會發現對 memcache 客戶端的更多支持。

我沒有嘗試在 IIS 上使用 memcache 客戶端,但我已經在連接到本地 memcached 伺服器的 Windows 7(32 位和 64 位 Windows 上的 32 位建構)上將它與 Apache 一起使用,所以我知道那裡正在建構此客戶端。

如果你在 AWS 上執行,你真的應該考慮使用 Linux。它比執行 Windows 實例便宜得多,並且可能會比 Windows 上的 IIS 更好地執行 PHP。

引用自:https://serverfault.com/questions/403514