1 php protocolbuffers安裝

安裝工具

yum install autoconf yum install libtool

 

安裝protoc編譯器

# cd /root/soft/protobuf-2.7.0

 

autogen.sh :php

if test ! -e gmock; then
    echo "Google Mock not present.  Fetching gmock-1.7.0 from the web..."
    curl $curlopts -O https://googlemock.googlecode.com/files/gmock-1.7.0.zip
    unzip -q gmock-1.7.0.zip
    rm gmock-1.7.0.zip
    mv gmock-1.7.0 gmock
fi

 

將gmock放置在安裝目錄:web

# cp ../gmock-1.7.0.zip .
# mv gmock-1.7.0.zip gmock

 

開始安裝:curl

# ./autogen.sh # 生成configure腳本
# ./configure
# make
# make check
# make install

/usr/local/bin/protoc

 

安裝php的 php-protocolbuffers擴展 及 使用

# cd php-protocolbuffers-master
# phpize
# ./configure
# make
# make install

 

問題:工具

Can't find PHP headers in /usr/include/php The php-devel package is required for use of this command.
# yum install php-devel

 

 

而後在你的php.ini配置文件中添加 extension = "protocolbuffers.so"ui

# php -m | grep protocolbuffers
protocolbuffers
相關文章
相關標籤/搜索