Home php教程 php手册 windows下安装php的memcache模块的方法

windows下安装php的memcache模块的方法

Jun 06, 2016 pm 08:05 PM
windows

这篇文章主要介绍了windows下安装php_memcache模块的方法,十分详细,也非常简单,这里推荐给有需要的小伙伴参考下

要求必备知识

熟悉基本编程环境搭建。

运行环境

windows 7(64位);
php-5.3;
memcached-1.2.6

下载地址

环境下载

什么是PHP Memcache模块

Memcache模块提供了于memcached方便的面向过程及面向对象的接口,memcached是为了降低动态web应用 从数据库加载数据而产生的一种常驻进程缓存产品。

下载memcache官网PHP Memcache下载地址

这里需要注意一下版本号,根据个人情况而定,我下的是php_memcache-3.0.8-5.3-ts-vc9-x86.zip

windows下安装php的memcache模块的方法

用phpinfo()函数查看当前PHP版本的信息

安装扩展

将下载下来的压缩包解压,然后将 php_memcache.dll模块拷贝到PHP的ext文件夹内。

修改php.ini文件

引入如下代码

测试

重启web服务器。

windows下安装php的memcache模块的方法

在memcache.php文件中输入如下代码:

connect('127.0.0.1',11211); $memcache->set('key','hello memcache!'); $out = $memcache->get('key'); echo $out; ?>

在浏览器中进行测试,这里需要注意的是memcache服务必需在启动状态下哦。关于memcache服务在windows平台的安装,可以参考我之前写的一篇文章哦。

Memcache for Windows

如以上文章或链接对你有帮助的话,别忘了在文章结尾处轻轻点击一下 “还不错”按钮或到页面右下角点击 “赞一个” 按钮哦。你也可以点击页面右边“分享”悬浮按钮哦,让更多的人阅读这篇文章。

由于本人水平有限,文章在表述和代码方面如有不妥之处,欢迎批评指正。留下你的脚印,欢迎评论哦。

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What should I do if I can't delete a Windows system dll file? Tips for completely deleting stubborn dll files What should I do if I can't delete a Windows system dll file? Tips for completely deleting stubborn dll files Jun 12, 2024 pm 02:46 PM

What should I do if I can't delete a Windows system dll file? Tips for completely deleting stubborn dll files

Lossless Scaling on Steam Deck OLED runs games at up to 2x FPS Lossless Scaling on Steam Deck OLED runs games at up to 2x FPS Aug 26, 2024 am 10:07 AM

Lossless Scaling on Steam Deck OLED runs games at up to 2x FPS

How to turn off Security Center in Windows 11 How to turn off Security Center in Windows 11 Mar 28, 2024 am 10:21 AM

How to turn off Security Center in Windows 11

Windows 10 vs. Windows 11 performance comparison: Which one is better? Windows 10 vs. Windows 11 performance comparison: Which one is better? Mar 28, 2024 am 09:00 AM

Windows 10 vs. Windows 11 performance comparison: Which one is better?

How to update the latest version of Bybit Exchange? Will there be any impact if it is not updated? How to update the latest version of Bybit Exchange? Will there be any impact if it is not updated? Feb 21, 2025 pm 10:54 PM

How to update the latest version of Bybit Exchange? Will there be any impact if it is not updated?

deepseek web version entrance deepseek official website entrance deepseek web version entrance deepseek official website entrance Feb 19, 2025 pm 04:54 PM

deepseek web version entrance deepseek official website entrance

How to install deepseek How to install deepseek Feb 19, 2025 pm 05:48 PM

How to install deepseek

Pi Node Teaching: What is a Pi Node? How to install and set up Pi Node? Pi Node Teaching: What is a Pi Node? How to install and set up Pi Node? Mar 05, 2025 pm 05:57 PM

Pi Node Teaching: What is a Pi Node? How to install and set up Pi Node?

See all articles