Share a tutorial on installing swoole and Yar,yaf in PHP 7

Source: Internet
Author: User
Tags pear
Weekend busy, play Swoole, so the following this article is mainly to introduce you in PHP 7 installation swoole and Yar,yaf method tutorial, the article introduced in very detailed, for everyone has a certain reference learning value, the need for friends below to see together.

This article develops the bad environment:

    • CentOS 7

    • PHP 7.0.16

Installing PECL

PHP version > 7$ wget http://pear.php.net/go-pear.phar$ php go-pear.phar//php version < 7$ yum Install php-pear//otherwise it will error PHP Pars E error:syntax error, unexpected//' new ' (t_new) in/usr/share/pear/pear/frontend.php on//line 91

Installing Swoole

$ sudo pecl install swoole//error as follows//warning:invalid argument supplied for foreach () in//command.php on line 249vi ' which p ECL '//Find last line exec $PHP-c-n-q $INCARG-D date.timezone=utc-d output_buffering=1-d variables_order=egpcs-d safe_mode=0 -D register_argc_argv= "on" $INCDIR/peclcmd.php "$@" Remove the-n mark//error as follows//running:phpize//can ' t find PHP headers In/usr/includ e/php//installation Php-develsudo Yum install Php70w-devel success! Build process completed successfully//installing '/usr/lib64/php/modules/swoole.so '//install ok:channel:// pecl.php.net/swoole-1.9.8

Configure PHP.ini

$ php-i | grep php.ini//Modify or add extension=swoole.so

Installing Yar and YAF

$ sudo./pecl install Msgpack//pecl/yar requires PHP (version >= 5.2.0, version <= 5.6.99), installed version is 7.0 .16//note PHP7, to use yar-2.0.2$ sudo./pecl Install yar-2.0.2//Note yar-2.0.2 Version//Add, json.so to put in front. Otherwise it will be reported//php warning:php startup:unable to load Dynamic Library '/usr/lib64/php/modules/yar.so '-/usr/lib64/php/modules/y ar.so:undefined symbol:php_json_decode_ex in Unknown on line 0extension=json.so//Put front extension=msgpack.soextension= yar.so//Restart PHP service sudo systemctl restart php-fpm.service//other error//perl:warning:setting locale failed.//perl:warning: Please check this your locale//settings://LANGUAGE = (unset),//Lc_all = (unset),//LANG = "en_US. UTF-8 "$ localedef-v-c-i en_us-f UTF-8 en_US.  utf-8//other error//checking for CURL in default path ... not found//configure:error:please reinstall the Libcurl distribution- Easy.h should is in <curl-dir>/include/curl/$ sudo yum-y install curl-devel//installation yaf$ sudo./PECL installed yaf//update php . iniextension=yaf.so//Restart Service $ sudo systemctL Restart php-fpm.service//installation scaffolding $ git clone http://pecl.php.net/package/yaf$ cd php-yaf/tools/cg$ php YAF-CG app//Configuration project directory Point to app/index.php//Access configuration host

Nginx Configuration

server {Listen * * *; server_name domain.com; root document_root; index index.php index.html index.htm;  if (!-e $request _filename) {rewrite ^/(. *)/index.php/$1 last;}}

Enjoy it!

Related Article

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.