1.去php.net下载相应版本的php源文件
以php-5.5.38版本为例,在php.net找到相应版本的页面(http://cn2.php.net/get/php-5.5.38.tar.xz/from/a/mirror)。
选取一个资源链接,如http://am1.php.net/get/php-5.5.38.tar.xz/from/this/mirror。
2.在服务器,执行wget命令,下载php
wget http://am1.php.net/get/php-5.5.38.tar.xz/from/this/mirror
3.解压文件
xz -d php-5.5.38.tar.xz
tar -xvf php-5.5.38.tar
4.确定phpize的路径(如果不存在要先安装)
/usr/local/php/bin/phpize
5.确定php.ini的路径
/usr/local/php/etc/php.ini
6.cd 至pcntl目录
cd php-5.5.38/etc/pcntl
7.执行命令
/usr/local/php/bin/phpize ./configure --with-php-config=/usr/local/php/etc/php.ini

8.执行./configure命令

9.make && make install编译安装

编译完毕后会生成了一个 pcntl.so的文件。在php的model目录里
10.开启pcntl拓展extension=pcntl.so,并重启服务

11.通过浏览器访问,提示用命令行运行

12.cd到meepops所在路径
13.执行php demo-telnet.php start命令,返回成功提示。

14.打开2个新的xshell子窗口,telnet localhost 19910进行连接
在新建的窗口中输入内容,另一个新建的窗口和主窗口都会收到消息。


网友评论