测试服务器是centos6.5,php5.4
============== 服务器环境 ==============
先检查服务器是否有
gcc-4.4+
make
autoconf
这三个软件,用【rpm -qa | grep 软件包名称】查看
其中gcc版本要>4.4+,用【gcc -v】查看
============== swoole编译安装 ==============
进入/usr/local/src目录(这个可以自定义)
cd /usr/local/src
wget http://pecl.php.net/get/swoole-1.9.6.tgz
tar zxvf swoole-1.9.6.tgz
cd swoole-1.9.6
/www/server/php/54/bin/phpize【我phpize在这个绝对路径】
./configure --with-php-config=/www/server/php/54/bin/php-config【这个/www/server/php/54/bin/php-config是你php-config文件的绝对路径】
make
make install
这样一来swoole就安装完毕,打开php.ini
extension=swoole.so
加入这行代码并保存
用命令【php -m | grep swoole】查看swoole是否安装成功
成功则显示swoole
用命令【php --ri swoole | grep Version】查看swoole版本
Version => 1.9.6
============== 安装telnet ==============
rpm -qa | grep telnet
如果什么都不显示。说明你没有安装telnet
yum install xinetd
yum install telnet
yum install telnet-server
装好telnet服务之后,默认是不开启服务的,下面我们需要修改文件来开启服务。
vim /etc/xinetd.d/telnet 修改 disable = yes 为 disable = no
最后
service xinetd restart
使用telnet
telent 127.0.0.1 9501
退出就ctrl+],再输入close即可
===================================================