php---window 7 配置memcached并测试成功
来源:互联网 发布:淘宝店怎么玩 编辑:程序博客网 时间:2024/06/06 18:57
原作者链接:http://my.oschina.net/zhangdapeng89/blog/49172
Updated: December 28, 2010
First off, all credits go to this guy. I’m just listing the steps on how I did it in Windows 7 with PHP 5.3. Also, I tested this using WampServer but I believe it should work on any PHP install.
Install memcached
- Download the Memcached Win32 library here: http://code.jellycan.com/memcached. Just get the Win32 binary (direct link). Extract the downloaded archive file in a directory (e.g.
c:\memcached
). There should be amemcached.exe
in there. - Run a command prompt as an administrator. Some info on how to do that here.
Install memcached as a service. Go to the memcached directory, type and run:
memcached -d install
If you get an error saying “MSVCP71.dll is missing”, see this page for a solution.
Start the memcached service by running:
memcached -d start
You can verify if memcached is running by executing this in the command line:
wmic process get description, executablepath | findstr memcached.exe
You should see a result list showing memcached.exe and its full path.
Install PHP Memcache extension (php_memcache.dll)
- Chances are you don’t have
php_memcache.dll
in your PHP extensions yet.You can download a build of it here.Basu has noted in the comments that VC6 builds are no longer available from that link. You can download the correct build here. - The archive should contain
php_memcache.dll
. Extract the archive to your php extensions directory. On my system (WampServer), this wasC:\wamp\bin\php\php5.3.0\ext
. Edit
php.ini
, add this line to enable the extension:extension=php_memcache.dll
Or if you’re using WampServer, restart it and enable the extension through the WampServer system tray menu.
Test
Test the installation using the sample PHP code here: http://www.php.net/manual/en/memcache.examples-overview.php.
如果没有文件查不到的可以跟我要,呵呵
参考资料:http://pureform.wordpress.com/2008/01/10/installing-memcache-on-windows-for-php/
http://shikii.net/blog/installing-memcached-for-php-5-3-on-windows-7/
01
$memcache
=
new
Memcache;
02
$memcache
->connect(
'localhost'
,11211);
03
$version
=
$memcache
->getversion();
04
echo
"Server's version: "
.
$version
;
05
06
$tmp_object
=
new
stdClass();
07
$tmp_object
->str_attr =
'test'
;
08
$tmp_object
->int_attr = 123;
09
10
$memcache
->set(
'key'
,
$tmp_object
,false,10)
or
die
(
'faild to save data at the server'
);
11
echo
"Store data in the cache (data will expire in 10 seconds)<br />\n"
;
12
13
$get_result
=
$memcache
->get(
'key'
);
14
echo
"Data from the cache:<br />\n"
;
15
16
var_dump(
$get_result
);
17
18
print_r(
$get_result
);
- php---window 7 配置memcached并测试成功
- centos6安装memcached,并配置php扩展
- memcached测试是否成功
- 安装并测试memcached
- WIN7下安装和配置JDK1.7并成功测试的过程
- PHP+memcached配置
- PHP+memcached配置
- PHP Memcached 配置
- PHP配置Memcached
- Window下安装MongoDB环境,并配置PHP链接MongoDB
- Nginx+Tomcat+Memcached集群 【测试成功】
- Window下memcached安装与测试
- memcached window版 下载安装,简单测试
- Window下memcached安装与测试步骤
- windows下 php memcached安装成功
- memcached mysql php 测试例子
- window环境下,php环境拓展memcached
- window下安装php memcached扩展
- Java Vector ArrayList LinkedList 区别
- VS2010编译时 mt.exe出错解决方法
- eclipse 的一些使用心得
- Insert 'value' into every element but the first
- helloworld对应的汇编
- php---window 7 配置memcached并测试成功
- c ip2long
- 如何做好软件系统的架构设计?
- Delphi 读写XML文件方式
- HTML and URL Parser
- String和StringBuffer的区别
- linux sed 批量替换字符串
- SQL Server 2008 R2 数据库之间的数据同步热备份
- Visual Studio安装卸载模板