swoole/swoole-cli

能不能出个编译工具或者啥的

LIngMax opened this issue · 11 comments

类似这种复制命令
https://static-php.dev/zh/guide/cli-generator.html

或者阿里云镜像 我花钱开个机器 用你们定好的镜像编译也行

我只想加几个扩展 编译进去 又是学容器又是学编译脚本的太晕了

定制php版本 定制插件太难了

有啊,只是比较简陋而已,暂时没时间弄

https://swoole-cli-ui.jingjingxyk.com/
webui 源码在这里: #165

最简单的就是下载源码: 复制 build-release-example.sh 生成一个新文件,然后修改这个新文件即可

找到这行,增减扩展即可: https://github.com/swoole/swoole-cli/blob/main/build-release-example.sh#L191

指定 PHP 版本,使用 build_native_php 分支,或者 https://github.com/swoole/build-static-php

类似这种复制命令 https://static-php.dev/zh/guide/cli-generator.html

或者阿里云镜像 我花钱开个机器 用你们定好的镜像编译也行

我只想加几个扩展 编译进去 又是学容器又是学编译脚本的太晕了

定制php版本 定制插件太难了

拉取代码 ,然后准备容器, 自己定制需要的扩展,就可以开始编译了。https://github.com/swoole/swoole-cli/tree/main/sapi/quickstart

开个高配置的 抢占式 云服务器 ,10分钟左右就构建完毕了(从0 到 完成)

https://github.com/jingjingxyk/swoole-cli/tree/build_php_7.3

php 7.3 我想安装 memcached 和mongodb 移除redis

php prepare.php +mongodb +memcached -redis
--with-swoole-pgsql=1 --with-libavif=1
--with-php-version=7.3.33
--with-build-type=release
--with-c-compiler=clang
--with-install-library-cached=1

要调整这里? 里面附加扩展有文档吗 ?
./prepare.php --conf-path="/tmp/swoole-cli/conf1:/tmp/swoole-cli/conf2"
https://pecl.php.net/package/mongodb
https://pecl.php.net/package/memcached/3.2.0

7.4.33也行 旧代码移植到8太困难

https://github.com/jingjingxyk/swoole-cli/tree/build_php_7.3

php 7.3 我想安装 memcached 和mongodb 移除redis

php prepare.php +mongodb +memcached -redis --with-swoole-pgsql=1 --with-libavif=1 --with-php-version=7.3.33 --with-build-type=release --with-c-compiler=clang --with-install-library-cached=1

要调整这里? 里面附加扩展有文档吗 ? ./prepare.php --conf-path="/tmp/swoole-cli/conf1:/tmp/swoole-cli/conf2" https://pecl.php.net/package/mongodb https://pecl.php.net/package/memcached/3.2.0

7.4.33也行 旧代码移植到8太困难

稍等一会,我把代码推上来

谢谢大佬
奈斯

@LIngMax 已经合并到 build_php_7.3
编译结果:https://github.com/jingjingxyk/swoole-cli/actions/runs/10861004482

编译步骤:

linux 版

git clone -b build_php_7.3 https://github.com/jingjingxyk/swoole-cli.git
cd swoole-cli

bash setup-php-runtime.sh

__DIR__=$(pwd)
export PATH="${__DIR__}/bin/runtime:$PATH"
alias php="php -c ${__DIR__}/bin/runtime/php.ini"

composer install --no-interaction --no-autoloader --no-scripts --prefer-dist -vv --profile # --no-dev
composer dump-autoload --optimize --profile

php prepare.php +memcached --skip-download=1

bash sapi/quickstart/linux/run-alpine-container.sh
bash sapi/quickstart/linux/connection-swoole-cli-alpine.sh
sh     sapi/quickstart/linux/alpine-init.sh

php prepare.php +memcached 

bash make-install-deps.sh
bash make.sh all-library
bash make.sh config
bash make.sh build
bash make.sh archive

补充工具

安装docker

构建主机未安装docker 情况下,需要此命令

bash sapi/quickstart/linux/install-docker.sh

可使用**大陆镜像加速构建 的命令


git clone -b build_php_7.3 https://gitee.com/jingjingxyk/swoole-cli.git

bash sapi/quickstart/linux/install-docker.sh --mirror china

composer config -g repos.packagist composer https://mirrors.tencent.com/composer/
composer install --no-interaction --no-autoloader --no-scripts --prefer-dist -vv --profile # --no-dev
composer dump-autoload --optimize --profile
composer config -g repos.packagist composer https://packagist.org


bash setup-php-runtime.sh --mirror china


使用代理下载源码包

php prepare.php +memcached  --with-http-proxy=socks5h://127.0.0.1:7890"

谢谢 大大

快速开始命令 (精简命令)

git clone -b build_php_7.3 https://github.com/jingjingxyk/swoole-cli.git
cd swoole-cli

bash sapi/quickstart/linux/run-alpine-container.sh
bash sapi/quickstart/linux/connection-swoole-cli-alpine.sh

cp build-release-example.sh   build-release-php.sh

# 编辑 build-release-php.sh 文件

## 开始执行构建

bash build-release-php.sh

编辑 build-release-php.sh 文件 示例

image image

这些分支build_php_7.3 build_php_7.4 build_php_8.0 build_native_php 都新增加上了 memcached 扩展