一、安装与配置

  1. 先安装libevent
    tar zxvf libevent-1.4.13-stable.tar.gz
    cd libevent-1.4.13-stable
    ./configure  -prefix=/usr/local/libevent
    make
    make install
    
  2. 测试libevent是否安装成功
    ls -ls /usr/local/libevent/lib/
    total 2084
      0 lrwxrwxrwx 1 root root     21 Nov 15 09:51 libevent-1.4.so.2 -> libevent-1.4.so.2.1.3
    368 -rwxr-xr-x 1 root root 373214 Nov 15 09:51 libevent-1.4.so.2.1.3
    592 -rw-r--r-- 1 root root 604050 Nov 15 09:51 libevent.a
      0 lrwxrwxrwx 1 root root     26 Nov 15 09:51 libevent_core-1.4.so.2 -> libevent_core-1.4.so.2.1.3
    136 -rwxr-xr-x 1 root root 137337 Nov 15 09:51 libevent_core-1.4.so.2.1.3
    224 -rw-r--r-- 1 root root 229064 Nov 15 09:51 libevent_core.a
      4 -rwxr-xr-x 1 root root    875 Nov 15 09:51 libevent_core.la
      0 lrwxrwxrwx 1 root root     26 Nov 15 09:51 libevent_core.so -> libevent_core-1.4.so.2.1.3
      0 lrwxrwxrwx 1 root root     27 Nov 15 09:51 libevent_extra-1.4.so.2 -> libevent_extra-1.4.so.2.1.3
    292 -rwxr-xr-x 1 root root 295860 Nov 15 09:51 libevent_extra-1.4.so.2.1.3
    460 -rw-r--r-- 1 root root 469178 Nov 15 09:51 libevent_extra.a
      4 -rwxr-xr-x 1 root root    882 Nov 15 09:51 libevent_extra.la
      0 lrwxrwxrwx 1 root root     27 Nov 15 09:51 libevent_extra.so -> libevent_extra-1.4.so.2.1.3
      4 -rwxr-xr-x 1 root root    840 Nov 15 09:51 libevent.la
      0 lrwxrwxrwx 1 root root     21 Nov 15 09:51 libevent.so -> libevent-1.4.so.2.1.3
    #版本不同,可能文件列表不同。
    
  3. 安装memcached,同时需要安装中指定libevent的安装位置
    tar zxvf memcached-1.4.4.tar.gz
    cd memcached-1.4.4
    ./configure --prefix=/usr/local/memcached --with-libevent=/usr/local/libevent/
    make && make install
    
  4. 测试是否成功安装memcached
    #ls -al /usr/local/memcached/bin/mem*
    -rwxr-xr-x 1 root root 258929 Nov 15 09:54 /usr/local/memcached/bin/memcached
    

二、安装Memcache的PHP扩展

  1. 安装PHP的memcache扩展
    tar vxzf memcache-2.2.5.tgz
    cd memcache-2.2.5
    /usr/local/php-fpm/bin/phpize
    ./configure --with-php-config=/usr/local/php-fpm/bin/php-config --enable-memcache
    make
    make install
    
  2. 上述安装完后会有类似这样的提示:
    Installing shared extensions:
    /usr/local/php-fpm/lib/php/extensions/no-debug-non-zts-20090626/
    
  3. 把php.ini中的extension_dir = “./”修改为
    extension_dir = “/usr/local/php-fpm/lib/php/extensions/no-debug-non-zts-20090626/”
    
  4. 在php.ini添加两行来载入memcache扩展:
    [memcache]
    extension=memcache.so
    
  5. 重起php-fpm
     /etc/init.d/php-fpm restart
    
  6. 添加环境变量
    #编辑 ~/.bash_profile,将:
    PATH=$PATH:$HOME/bin改为:
    PATH=$PATH:$HOME/bin:/usr/local/memcached/bin
    #使 memcache环境变量生效:
    source  ~/.bash_profile
    

三、memcached的基本设置

  1. 启动Memcache的服务器端:
    memcached -d -m 10 -u root -l 192.168.121.213 -p 11211 -c 256 -P /tmp/memcached.pid
    #参数说明:
    #-d选项是启动一个守护进程,
    #-m是分配给Memcache使用的内存数量,单位是MB,我这里是10MB,
    #-u是运行Memcache的用户,我这里是root,
    #-l是监听的服务器IP地址,如果有多个地址的话,我这里指定了服务器的IP192.168.121.213,
    #-p是设置Memcache监听的端口,我这里设置了11211,最好是1024以上的端口,
    #-c选项是最大运行的并发连接数,默认是1024,我这里设置了256,按照你服务器的负载量来设定,
    #-P是设置保存Memcache的pid文件,我这里是保存在 /tmp/memcached.pid,
    
  2. 如果要结束Memcache进程,执行:
    kill `cat /tmp/memcached.pid`
    

    也可以启动多个守护进程,不过端口不能重复。

  3. 检查Memcached是否启动
    netstat -ant
    tcp        0      0 192.168.121.213:11211       0.0.0.0:*                   LIST
    #11211端口已经打开,说明Memcached已正常启动。
    
分类: PHP

114 条评论

https://forum.chessmnemonics.net · 2026-08-29 01:25

References:

River rock casino vancouver https://forum.chessmnemonics.net

xnxxx.win · 2026-09-21 08:19

nwturally lie yojr webb site butt youu hhave tto chheck thee splling onn seeral of your posts.
A nuber of them aare rifee witfh spepling prlblems annd I fiund itt ver troublesome too inform tthe rrality hokwever I’ll sureky ome back again. xnxx

sofortüberweisung casino ohne oasis · 2026-09-22 02:45

References:

Sofort casino ohne oasis sofortüberweisung casino ohne oasis

casino 1 euro einzahlung sofortüberweisung · 2026-09-22 08:41

References:

Sofortüberweisung freispiele casino casino 1 euro einzahlung sofortüberweisung

md.sigma2.no · 2026-09-22 16:53

References:

Sofort Casino Empfehlung md.sigma2.no

blizbet · 2026-09-23 04:29

[4183]Blizbet লগইন ও অ্যাপ ডাউনলোড | বিকাশ ক্যাসিনো ডিপোজিট,blizbet লগইন করে অনলাইনে স্লট গেম খেলার নিয়ম জানুন। বিকাশ দিয়ে ক্যাসিনো ডিপোজিট এবং অ্যাপ ডাউনলোড করে আজই গেম শুরু করুন। visit: blizbet

www.canadaasians.com · 2026-09-23 09:50

References:

Live casino sofort http://www.canadaasians.com

aupeopleweb.com.au · 2026-09-23 10:00

References:

Sofort Casino Gebühren aupeopleweb.com.au

https://comsenz-service.com/?182443 · 2026-09-23 13:05

References:

Sofort casino ohne konto https://comsenz-service.com/?182443

t.044300.net · 2026-09-23 14:57

References:

Deutsches Sofort Casino t.044300.net

sofort casinos einzahlung · 2026-09-23 18:13

References:

Casino ohne anmeldung sofort sofort casinos einzahlung

online casino sofort zahlung · 2026-09-23 18:21

References:

Casino sofort echtgeld online casino sofort zahlung

https://dudoser.com · 2026-09-25 22:26

References:

Australian online casino payid pokies https://dudoser.com/user/coldsinger0/

https://hedgedoc.envs.net/ · 2026-09-26 02:57

References:

No deposit payid pokies australia https://hedgedoc.envs.net/ZAiSqAHGRXuj1xy4HIIFEA

minimum deposit payid pokies · 2026-09-29 02:21

References:

Top payid pokies australia http://www.okaywan.com/home.php?mod=space&uid=850239

payid pokies no KYC · 2026-10-04 05:08

References:

Instant play payid pokies https://doc.neutrinet.be/lwV0FpQ_Sra6mI7I3mqdSQ

https://dreevoo.com · 2026-10-04 09:19

References:

Online casino neosurf bonus https://dreevoo.com/profile.php?pid=2398797

legit neosurf casinos australia · 2026-10-04 14:56

References:

Instant withdrawal neosurf casino australia https://md.sigma2.no/FWwEbYFNRp6_MOM1VwwsTA

https://aryba.kg/ · 2026-10-04 16:48

References:

International casinos accepting neosurf australia https://aryba.kg/user/syrupkitten6/

https://git.arteneo.pl/ · 2026-10-04 19:20

References:

Neosurf online casino real money https://git.arteneo.pl/oboeoxygen24

play real money pokies neosurf · 2026-10-04 23:53

References:

Neosurf casino deposit bonus australia http://www.4001179958.org/?152186

http://madk-auto.ru · 2026-10-06 04:08

References:

Neosurf cash out casino australia http://madk-auto.ru/user/beercancer98/

legit neosurf casinos australia · 2026-10-06 07:26

References:

Neosurf casino fees australia https://may22.ru/user/birthstudy3/

neosurf casino promo code · 2026-10-06 11:43

References:

Neosurf online casino real money http://xuetao365.com/home.php?mod=space&uid=729093

neosurf online casino real money · 2026-10-06 13:40

References:

Online casinos that accept neosurf australia https://md.sebastians.dev/rW0j9wOjTnWffUV7uG4lCA

http://www.qingdaomop.com/?293120 · 2026-10-16 23:08

References:

Wire transfer casino pokies Australia http://www.qingdaomop.com/?293120

https://git.arteneo.pl/ · 2026-10-17 03:33

References:

Instant play payid pokies https://git.arteneo.pl/veiltuna2

how to play pokies with payid · 2026-10-17 15:25

References:

Online pokies payid australia http://bbs.88moli.top/home.php?mod=space&uid=193338

sonnik.nalench.com · 2026-10-18 01:10

References:

Fast withdrawal pokies australia payid https://sonnik.nalench.com/user/goldnut21/

https://manualshyundai.com/ · 2026-10-18 20:32

References:

MiFinity e-wallet casino Australia https://manualshyundai.com/user/chillcatsup8/

MiFinity casino live chat Australia · 2026-10-18 23:27

References:

Australian online casinos that take MiFinity https://www.rcmx.net/userinfo.php?uid=57678

http://www.jcdqzdh.com/home.php?mod=space&uid=1084296 · 2026-10-19 04:57

References:

$5 minimum deposit casino neosurf australia http://www.jcdqzdh.com/home.php?mod=space&uid=1084296

git.arteneo.pl · 2026-10-19 19:28

References:

Real money wire transfer casino Australia https://git.arteneo.pl/brakeage45

hedgedoc.dawan.fr · 2026-10-19 20:36

References:

Australian players wire transfer casino https://hedgedoc.dawan.fr/dvBMv5fWRYmXdfmiF1CYow

https://codimd.syssec.org · 2026-10-19 21:11

References:

Wire transfer real money pokies australia https://codimd.syssec.org/a_cKMgd4QpiMkG5-IhZ35g

https://shareshortcuts.com · 2026-10-20 07:28

References:

Osko casinos for Australians https://shareshortcuts.com/u/spooncougar15

jackpot pokies payid · 2026-10-20 08:40

References:

Online pokies payid no deposit http://www.4001179958.org/?161983

Osko pokies no charge · 2026-10-20 09:06

References:

Casinos with Osko withdrawal https://a-taxi.com.ua/user/battlebacon80/

https://md.sigma2.no · 2026-10-20 12:08

References:

Online pokies wire transfer https://md.sigma2.no/826HISx3TPWPHNSgX0RQxQ

npp casinos australia · 2026-10-20 14:40

References:

Osko pokies no waiting https://gitlab.ujaen.es/pigeonbronze91

payid pokies instant withdrawal australia · 2026-10-20 16:51

References:

Fast withdrawal pokies australia payid https://text.dsf.hs-heilbronn.de/qgOH4un_QN21pb8iwbHNyQ

osko pokies sign up bonus · 2026-10-20 17:30

References:

Instant play casino Osko https://peatix.com/user/30763838/view

https://dudoser.com/user/maplekiss9/ · 2026-10-20 20:30

References:

How to play pokies with payid https://dudoser.com/user/maplekiss9/

https://rentry.co/uskbwnv5 · 2026-10-21 01:51

References:

Secure Osko casinos https://rentry.co/uskbwnv5

http://www.szjyw.com/ · 2026-10-21 08:05

References:

BPay online casino Australia http://www.szjyw.com/home.php?mod=space&uid=276150

payid pokies sites · 2026-10-21 09:16

References:

Fast payout payid pokies https://pad.stuve.de/6H0l037DQfWjbCo0WRawqA

bpay pokies withdrawal · 2026-10-21 10:03

References:

Play online pokies bpay australia http://bbs.sdhuifa.com/home.php?mod=space&uid=1246718

https://www.play56.net/ · 2026-10-21 13:25

References:

Payid minimum deposit pokies https://www.play56.net/home.php?mod=space&uid=6627066

MiFinity casino fast payouts Australia · 2026-10-21 21:31

References:

MiFinity casino mobile Australia https://gitlab.ujaen.es/branchpuffin70

http://www.sg588.tw · 2026-10-22 06:26

References:

MiFinity casino guide Australia http://www.sg588.tw/home.php?mod=space&uid=1306390

https://lslv168.com · 2026-10-22 10:03

References:

Neosurf anonymous casino australia https://lslv168.com/home.php?mod=space&uid=2978281

actualites.cava.tn · 2026-10-22 11:57

References:

Top 10 neosurf casinos australia https://actualites.cava.tn/user/jokeegypt3/

neosurf no deposit bonus codes australia · 2026-10-22 16:17

References:

Neosurf free spins australia https://schoolido.lu/user/lacealloy6/

high limit wire transfer casinos australia · 2026-10-22 18:39

References:

Bank transfer gambling sites australia http://bbs.lotsmall.cn/home.php?mod=space&uid=732656

wire transfer casino processing time · 2026-10-23 09:20

References:

Bank transfer casino real money Australia http://www.sg588.tw/home.php?mod=space&uid=1306781

free payid pokies · 2026-10-26 04:07

References:

Payid pokies welcome bonus https://dreevoo.com/profile.php?pid=2578853

https://www.24propertyinspain.com · 2026-10-27 12:44

References:

MiFinity slots casino Australia https://www.24propertyinspain.com/user/profile/1552067

Osko withdrawal casino Australia · 2026-10-28 13:14

References:

Osko instant processing pokies https://guzhen0552.cn/home.php?mod=space&uid=2573582

bank wire withdrawal casino australia · 2026-10-28 16:18

References:

Top australian wire transfer casinos http://www.4001179958.org/?167583

ugzhnkchr.ru · 2026-10-30 03:27

References:

Pokies with payid deposit https://ugzhnkchr.ru/user/riskbass2/

365jeetloginpassword · 2026-10-30 09:43

I love how I can jump in anytime and the security is top notch. Playing here feels refreshing because they prioritize player safety and fair play. The daily rewards are a nice touch and keep the fun going strong. 365jeetloginpassword

MiFinity casinos Australia · 2026-10-30 11:30

References:

Safe MiFinity casinos Australia https://app.wedonthavetime.org/profile/jumpthing46

minimum neosurf deposit casino aus · 2026-10-30 12:35

References:

Newest neosurf casinos australia https://chuangu.xyz/?429466

wargame-workshop.com · 2026-11-09 21:57

References:

Where to play neosurf casino australia http://wargame-workshop.com/bbs/home.php?mod=space&uid=1468669

发表回复

Avatar placeholder

您的邮箱地址不会被公开。 必填项已用 * 标注