gpt4 book ai didi

php - 如何在php中使用memcached(安装在不同的服务器上)

转载 作者:行者123 更新时间:2023-11-29 20:08:00 24 4
gpt4 key购买 nike

我已经在 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com