开启win10 BashOnWindows
安装
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| # 先升级apt-get ,不然很多包会找不到 sudo apt-get update # 所有其他你需要的扩展 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 php7.0-sqlite3 php7.0-tidy php7.0-xml php7.0-bcmath php7.0-bz2 php7.0-intl php7.0-mbstring php7.0-mcrypt php7.0-soap php7.0-xsl php7.0-zip # pecl 需要 php-pear sudo apt install php-pear # 可能提示 phpize 错误,需要 php-dev pecl install swoole # 按照提示安装 php7.0-dev sudo apt install php7.0-dev # 安装swoole pecl install swoole # 权限不够,直接 vi 新建 # 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
|
关闭HAVE_SIGNALFD
1 2 3 4 5 6 7 8
| # install 改为 download,因为需要手动修改一个配置 pecl download swoole # 解压 cd 进 swoole 目录 phpize ./configure --enable-openssl=yes 在 configure 后,将 config.h 中 #define HAVE_SIGNALFD 1 行注释掉,再进行编译安装操作后 make make install
|
开启协程http客户端的https支持
1 2
| 在 ./configure 时 4.2.13 ./configure --enable-openssl --enable-http2 --enable-sockets --enable-mysqlnd --enable-coroutine-postgresql
|
参考文献
https://www.cnblogs.com/dapianzi/p/8438457.html
https://www.jianshu.com/p/786de18c16f2