婷婷综合国产,91蜜桃婷婷狠狠久久综合9色 ,九九九九九精品,国产综合av

主頁(yè) > 知識(shí)庫(kù) > CentOS(x86_64)下PHP安裝memcache擴(kuò)展問(wèn)題解決方法分享

CentOS(x86_64)下PHP安裝memcache擴(kuò)展問(wèn)題解決方法分享

熱門標(biāo)簽:辦理400電話怎么劃傷 南寧銷售電銷機(jī)器人廠家 地圖標(biāo)注軌跡 科研地圖標(biāo)注 省份地圖標(biāo)注 灰谷地圖標(biāo)注 陽(yáng)江智能電銷機(jī)器人 江蘇客服外呼系統(tǒng)怎么樣 平頂山手機(jī)自動(dòng)外呼系統(tǒng)違法嗎
系統(tǒng)版本是5.2,把安裝memcached的方法記錄下先:

復(fù)制代碼
代碼如下:

cd ~/memcached
wget -c http://www.monkey.org/~provos/libevent-1.4.10-stable.tar.gz
wget -c http://memcached.googlecode.com/files/memcached-1.2.8.tar.gz
#安裝libevent
tar -zxvf libevent-1.4.10-stable.tar.gz
cd libevent-1.4.10-stable
./configure
make
make install
#安裝memcached
cd ..
tar -zxvf memcached-1.2.8.tar.gz
cd memcached-1.2.8
./configure
make
make install
#如果是64位系統(tǒng),還需要把libevent的文件復(fù)制到/wp-content/lib64/下,用來(lái)解決error while loading shared libraries的問(wèn)題
cp -R /wp-content/local/lib/libevent* /wp-content/lib64/


好了,開(kāi)始安裝php的擴(kuò)展,惡夢(mèng)開(kāi)始了,本以為直接用yum來(lái)安裝php-devel.x86_64和php-pecl-memcache.x86_64這兩個(gè)擴(kuò)展就可以了,可裝了后 phpinfo()里根本找不到memcache擴(kuò)展,把已經(jīng)裝的這兩個(gè)擴(kuò)展remove重來(lái),還是不行,goooooooooooooogle,找到了一篇文章《PHP Pecl Memcached module installation problems》,有救嘍,先remove掉php-pecl-memcache.x86_64,然后執(zhí)行了

pecl install memcache

順利安裝上了,打開(kāi)/etc/php.d/看了下,沒(méi)有memcache.ini,好吧,手動(dòng)到/etc/php.ini加上了 extension=memcache.so,好了,重啟httpd,刷新 phpinfo() ,竟然還沒(méi)有,我郁悶了。。

回頭想想,我好像漏了一個(gè)地方?jīng)]有檢查,馬上打開(kāi) /wp-content/lib64/php/modules/ 查看,果然沒(méi)有memcache.so,會(huì)在哪呢? find -name之,原來(lái)躲在 /wp-content/local/lib/php/extensions/no-debug-non-zts-20060613/ 下,復(fù)制到 /wp-content/lib64/php/modules/ 再試,久違的 memcache擴(kuò)展出現(xiàn)了。 T T

Memcached參數(shù)說(shuō)明:

  • -d選項(xiàng)是啟動(dòng)一個(gè)守護(hù)進(jìn)程
  • -m分配給Memcache使用的內(nèi)存數(shù)量,單位是MB
  • -u運(yùn)行Memcache的用戶
  • -l監(jiān)聽(tīng)的服務(wù)器IP地址
  • -p設(shè)置Memcache監(jiān)聽(tīng)的端口,最好是1024以上的端口
  • -c最大運(yùn)行的并發(fā)連接數(shù),默認(rèn)是1024,按照你服務(wù)器的負(fù)載量來(lái)設(shè)定
  • -P設(shè)置保存Memcache的pid文件

啟動(dòng):

memcached -d -u root -m 128 -c 8192

查看狀態(tài):

watch “echo stats | nc 127.0.0.1 11211″

狀態(tài)說(shuō)明:

  • uptime:memcached運(yùn)行的秒數(shù)
  • cmd_get:查詢緩存的次數(shù)。這兩個(gè)數(shù)據(jù)相除一下就能得到平均每秒請(qǐng)求緩存的次數(shù)
  • cmd_set:設(shè)置key=>value的次數(shù)
  • get_hits:緩存命中的次數(shù)。緩存命中率 = get_hits/cmd_get * 100%
  • scurr_items:現(xiàn)在在緩存中的鍵值對(duì)個(gè)數(shù)

相關(guān)網(wǎng)址:

Libevent:http://www.monkey.org/~provos/libevent/
Memcached:http://danga.com/memcached/
PHP Memcached Extension:http://pecl.php.net/package/memcache


[shell]
[root@~]# pecl install memcache
downloading memcache-2.2.6.tgz ...
Starting to download memcache-2.2.6.tgz (35,957 bytes)
..........done: 35,957 bytes
11 source files, building
WARNING: php_bin /opt/php/bin/php appears to have a suffix /bin/php, but config variable php_suffix does not match
running: phpize
Configuring for:
PHP Api Version: 20090626
Zend Module Api No: 20090626
Zend Extension Api No: 220090626
Enable memcache session handler support? [yes] : n
[/shell]

[shell]
running: make INSTALL_ROOT="/var/tmp/pear-build-root/install-memcache-2.2.6" install
Installing shared extensions: /var/tmp/pear-build-root/install-memcache-2.2.6/opt/php/lib/php/extensions/no-debug-non-zts-20090626/
running: find "/var/tmp/pear-build-root/install-memcache-2.2.6" | xargs ls -dils
11370548 4 drwxr-xr-x 3 root root 4096 Jan 6 15:55 /var/tmp/pear-build-root/install-memcache-2.2.6
11370602 4 drwxr-xr-x 3 root root 4096 Jan 6 15:55 /var/tmp/pear-build-root/install-memcache-2.2.6/opt
11370603 4 drwxr-xr-x 3 root root 4096 Jan 6 15:55 /var/tmp/pear-build-root/install-memcache-2.2.6/opt/php
11370604 4 drwxr-xr-x 3 root root 4096 Jan 6 15:55 /var/tmp/pear-build-root/install-memcache-2.2.6/opt/php/lib
11370605 4 drwxr-xr-x 3 root root 4096 Jan 6 15:55 /var/tmp/pear-build-root/install-memcache-2.2.6/opt/php/lib/php
11370606 4 drwxr-xr-x 3 root root 4096 Jan 6 15:55 /var/tmp/pear-build-root/install-memcache-2.2.6/opt/php/lib/php/extensions
11370607 4 drwxr-xr-x 2 root root 4096 Jan 6 15:55 /var/tmp/pear-build-root/install-memcache-2.2.6/opt/php/lib/php/extensions/no-debug-non-zts-20090626
11370601 236 -rwxr-xr-x 1 root root 235639 Jan 6 15:55 /var/tmp/pear-build-root/install-memcache-2.2.6/opt/php/lib/php/extensions/no-debug-non-zts-20090626/memcache.so

Build process completed successfully
Installing '/opt/php/lib/php/extensions/no-debug-non-zts-20090626/memcache.so'
install ok: channel://pecl.php.net/memcache-2.2.6
configuration option "php_ini" is not set to php.ini location
You should add "extension=memcache.so" to php.ini
[/shell]

標(biāo)簽:通化 玉溪 臨汾 瀘州 玉樹(shù) 蕪湖 泰安 儋州

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《CentOS(x86_64)下PHP安裝memcache擴(kuò)展問(wèn)題解決方法分享》,本文關(guān)鍵詞  CentOS,x86,下,PHP,安裝,memcache,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問(wèn)題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無(wú)關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《CentOS(x86_64)下PHP安裝memcache擴(kuò)展問(wèn)題解決方法分享》相關(guān)的同類信息!
  • 本頁(yè)收集關(guān)于CentOS(x86_64)下PHP安裝memcache擴(kuò)展問(wèn)題解決方法分享的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    主站蜘蛛池模板: 新竹市| 仪陇县| 共和县| 郓城县| 扶绥县| 涿鹿县| 长春市| 邢台县| 柳林县| 云安县| 贵定县| 双鸭山市| 富裕县| 长葛市| 南部县| 金溪县| 凉城县| 拜城县| 顺义区| 城步| 水富县| 固安县| 马公市| 井研县| 中方县| 柏乡县| 曲麻莱县| 红桥区| 吴旗县| 特克斯县| 宾川县| 特克斯县| 吉水县| 灵丘县| 南丰县| 抚远县| 伊金霍洛旗| 阿拉善左旗| 蒲江县| 沙河市| 揭阳市|