mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-17 20:34:51 +08:00
update README for embed SAPI
This commit is contained in:
parent
3183ecceaf
commit
01c4538ce0
14
README-en.md
14
README-en.md
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
Build single static PHP binary, with PHP project together, with popular extensions included.
|
Build single static PHP binary, with PHP project together, with popular extensions included.
|
||||||
|
|
||||||
The project name is static-php-cli, but it actually supports cli, fpm, micro and embed (on the way) SAPI 😎
|
The project name is static-php-cli, but it actually supports cli, fpm, micro and embed SAPI 😎
|
||||||
|
|
||||||
Compile a purely static php-cli binary file with various extensions to make PHP applications more portable! (cli SAPI)
|
Compile a purely static php-cli binary file with various extensions to make PHP applications more portable! (cli SAPI)
|
||||||
|
|
||||||
@ -126,6 +126,7 @@ Now we support `cli`, `micro`, `fpm`, you can use one or more of the following p
|
|||||||
- `--build-cli`: build static cli executable
|
- `--build-cli`: build static cli executable
|
||||||
- `--build-micro`: build static phpmicro self-extracted executable
|
- `--build-micro`: build static phpmicro self-extracted executable
|
||||||
- `--build-fpm`: build static fpm binary
|
- `--build-fpm`: build static fpm binary
|
||||||
|
- `--build-embed`: build embed (libphp)
|
||||||
- `--build-all`: build all
|
- `--build-all`: build all
|
||||||
|
|
||||||
If anything goes wrong, use `--debug` option to display full terminal output:
|
If anything goes wrong, use `--debug` option to display full terminal output:
|
||||||
@ -194,9 +195,18 @@ Because php-fpm must specify a configuration file before running, the php-fpm co
|
|||||||
|
|
||||||
Specifying `php-fpm.conf` can use the command parameter `-y`, for example: `./php-fpm -y php-fpm.conf`.
|
Specifying `php-fpm.conf` can use the command parameter `-y`, for example: `./php-fpm -y php-fpm.conf`.
|
||||||
|
|
||||||
|
### Embed Usage
|
||||||
|
|
||||||
|
When using the project parameters `--build-embed` or `--build-all`,
|
||||||
|
the final compilation result will output a `libphp.a`, `php-config` and a series of header files,
|
||||||
|
stored in `buildroot/`, You can introduce them in your other projects.
|
||||||
|
|
||||||
|
If you know embed SAPI, you should know how to use it.
|
||||||
|
You may require the introduction of other libraries during compilation,
|
||||||
|
you can use `buildroot/bin/php-config` to obtain the compile-time configuration.
|
||||||
|
|
||||||
## Contribution
|
## Contribution
|
||||||
|
|
||||||
Currently, there are only a few supported extensions.
|
|
||||||
If the extension you need is missing, you can create an issue.
|
If the extension you need is missing, you can create an issue.
|
||||||
If you are familiar with this project, you are also welcome to initiate a pull request.
|
If you are familiar with this project, you are also welcome to initiate a pull request.
|
||||||
|
|
||||||
|
|||||||
13
README.md
13
README.md
@ -19,7 +19,7 @@ Build single static PHP binary, with PHP project together, with popular extensio
|
|||||||
[]()
|
[]()
|
||||||
[]()
|
[]()
|
||||||
|
|
||||||
> 项目名称是 static-php-cli,但其实支持 cli、fpm、micro 和 embed(正在路上)SAPI 😎
|
> 项目名称是 static-php-cli,但其实支持 cli、fpm、micro 和 embed SAPI 😎
|
||||||
|
|
||||||
## 编译环境需求
|
## 编译环境需求
|
||||||
|
|
||||||
@ -120,6 +120,7 @@ chmod +x bin/spc
|
|||||||
- `--build-cli`:构建 cli 二进制
|
- `--build-cli`:构建 cli 二进制
|
||||||
- `--build-micro`:构建 phpmicro 自执行二进制
|
- `--build-micro`:构建 phpmicro 自执行二进制
|
||||||
- `--build-fpm`:构建 fpm
|
- `--build-fpm`:构建 fpm
|
||||||
|
- `--build-embed`:构建 embed(libphp)
|
||||||
- `--build-all`:构建所有
|
- `--build-all`:构建所有
|
||||||
|
|
||||||
如果出现了任何错误,可以使用 `--debug` 参数来展示完整的输出日志,以供排查错误:
|
如果出现了任何错误,可以使用 `--debug` 参数来展示完整的输出日志,以供排查错误:
|
||||||
@ -181,9 +182,15 @@ cat micro.sfx code.php > single-app && chmod +x single-app
|
|||||||
|
|
||||||
指定 `php-fpm.conf` 可以使用命令参数 `-y`,例如:`./php-fpm -y php-fpm.conf`。
|
指定 `php-fpm.conf` 可以使用命令参数 `-y`,例如:`./php-fpm -y php-fpm.conf`。
|
||||||
|
|
||||||
|
### 使用 php-embed
|
||||||
|
|
||||||
|
采用项目参数 `--build-embed` 或 `--build-all` 时,最后编译结果会输出一个 `libphp.a`、`php-config` 以及一系列头文件,存放在 `buildroot/`,你可以在你的其他代码中引入它们。
|
||||||
|
|
||||||
|
如果你知道 embed SAPI,你应该知道如何使用它。对于有可能编译用到引入其他库的问题,你可以使用 `buildroot/bin/php-config` 来获取编译时的配置。
|
||||||
|
|
||||||
## 贡献
|
## 贡献
|
||||||
|
|
||||||
目前支持的扩展较少,如果缺少你需要的扩展,可发起 Issue。如果你对本项目较熟悉,也欢迎为本项目发起 Pull Request。
|
如果缺少你需要的扩展,可发起 Issue。如果你对本项目较熟悉,也欢迎为本项目发起 Pull Request。
|
||||||
|
|
||||||
贡献基本原则如下:
|
贡献基本原则如下:
|
||||||
|
|
||||||
@ -202,7 +209,7 @@ cat micro.sfx code.php > single-app && chmod +x single-app
|
|||||||
|
|
||||||
## 开源协议
|
## 开源协议
|
||||||
|
|
||||||
本项目依据旧版本惯例采用 MIT License 开源,自身的部分代码引用或修改自以下项目:
|
本项目依据旧版本惯例采用 MIT License 开源,部分扩展的集成编译命令参考或修改自以下项目:
|
||||||
|
|
||||||
- [dixyes/lwmbs](https://github.com/dixyes/lwmbs)(木兰宽松许可证)
|
- [dixyes/lwmbs](https://github.com/dixyes/lwmbs)(木兰宽松许可证)
|
||||||
- [swoole/swoole-cli](https://github.com/swoole/swoole-cli)(Apache 2.0 LICENSE、SWOOLE-CLI LICENSE)
|
- [swoole/swoole-cli](https://github.com/swoole/swoole-cli)(Apache 2.0 LICENSE、SWOOLE-CLI LICENSE)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user