亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

php7安裝yar擴(kuò)展的方法詳解

 更新時(shí)間:2017年08月03日 12:35:23   作者:歐陽瘋瘋  
這篇文章主要介紹了php7安裝yar擴(kuò)展的方法,結(jié)合實(shí)例形式較為詳細(xì)的分析了php7安裝yar擴(kuò)展的具體步驟、相關(guān)命令與注意事項(xiàng),需要的朋友可以參考下

本文實(shí)例講述了php7安裝yar擴(kuò)展的方法。分享給大家供大家參考,具體如下:

體驗(yàn)RPC框架Yar需要:

1. 裝二進(jìn)制打包協(xié)議msgpack

2. 裝yar拓展和依賴

一. 安裝二進(jìn)制打包協(xié)議msgpack

1. 安裝PHP拓展包有很多種方式,當(dāng)然沒什么是比pecl更加來得暴力,用這個(gè)之前要確認(rèn)phpize是否存在

find / -name phpize

2. 如果phpize不存在

yum install php-devel

3. Ok,先裝msgpack

pecl install msgpack

安裝跳了一大堆編譯過程過程,省略ING 只關(guān)心后幾行

Build process completed successfully
Installing '/usr/include/php/ext/msgpack/php_msgpack.h'
Installing '/usr/lib64/php/modules/msgpack.so'
install ok: channel://pecl.php.net/msgpack-0.5.6
configuration option "php_ini" is not set to php.ini location
You should add "extension=msgpack.so" to php.ini

安裝完 msgpack.so 會(huì)自動(dòng)復(fù)制到 php 擴(kuò)展庫,并寫好配置。

二. 安裝 yar

1. 下載 yar

wget http://pecl.php.net/get/yar-2.0.0.tgz

2. 解壓編譯

tar -zxvf yar-2.0.0.tgz
cd cd yar-2.0.0
/usr/bin/phpize
./configure --with-php-config=/usr/bin/php-config7.0*

遇到問題:

checking for cURL in default path... not found
configure: error: Please reinstall the libcurl distribution - easy.h should be in <curl-dir>/include/curl/

3. 安裝 curl-devel

yum -y install curl-devel
sudo apt-get install libcurl4-gnutls-dev

ps:curl vs curl-deval

參考: http://stackoverflow.com/questions/4976971/compiling-php-with-curl-where-is-curl-installed

4. 安裝 yar

make && make install

5. 復(fù)制 yar.so 到 php 擴(kuò)展庫下

sudo cp yar.so /usr/lib/php/20151012/yar.so

6. 擴(kuò)展寫配置文件

echo "extension=yar.so" > /etc/php/7.0/mods-available/yar.ini
ln -sf /etc/php/7.0/mods-available/yar.ini /etc/php/7.0/fpm/conf.d/20-yar.ini
ln -sf /etc/php/7.0/mods-available/yar.ini /etc/php/7.0/cli/conf.d/20-yar.ini

7. 重啟 php-fpm nginx

service php7.0-fpm restart
service nginx restart

ps: php -ir 查詢 phpinfo

更多關(guān)于PHP相關(guān)內(nèi)容感興趣的讀者可查看本站專題:《PHP擴(kuò)展開發(fā)教程》、《php面向?qū)ο蟪绦蛟O(shè)計(jì)入門教程》、《php+mysql數(shù)據(jù)庫操作入門教程》、《PHP網(wǎng)絡(luò)編程技巧總結(jié)》及《php常見數(shù)據(jù)庫操作技巧匯總

希望本文所述對大家PHP程序設(shè)計(jì)有所幫助。

相關(guān)文章

最新評論