Home  >  Article  >  PHP Framework  >  Workerman installation and problem solving

Workerman installation and problem solving

尚
forward
2019-11-25 14:08:022806browse

The following column workerman Getting Started Tutorial will introduce you to the installation of Workerman and the solutions to the problems encountered. I hope it will be helpful to friends in need!

Workerman installation and problem solving

1. Workerman installation

workerman is a socket framework of PHP, which simplifies socket programming and has been used by many enterprises. Today I installed workererman under ngix php in centos. The process is recorded as follows.

Tutorial given on the official website:

Workerman installation and problem solving

But I have already installed the php environment, so I skip the steps 1, 2, 3, and 4 above and go directly Download the workerman zip package and install it in step 5.

Enter the workerman directory to install as follows. Prompt error

[root@localhost server]# ls
mysql         nginx-1.4.4  phpredis             workerman
mysql-5.6.21  php          redis-2.8.19
nginx         php-5.5.7    redis-2.8.19.tar.gz
[root@localhost server]# cd workerman/
[root@localhost workerman]# cd workerman/
[root@localhost workerman]# ls
bin  Common  conf  Core  logs
[root@localhost workerman]# cd bin
[root@localhost bin]# ls
workermand
[root@localhost bin]# ./workermand start
Workerman is starting ...
----------------------- EXTENSION ------------------------------
* pcntl                     [NOT SUPORT BUT REQUIRED] 

You have to enable pcntl 

Workerman start fail

The extension pcntl is missing. This extension is required by Workerman. This extension is included in the php package, but I did not have --enable-pcntl when compiling php. As expected, it is in the php source code package. Found this extension source code package, the following is to add this extension.

After adding this extension, restart php-fpm, nginx, and open workererman again

[root@localhost bin]# ./workermand start
Workerman is starting ...
----------------------- EXTENSION ------------------------------
* sysvshm                    [NOT SUPORT] 
* sysvmsg                    [NOT SUPORT] 
* libevent                   [NOT SUPORT] 
------------------------ WORKERS -------------------------------
user  worker             listen                             processes  status
root  BusinessWorker     none                                32         [OK] 
root  Gateway            tcp://0.0.0.0:8480                  4          [OK] 
root  StatisticProvider  tcp://0.0.0.0:55858                 1          [OK] 
root  StatisticWeb       tcp://0.0.0.0:55757                 1          [OK] 
root  StatisticWorker    udp://0.0.0.0:55656                 1          [OK] 
----------------------------------------------------------------
Workerman start success ...

workerman is installed successfully.

For more workerman knowledge, please pay attention to the workerman tutorial column.

The above is the detailed content of Workerman installation and problem solving. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:cnblogs.com. If there is any infringement, please contact admin@php.cn delete