ubuntu下安裝phpredis的模組擴充,ubuntuphpredis

來源:互聯網
上載者:User

ubuntu下安裝phpredis的模組擴充,ubuntuphpredis

1.前提是先安裝好redis,然後再安裝phpredis。。。

2.先下載phpredis-master.tar.gz安裝包。。。

具體詳情如下:

<span style="color:#33CC00;"><span style="background-color: rgb(0, 0, 0);">1.tar zxvf phpredis-master.tar.gz </span></span>

<span style="color:#33CC00;"><span style="background-color: rgb(0, 0, 0);">2.cd phpredis-master/</span></span>

<span style="color:#33CC00;"><span style="background-color: rgb(0, 0, 0);">3./opt/lampp/bin/phpize ./configure --with-php-config=/opt/lampp/bin/php-config</span></span>
注意phize和php-config的路徑,我的php是在lampp下面,具體路徑根據你的php路徑來
<span style="color:#33CC00;"><span style="background-color: rgb(0, 0, 0);">4.sudo /opt/lampp/bin/phpize-5.5.15</span></span>
運行到這一步會出現下面問題

<span style="color:#33CC00;"><span style="background-color: rgb(0, 0, 0);">Configuring for:PHP Api Version:         20121113Zend Module Api No:      20121212Zend Extension Api No:   220121212Cannot find autoconf. Please check your autoconf installation and the$PHP_AUTOCONF environment variable. Then, rerun this script.</span></span>

這時就需要安裝兩個東西

<span style="color:#33CC00;"><span style="background-color: rgb(0, 0, 0);">5.sudo apt-get install m4</span></span>
如果安裝過程中出現以下錯誤

<span style="color:#33CC00;"><span style="background-color: rgb(0, 0, 0);">dpkg: error processing package install-info (--unpack): 子進程 已安裝 post-installation 指令碼 返回了錯誤號碼 127在處理時有錯誤發生: install-infoE: Sub-process /usr/bin/dpkg returned an error code (1)</span></span>

則在這裡有解決辦法:http://blog.csdn.net/hearain528/article/details/44173069

然後重新安裝即可成功安裝m4...

<span style="color:#33CC00;"><span style="background-color: rgb(0, 0, 0);">6.sudo apt-get install autoconf</span></span>
如果也出現上面5的問題,則和第5步的解決辦法一樣。。。

<span style="color:#33CC00;"><span style="background-color: rgb(0, 0, 0);">7.sudo /opt/lampp/bin/phpize-5.5.15 </span></span>

<span style="color:#33CC00;"><span style="background-color: rgb(0, 0, 0);">8.sudo ./configure --with-php-config=/opt/lampp/bin/php-config</span></span>

<span style="color:#009900;"><span style="background-color: rgb(0, 0, 0);">9. sudo make</span></span>

<span style="color:#33CC00;"><span style="background-color: rgb(0, 0, 0);">10.sudo make install    Installing shared extensions: /opt/lampp/lib/php/extensions/no-debug-non-zts-20121212/    </span></span>
上面出現的路徑則是redis.so的路徑,然後在php.ini裡面增加

<span style="color:#33CC00;"><span style="background-color: rgb(0, 0, 0);">11.extension="/opt/lampp/lib/php/extensions/no-debug-non-zts-20121212/redis.so"</span></span>

然後重啟伺服器,或者重啟php,然後運行phpinfo.php查看phpredis擴充是否安裝成功。。。


相關文章

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.