我已经在 ubuntu 16 中使用 PHP-7 和 MySQL 安装了 memcached,我的 Web 应用程序位于 Windows 中,其中我使用 PHP-5 安装了 xampp。
我想通过 Windows 中的 Web 应用程序使用 ubuntu 中安装的 memcached。
可能吗?
最佳答案
您需要使用 addServer
方法将服务器添加到 memcached 服务器池。
<?php
$m = new Memcached();
$m->addServer('UBUNTU_SERVER_IP', 11211);
?>
更多信息请查看Memcached::addServer关于 PHP 手册
关于php - 如何在php中使用memcached(安装在不同的服务器上),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40276927/