码迷,mamicode.com
首页 > Windows程序 > 详细

windows 子系统 Ubuntu18.04 安装 swoole

时间:2018-05-21 01:00:11      阅读:2112      评论:0      收藏:0      [点我收藏+]

标签:data-   pre   packagist   ubunt   repo   load   perl   code   upgrade   

首先安装composer并改为国内镜像

1.sudo apt-get install composer

composer config -g repo.packagist composer https://packagist.phpcomposer.com

安装环境

1. sudo apt-get install nginx-light

2. sudo apt-get install php7.0 php7.0-curl php7.0-gd php7.0-gmp php7.0-json php7.0-mysql php7.0-opcache php7.0-readline 

3.sudo apt install php-pear

4.sudo pecl install swoole

5.echo ‘extension=swoole.so‘ >> /etc/php/7.0/mods-available/swoole.ini

cd /etc/php/7.0/cli/conf.d/ && ln -s ../../mods-available/swoole.ini 20-swoole.ini
cd /etc/php/7.0/fpm/conf.d/ && ln -s ../../mods-available/swoole.ini 20-swoole.ini

sudo composer create-project easyswoole/app easyswoole

php easyswoole start
  • BashOnWindows 环境下必须关闭 daemonize 选项
  • 需要修改 config.h 关闭 HAVE_SIGNALFD
 

一些问题:

  如果出现 sh: phpize: command not found

  可以尝试 sudo apt-get install php-dev

  如果出现

  No releases available for package "pecl.php.net/swoole"
  install failed

  尝试:pear clear-cache
  pear update-channels
  pear upgrade

如果:Failed to download nikic/fast-route from dist: The zip extension and unzip command are both missing, skipping.
sudo apt-get install php-zip

windows 子系统 Ubuntu18.04 安装 swoole

标签:data-   pre   packagist   ubunt   repo   load   perl   code   upgrade   

原文地址:https://www.cnblogs.com/qiapin/p/wsl-php-swoole-install.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!