如何检查是否为 PHP 安装了 memcache 或 memcached? [英] How to check if memcache or memcached is installed for PHP?

查看:35
本文介绍了如何检查是否为 PHP 安装了 memcache 或 memcached?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何测试 memcachememcached(用于 PHP)安装在我的 Apache 网络服务器上?

How do I test if memcache or memcached (for PHP) is installed on my Apache webserver?

Memcache 是一个缓存守护进程,专为动态 Web 应用程序以减少数据库负载将对象存储在内存中.

Memcache is a caching daemon designed especially for dynamic web applications to decrease database load by storing objects in memory.

推荐答案

你可以查看 phpinfo() 或者查看 memcache 的任何功能是否可用.最后,检查 Memcache 类是否存在.

You can look at phpinfo() or check if any of the functions of memcache is available. Ultimately, check whether the Memcache class exists or not.

例如

if(class_exists('Memcache')){
  // Memcache is enabled.
}

这篇关于如何检查是否为 PHP 安装了 memcache 或 memcached?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆