From de2a38b5a22d7c06064bc325e1e95d1fbc691ce0 Mon Sep 17 00:00:00 2001 From: Jerry Ma Date: Sun, 15 May 2022 00:57:14 +0800 Subject: [PATCH] Update README.md --- README.md | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3a98a26c..09f9530b 100755 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Compile A Statically Linked PHP With Swoole and other Extensions. [English READM ## 运行环境需求 Linux -## 开始 +## 直接使用 1. 可以直接下面的地址下载 Actions 构建的文件。 @@ -30,7 +30,9 @@ Linux bash <(curl -fsSL https://dl.zhamao.xin/php-bin/install-runtime.sh) ``` -3. 也可以自己使用 Dockerfile 进行编译构建: +## 自行编译 + +可以自己使用 Dockerfile 进行编译构建: ```bash git clone https://github.com/crazywhalecc/static-php-cli.git @@ -39,6 +41,7 @@ docker build -t static-php . --build-arg USE_BACKUP_ADDRESS=no --build-arg COMPI ``` 编译之后可以使用下方命令将二进制 PHP 提取出来,用以下方式: + ```bash mkdir dist docker run --rm -v $(pwd)/dist:/dist/ -it static-php cp php-dist/bin/php /dist/ @@ -46,6 +49,15 @@ cd dist file ./php ``` +如果你不想使用 Docker,想从Alpine环境直接编译,可以使用预置相同编译配置的脚本 `fast-compiler.sh`: + +```bash +cd docker +# 用于切换编译的PHP版本 +export VER_PHP="8.1.6" +./fast-compiler.sh +``` + 如果要选择安装的扩展,可以修改 `docker/extensions.txt` 文件,具体规则如下: - 文件内使用 `#` 可以注释,表示不安装 - 扩展名一律使用小写,目前默认状态下文件内所列的扩展为支持的扩展,其他扩展暂不支持,如有需求请提 Issue 添加