刚要安装workman,里面用到了php的多线程扩展 pcntl, 刚网上找了一些资料, 安装记录流程,
首先, 去php 官网下载适合自己系统的php版本~
服务器 输入 php -v
1 2 3 4 5 |
[root@zxmcloudserver ~]# php -v PHP 5.6.12 (cli) (built: Mar 25 2016 00:15:00) Copyright (c) 1997-2015 The PHP Group Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies [root@zxmcloudserver ~]# |
然后 下载php版本
http://php.net/releases/index.php
解压后进入扩展目录,找到 pcntl
执行phpize
1 2 3 4 5 |
[root@zxmcloudserver pcntl]# /www/wdlinux/php/bin/phpize Configuring for: PHP Api Version: 20131106 Zend Module Api No: 20131226 Zend Extension Api No: 220131226 |
开始编译
1 2 3 4 5 6 7 8 9 10 11 12 13 |
./configure --with-php-config=/www/wdlinux/php/bin/php-config checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for a sed that does not truncate output... /bin/sed checking for cc... cc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no ...... creating libtool appending configuration tag "CXX" to libtool configure: creating ./config.status config.status: creating config.h |
开始安装
make && make install
1 2 3 4 5 6 |
Build complete. Don't forget to run 'make test'. Installing shared extensions: /www/wdlinux/apache_php-5.6.12/lib/php/extensions/no-debug-non-zts-20131226/ [root@zxmcloudserver pcntl]# echo $? 0 |
完成后,进入 modules 目录, 把 pcntl.so 文件移动到自己的扩展目录,
然后修改php.ini
;自定义PHP扩展
extension=/opt/extends/php/swoole.so
extension=/opt/extends/php/pcntl.so
extension=”redis.so”