好湿?好紧?好多水好爽自慰,久久久噜久噜久久综合,成人做爰A片免费看黄冈,机机对机机30分钟无遮挡

主頁 > 知識庫 > CentOS(x86_64)下PHP安裝memcache擴展問題解決方法分享

CentOS(x86_64)下PHP安裝memcache擴展問題解決方法分享

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

復制代碼
代碼如下:

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位系統,還需要把libevent的文件復制到/wp-content/lib64/下,用來解決error while loading shared libraries的問題
cp -R /wp-content/local/lib/libevent* /wp-content/lib64/


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

pecl install memcache

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

回頭想想,我好像漏了一個地方沒有檢查,馬上打開 /wp-content/lib64/php/modules/ 查看,果然沒有memcache.so,會在哪呢? find -name之,原來躲在 /wp-content/local/lib/php/extensions/no-debug-non-zts-20060613/ 下,復制到 /wp-content/lib64/php/modules/ 再試,久違的 memcache擴展出現了。 T T

Memcached參數說明:

  • -d選項是啟動一個守護進程
  • -m分配給Memcache使用的內存數量,單位是MB
  • -u運行Memcache的用戶
  • -l監聽的服務器IP地址
  • -p設置Memcache監聽的端口,最好是1024以上的端口
  • -c最大運行的并發連接數,默認是1024,按照你服務器的負載量來設定
  • -P設置保存Memcache的pid文件

啟動:

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

查看狀態:

watch “echo stats | nc 127.0.0.1 11211″

狀態說明:

  • uptime:memcached運行的秒數
  • cmd_get:查詢緩存的次數。這兩個數據相除一下就能得到平均每秒請求緩存的次數
  • cmd_set:設置key=>value的次數
  • get_hits:緩存命中的次數。緩存命中率 = get_hits/cmd_get * 100%
  • scurr_items:現在在緩存中的鍵值對個數

相關網址:

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]

標簽:通化 玉溪 臨汾 瀘州 玉樹 蕪湖 泰安 儋州

巨人網絡通訊聲明:本文標題《CentOS(x86_64)下PHP安裝memcache擴展問題解決方法分享》,本文關鍵詞  CentOS,x86,下,PHP,安裝,memcache,;如發現本文內容存在版權問題,煩請提供相關信息告之我們,我們將及時溝通與處理。本站內容系統采集于網絡,涉及言論、版權與本站無關。
  • 相關文章
  • 下面列出與本文章《CentOS(x86_64)下PHP安裝memcache擴展問題解決方法分享》相關的同類信息!
  • 本頁收集關于CentOS(x86_64)下PHP安裝memcache擴展問題解決方法分享的相關信息資訊供網民參考!
  • 推薦文章