How to compile and install and use msgpack-php
This article mainly introduces "how to compile and install and use msgpack-php". In daily operation, I believe many people have doubts about how to compile and install and use msgpack-php. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the questions of "how to compile and install and use msgpack-php". Next, please follow the editor to study!
Msgpack is a PECL extension that provides API for communicating with MessagePack serialization.
MessagePack is an efficient binary-based object serialization class library that can be used for cross-language communication. It can exchange structural objects between many languages like JSON; but it is faster and lighter than JSON.
download
Wget https://github.com/msgpack/msgpack-php/archive/msgpack-2.0.3.tar.gz
Decompression
Tar-zxvf msgpack-2.0.3.tar.gz cd msgpack-php-msgpack-2.0.3/
View phpize file path
$whereis phpizephpize: / usr/local/php-7.2.9/bin/phpize
Compile from source code
$. / configure$make & & make install
Modify the configuration file
Sudo vim / usr/local/php-7.2.9/etc/php.ini / / add the following extended extension=msgpack.so
Restart php-fpm to check whether the installation is successful
Sudo systemctl restart php-fpm.service
Official simple case msgpack-test.php