mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-17 20:34:51 +08:00
Update README.md
This commit is contained in:
parent
212f1de3ae
commit
de2a38b5a2
16
README.md
16
README.md
@ -17,7 +17,7 @@ Compile A Statically Linked PHP With Swoole and other Extensions. [English READM
|
|||||||
## 运行环境需求
|
## 运行环境需求
|
||||||
Linux
|
Linux
|
||||||
|
|
||||||
## 开始
|
## 直接使用
|
||||||
|
|
||||||
1. 可以直接下面的地址下载 Actions 构建的文件。
|
1. 可以直接下面的地址下载 Actions 构建的文件。
|
||||||
|
|
||||||
@ -30,7 +30,9 @@ Linux
|
|||||||
bash <(curl -fsSL https://dl.zhamao.xin/php-bin/install-runtime.sh)
|
bash <(curl -fsSL https://dl.zhamao.xin/php-bin/install-runtime.sh)
|
||||||
```
|
```
|
||||||
|
|
||||||
3. 也可以自己使用 Dockerfile 进行编译构建:
|
## 自行编译
|
||||||
|
|
||||||
|
可以自己使用 Dockerfile 进行编译构建:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git clone https://github.com/crazywhalecc/static-php-cli.git
|
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 提取出来,用以下方式:
|
编译之后可以使用下方命令将二进制 PHP 提取出来,用以下方式:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
mkdir dist
|
mkdir dist
|
||||||
docker run --rm -v $(pwd)/dist:/dist/ -it static-php cp php-dist/bin/php /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
|
file ./php
|
||||||
```
|
```
|
||||||
|
|
||||||
|
如果你不想使用 Docker,想从Alpine环境直接编译,可以使用预置相同编译配置的脚本 `fast-compiler.sh`:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd docker
|
||||||
|
# 用于切换编译的PHP版本
|
||||||
|
export VER_PHP="8.1.6"
|
||||||
|
./fast-compiler.sh
|
||||||
|
```
|
||||||
|
|
||||||
如果要选择安装的扩展,可以修改 `docker/extensions.txt` 文件,具体规则如下:
|
如果要选择安装的扩展,可以修改 `docker/extensions.txt` 文件,具体规则如下:
|
||||||
- 文件内使用 `#` 可以注释,表示不安装
|
- 文件内使用 `#` 可以注释,表示不安装
|
||||||
- 扩展名一律使用小写,目前默认状态下文件内所列的扩展为支持的扩展,其他扩展暂不支持,如有需求请提 Issue 添加
|
- 扩展名一律使用小写,目前默认状态下文件内所列的扩展为支持的扩展,其他扩展暂不支持,如有需求请提 Issue 添加
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user