Linux
內核版本 2.3.32
以上PHP-5.3.10
以上版本,包括PHP7gcc4.4
以上版本或者clang建議使用
Ubuntu14
、CentOS7
或更高版本的操做系統php
php -v PHP 7.1.7 (cli) (built: Mar 14 2018 16:31:03) ( NTS ) gcc --version gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-16) Copyright (C) 2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. cat /proc/version Linux version 3.10.0-514.26.2.el7.x86_64 (builder@kbuilder.dev.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-11) (GCC) ) uname -a Linux VM_27_0_centos 3.10.0-514.26.2.el7.x86_64 pecl install swoole Build process completed successfully Installing '/usr/local/php/lib/php/extensions/no-debug-non-zts-20160303/swoole.so' install ok: channel://pecl.php.net/swoole-1.10.2 Extension swoole enabled in php.ini
我是使用PECL 安裝 OK 都沒問題 還有另外一種編譯的python
安裝swoole前必須保證系統已經安裝了下列軟件mysql
php-5.3.10 或更高版本 gcc-4.4 或更高版本 make autoconf pcre (centos系統能夠執行命令:yum install pcre-devel)
下載源代碼包後,在終端進入源碼目錄,執行下面的命令進行編譯和安裝git
cd swoole phpize ./configure make sudo make install
編譯安裝成功後,修改php.ini加入github
extension=swoole.so
經過或來查看是否成功加載了swoole,若是沒有多是的路徑不對,可使用來定位到的絕對路徑
php -mphpinfo()php.iniphp --iniphp.ini
php -m
[PHP Modules]
bcmath
Core
ctype
curl
date
dom
filter
ftp
gd
gettext
hash
iconv
intl
json
libxml
mbstring
mcrypt
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
Reflection
session
shmop
SimpleXML
soap
sockets
SPL
sqlite3
standard
swoole
sysvsem
tokenizer
xml
xmlreader
xmlrpc
xmlwriter
xsl
zip
zlib
OK 確實 使用pecl會給自動加上,上邊也提示了sql
Extension swoole enabled in php.ini