Beginner Swoole: PHP7 step of mounting Swoole

The contents of this article is to give us the beginner Swoole: PHP7 Swoole installation steps, there is a certain reference value, a friend in need can refer to, I hope for your help.

 

surroundings

Here it is not in use apache as web server. The use nginx + php-fpm, more powerful, more convenient configuration. And in order to keep pace with php, but also the use of a relatively new version of php

  • [x] centos7
  • [x] php7.0.12
  • [x] nginx/1.10.2
  • [x] php-fpm

Download swoole

First, download the swoole source package, this operation is very simple, there is not much to say. (No wget: brew install wget - mac)

wget -c https://github.com/swoole/swoole-src/archive/v2.0.6.tar.gz 

解压: tar -zxvf v2.0.6.tar.gz

cd swoole-src-2.0.6/

Compile & installation

Use phpize to generate compile php configuration

./configure  do compile configuration detection

compile make, make install to install

Command:

[root@php7 swoole-src-2.0.6]# phpize

[root@php7 swoole-src-2.0.6]# ./configure

[root@php7 swoole-src-2.0.6]# make && make install

After make install, if correct, there will be the following

[root@php7 swoole-src-2.0.6]# make install

Installing shared extensions:     /usr/lib64/php/modules/

This means that, in  /usr/lib64/php/modules/ the directory, successfully generated  swoole.so file

Modify the configuration file

(Directly applied directly to the extension in the extension = swoole.so in /usr/local/php5-7.0.12-20161101-102255/lib/php.ini)

To be able to use the module, you also need to add the module in the php.ini file.

It should be noted, php7 module configuration files are individually separated.

You can find the following in php.ini

;;;;
; Note: packaged extension modules are now loaded via the .ini files
; found in the directory /etc/php.d; these are loaded by default.
;;;;

Therefore, if your php installation, if no special settings, you can /etc/php.d catalog, find the configuration file to add the module.

Into the  cd /etc/php.d  directory, complete the relevant configuration

[root@php7 swoole-src-2.0.6]# vim swoole.ini

; Enable swoole extension module

extension=swoole.so

Restart Service

echo phpinfo (); see if loaded swoole success

 

 

Installation ide-helper:

Cloning the following address:

https://github.com/eaglewu/swoole-ide-helper.git​github.com

Guess you like

Origin www.cnblogs.com/a609251438/p/12078347.html