Swoole是否只能在Linux环境下运行?
- 内容介绍
- 文章标签
- 相关推荐
本文共计258个文字,预计阅读时间需要2分钟。
相关专题
安装方式一:pecl安装 (推荐学习: swoole视频教程)
适用于php7.0以上版本
centOS中:
#pecl install swoole
报错:-bash: pecl: command not found
解决:yum install php-devel php-pear
ubuntu中:
#pecl install swoole
报错:No releases available for package "pecl.php.net/swoole"
解决:
#pear clear-cache #pear update-channels #pear upgrade
安装方式二:编译安装
适用于php5.3以上版本
centOS中:
在此网站http://pecl.php.net/package/swoole选择合适的版本,我用的是1.10.5
#wget http://pecl.php.net/get/swoole-1.10.5.tgz #tar -zxvf swoole-1.10.5.tgz #cd swoole-1.10.5 #phpize #./configure #make #make install
在php.ini加入一行:extension=swoole.so
重启apache,#systemctl restart httpd.service
通过php -m或phpinfo查看是否安装成功
ubuntu中:
报错:没有phpize
解决:#sudo apt-get install php5.6-dev //我的是php5.6
其他同centOS类似
重启apache,#/etc/init.d/apache2 restar
本文共计258个文字,预计阅读时间需要2分钟。
相关专题
安装方式一:pecl安装 (推荐学习: swoole视频教程)
适用于php7.0以上版本
centOS中:
#pecl install swoole
报错:-bash: pecl: command not found
解决:yum install php-devel php-pear
ubuntu中:
#pecl install swoole
报错:No releases available for package "pecl.php.net/swoole"
解决:
#pear clear-cache #pear update-channels #pear upgrade
安装方式二:编译安装
适用于php5.3以上版本
centOS中:
在此网站http://pecl.php.net/package/swoole选择合适的版本,我用的是1.10.5
#wget http://pecl.php.net/get/swoole-1.10.5.tgz #tar -zxvf swoole-1.10.5.tgz #cd swoole-1.10.5 #phpize #./configure #make #make install
在php.ini加入一行:extension=swoole.so
重启apache,#systemctl restart httpd.service
通过php -m或phpinfo查看是否安装成功
ubuntu中:
报错:没有phpize
解决:#sudo apt-get install php5.6-dev //我的是php5.6
其他同centOS类似
重启apache,#/etc/init.d/apache2 restar

