注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

phperwuhan的博客

记载一个phper的历程!phperwuhan.blog.163.com

 
 
 

日志

 
 

How To Install PHP Memcache and APC Extensions FreeBSD  

2010-10-07 13:56:01|  分类: memcache |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

来源:http://www.wowtutorial.org/tutorial/73.html

What is Memcache ?

Memcached is a high-performance, distributed memory object caching system, generic in nature, but intended for use in speeding up dynamic web applications by alleviating database load.

What is APC ?

APC Cache (Eaccelerator and other similar caches) is Fast but it is not distributed so you’re wasting cache and reducing possible hit rate by caching things locally if you have many web servers. MemcacheD is relatively slow but distributed and so you do not waste memory by caching same item in a few places, it is also faster to warmup as you need only one access to bring item into the cache, not access for each of web servers.

The good thing however is you do not have to select one or another, you can use both at the same time. APC will be great for caching small but frequently accessed things which are not taking too much memory. For example if you store list of states in the database you can cache it this way. For NNSEEK we can use it to cache list of languages, top groups and much of semi-static modules shown on group directory pages. Memcached is good for caching things which take large amount of space combined and which you only need to fetch few per page. For example search results may be good candidate (assuming we want to cache them and want to cache them in memory).

Let's Start to install APC and Memcache PHP Extensions in FreeBSD server.

I assume you have FreeBSD server online with Webserver.
Login as root

Install PHP APC Extensions 

[code]$cd /usr/ports/www/pecl-APC
$make install clean[/code]

Install PHP Memcache Extensions 

[code]$cd /usr/ports/databases/pecl-memcache
$make install clean[/code]

If your server didn't shows any error, we can go ahead to restart the webserver.
just make sure apc.so and memcache.so is already load in your php extensions.

[code]$cd /usr/local/etc/php
$vi extensions.ini

...
extension=memcache.so
extension=apc.so
...

$[/code]

Next is restart your webserver.
Create a file name it phpinfo.php

[code]$vi /var/www/html/phpinfo.php

<? phpinfo(); ?>

## save this file

$[/code]

Access your phpinfo from browser such as IE / Firefox
Example : http://localhost/phpinfo.php

If you have finished the installation, you will see a suhosin patch, memcache and apc in your php extensions like below

How To Install PHP Memcache and APC Extensions FreeBSD - phperwuhan - phperwuhan的博客

 

How To Install PHP Memcache and APC Extensions FreeBSD - phperwuhan - phperwuhan的博客
  评论这张
 
阅读(822)| 评论(0)
推荐 转载

历史上的今天

在LOFTER的更多文章

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017