How to install yar extension in php7 and php7yar

Source: Internet
Author: User

How to install yar extension in php7 and php7yar

This article describes how to install yar extension in php7. We will share this with you for your reference. The details are as follows:

To experience the RPC framework Yar, You need:

1. Install the binary packaging protocol msgpack

2. Install yar extension and dependency

1. Install the binary packaging protocol msgpack

1. There are many ways to install the PHP expansion package. Of course, nothing is more violent than pecl. before using this, check whether phpize exists.

find / -name phpize

2. If phpize does not exist

yum install php-devel

3. OK. Install msgpack first.

pecl install msgpack

A lot of compilation procedures are skipped during installation, and ING only cares about the last few lines.

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

After msgpack. so is installed, it is automatically copied to the php extension library and configured.

Ii. Install yar

1. Download yar

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

2. decompress and compile

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

Problems:

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

3. Install curl-devel

yum -y install curl-develsudo apt-get install libcurl4-gnutls-dev

Ps: curl vs curl-deval

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

4. Install yar

make && make install

5. Copy yar. so to the php extension library.

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

6. extended write configuration file

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

7. Restart php-fpm nginx

service php7.0-fpm restartservice nginx restart

Ps: php-ir query phpinfo

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.