swoole僅支持Linux系統嗎

swoole僅支持Linux系統嗎

swoole只能用在LInux,macos系統上,不能用作Windows系統上,swoole 2.0正式版發布了。2.0版本最大的更新是增加了對協程(Coroutine)的支持。正式版已同時支持PHP5和PHP7。

安裝方式一: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

? 版權聲明
THE END
喜歡就支持一下吧
點贊12 分享