设为首页 收藏本站
查看: 1054|回复: 0

win7+php5.3.10下安装memcache

[复制链接]

尚未签到

发表于 2015-5-15 06:24:30 | 显示全部楼层 |阅读模式
  因为升级到了5.3.10,所以之前的dll不能使用了,弄了好久,终于还是在老外的博客上找到了解决方法:
  (环境是win7+php5.3.10+win32)
  1、解压附件memcached到某个目录,本例中解压在F:\
  2、解压附件中的memcached-win32-1.4.4-14.zip
  3、进入cmd,输入:
  F:\memcached\memcached-win32-1.4.4-14\memcached.exe -d install
  回车
  F:\memcached\memcached-win32-1.4.4-14\memcached.exe -d start
  4、解压php_memcache-php-5.3.10.0-r2-win32-vc9-standard.zip,并且复制到php5.3.10\ext中(假设你使用的是WAMP集成环境,应该就是 \wamp\bin\php\php5.3.10\ext)
  5、在php.ini中添加一行:”extension=php_memcache.dll
  6、重启apache,打开phpinfo就看到memcache了!
  测试代码如下:
  
  
  以下是该老外的博客原文:
  After spending so much time trying to locate the information on the net i thought i'd share all the details on how to successfully run memcached on windows. As the information on the net changes from day to day i will be making available all the files in zip format at the end of this tutorial as they just work.
DSC0000.jpg
First you need the software the latest ones can be found here or download the file at the bottom of this tutorial.
Memcached : http://blog.couchbase.com/memcached-144-windows-32-bit-binary-now-available
PHP Memcached interface : http://livebookmark.net/journal/2008/05/21/memcachephp-stats-like-apcphp/
Memcached
Create a directory in the root of your hard drive as follows C:\memcached\ and place the file from the zip in it.
Open up a command prompt and navigate to the location of the files by typing in CD \memcached
To install as a service type in memcached -d install
To start the service type in memcached -d start
Other usefull information regarding memcached.
To stop the service type in memcached -d stop
To uninstall the service type in memcached -d uninstall
To set memory limit (Default is 64MB) type in while memcache is running memcached -m 2048 this makes 2GB of cache avaiable.
While running memcache as a service your be unable to add the -m 2048 on the service start up.
Control Panel -> Administrative tools -> Services
DSC0001.jpg
To add the extra memory allocation your need to edit the registry to add the information.
Run -> Regedit
HKEY_LOCAL_MACHINE -> SYSTEM -> CURRENTCONTROLSET -> SERVICES -> MEMCACHED
Add -m 2048 (The value i'm using is 2GB but pick what you wish to allocate) on the end of the imagepath.
DSC0002.jpg
If you now go back to the service section you should now see .
DSC0003.jpg
If your not seeing this result a computer restart is required. You now have memcached running.
PHP Memcached interface
Unzip and place memcache.php on your server were your site files are located.
Other usefull information regarding PHP Memcached interface.
To access the interface your be asked for username and password details these are as follows.
Username : memcache
Password : password
If you edit the file in notepad you can change the password details on lines 21 -> 22.




PHP:

define('ADMIN_USERNAME','memcache');    // Admin Username
define('ADMIN_PASSWORD','password');      // Admin Password    
If you don't wish to have a password comment out lines 35 -> 45 by placing // at the front of each line.




PHP:

//if (!isset($_SERVER['PHP_AUTH_USER']) || !isset($_SERVER['PHP_AUTH_PW']) ||
//          $_SERVER['PHP_AUTH_USER'] != ADMIN_USERNAME ||$_SERVER['PHP_AUTH_PW'] != ADMIN_PASSWORD) {
//            Header("WWW-Authenticate: Basic realm=\"Memcache Login\"");
//            Header("HTTP/1.0 401 Unauthorized");
//
//            echo

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-67022-1-1.html 上篇帖子: win7 上安装 vs2008和打VS2008 SP1补丁的痛苦经历 下篇帖子: PLSQL在64位 win7/WIN8上运行(绿色版plsql、无需安装oracle客户端)
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表