Install Swoole, Yar, and Yaf in PHP 7.

Source: Internet
Author: User

Install Swoole, Yar, and Yaf in PHP 7.

This article develops a bad environment:

  • CentOS 7
  • PHP 7.0.16

Install PECL

// Php version> 7 $ wget http://pear.php.net/go-pear.phar$ php go-pear.phar // php version <7 $ yum install php-pear // otherwise PHP Parse error: syntax error, unexpected // 'new' (T_NEW) in/usr/share/pear/PEAR/Frontend. php on // line 91

Install swoole

$ Sudo pecl install swoole // the following error is reported // Warning: Invalid argument supplied for foreach () in // Command. php on line 249vi 'which pecl' // find the 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 // the following error is reported // running: phpize // Can't find PHP headers in/usr/include/php // install php-develsudo yum install Php70w-devel successful! // 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

Install 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 the yar-2.0.2 version // Add, json. so should be put in front. Otherwise, // PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/yar will be reported. so '-/usr/lib64/php/modules/yar. so: undefined symbol: php_json_decode_ex in Unknown on line 0 extension = json. so // put extension = msgpack in front. soextension = yar. so // restart php service sudo systemctl restart php-fpm.service // other error // perl: warning: Setting locale failed. // perl: warning: Please check that 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 errors // checking for cURL in default path... not found // configure: error: Please reinstall the libcurl distribution-easy. h shoshould be in <curl-dir>/include/curl/$ sudo yum-y install curl-devel // install Yaf $ sudo. /pecl install yaf // update php. iniextension = yaf. so // restart the service $ sudo systemctl restart php-fpm.service // install scaffolding $ git clone http://pecl.php.net/package/yaf$ cd php-yaf/tools/cg $ php yaf-cg app // configure the project directory to point to app/ index. php // access the host Configuration

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!

Summary

The above is all the content of this article. I hope the content of this article will help you in your study or work. If you have any questions, please leave a message, thank you for your support.

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.