背景:php環(huán)境使用yum安裝的,不需要安裝redis酌住,只需要phpredis擴(kuò)展
一、調(diào)試phpize
二阎抒、安裝igbinary?
三酪我、安裝phpredis
四、重啟
走到哪里都不要忘了官網(wǎng)?https://github.com/phpredis/phpredis
開始使用yum install php-redis
看到有人推薦
wget http://mirrors.ustc.edu.cn/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -ivh epel-release-6-8.noarch.rpm
yum install php-redis
無果且叁,一直error都哭,忘記截圖了
只有看到 http://www.osyunwei.com/archives/7210.html?
因?yàn)榉?wù)器用yum安裝的,感覺不能make(本人新手)逞带,看到很多的資料以后欺矫,最終決定此方法是ok的
但是需要準(zhǔn)備兩個文件,phpize 展氓,php-config
查找兩個文件的位置
whereis phpize
whereis php-config
發(fā)現(xiàn)沒有php-config
于是運(yùn)行phpize 或者/usr/bin/phpize穆趴,此時(shí)報(bào)錯再次報(bào)錯
# phpize
Can't find PHP headers in /usr/include/php
The php-devel package is required for use of this command.
運(yùn)行
yum install php-devel
此時(shí),php-config存在遇汞,./configure 也可以運(yùn)行了
安裝phpredis前未妹,必須安裝igbinary 否則又是各種錯誤
checking for igbinary includes... configure: error: Cannot find igbinary.h
此時(shí)就是提醒需要安裝igbinary,中間可能遇到很多的問題空入,缺少各種各樣的擴(kuò)展络它,此處整理一下代碼
114? wget https://github.com/nicolasff/phpredis/archive/2.2.4.tar.gz
? 116? mv 2.2.4.tar.gz /usr/local/src/
? 118? cd /usr/local/src/
? 120? tar zxvf 2.2.4.tar.gz
? 122? cd phpredis-2.2.4/
? 126? phpize
? 127? yum install php-pear
? 128? yum install php-devel
? 129? phpize
? 130? whereis php-config
? #此時(shí)停止了phpredis安裝,開始安裝igbinary
? 147? wget http://pecl.php.net/get/igbinary-1.1.1.tgz
? 149? mv igbinary-1.1.1.tgz /usr/local/src/
? cd /usr/local/src/
? 152? tar -xzvf igbinary-1.1.1.tgz
? 153? cd igbinary-1.1.1
? 154? phpize
? 155? ./configure
? 156? make
? 157? make install
? #安裝igbinary后执庐,安裝redis
? 160? cd phpredis-2.2.4/
? 161? phpize
? 162? ./configure --enable-redis-igbinary#貌似(./configure --enable-redis-igbinary --with-php-config=/usr/bin/php-config)這樣也可以
? 163? make
? 164? make install
最后在php.ini中添加
extension=igbinary.so
extension=redis.so
重啟
重點(diǎn)學(xué)會用yum安裝的環(huán)境后酪耕,
使用phpize
./configure?
make && make install
這個編譯模式
---------------------
作者:正在崛起的小菜菜
來源:CSDN
原文:https://blog.csdn.net/u010073893/article/details/51840045
版權(quán)聲明:本文為博主原創(chuàng)文章,轉(zhuǎn)載請附上博文鏈接轨淌!