ArchLinux下PHP安裝memcached擴充

來源:互聯網
上載者:User

標籤:.net   檔案   blog   ack   bash   目錄   modules   包含   log   

因為遇到php報錯 Class ‘Memcached‘ not found,才發現php擴充居然有兩個,一個memcache,一個memecached。
同時呢,memecached服務本身又剛好與副檔名同名。
於是各種解答就出現了。

用了yaourt,發現有php-memcached存在。直接

sudo yaourt -S php-memcached

  安裝好後,在/usr/lib/php/modules下,會組建檔案memcached.so

在已有的php目錄下,如/usr/lib/php56/modules下。建立軟連結。同時配置php.ini裡麵包含一句extension=memcached.so
重啟php,結果memcached擴充還是不能用。原來是php版本與memcached.so的版本不一致。

只好到http://pecl.php.net/package/memcached 這裡找一個合適版本的。
php5.2-5.6對應memcached-2.2.0.tgz 

以下逐行執行。

wget http://pecl.php.net/get/memcached-2.2.0.tgztar zxvf memcached-2.2.0.tgzcd memcached-2.2.0/phpsize // 或phpize56  根據安裝的php版本確定./configure --enable-memcached --enable-memcached-jsonmakesudo make install

  

執行完成後,會發現/usr/lib/php56/modules下多了一個memcached.so。配置好php.ini,重啟php,完成。


ArchLinux下PHP安裝memcached擴充

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.