update README

This commit is contained in:
crazywhalecc 2023-04-09 13:38:41 +08:00
parent 62aeb6dc7b
commit e2aa21fbea
No known key found for this signature in database
GPG Key ID: 1F4BDD59391F2680
2 changed files with 42 additions and 10 deletions

View File

@ -48,16 +48,35 @@ and at the same time define the extensions to be compiled by yourself.
3. Select `Run workflow`, fill in the PHP version you want to compile, the target type, and the list of extensions.
4. After waiting for about a period of time, enter the corresponding task and get `Artifacts`.
If you enable `debug`, all logs will be output at build time, including compiled logs, for troubleshooting.
### Manual Build
```bash
chmod +x spc
# Check system tool dependencies, and show instructions for fixing
./spc doctor
# Clone first
git clone https://github.com/crazywhalecc/static-php-cli.git
cd static-php-cli
composer update
chmod +x bin/spc
# Check system tool dependencies, and show instructions for fixing (TODO)
# ./spc doctor
# fetch all libraries
./spc fetch --all
./bin/spc fetch --all
# with bcmath,openssl,tokenizer,sqlite3,pdo_sqlite,ftp,curl extension, build both CLI and phpmicro SAPI
./spc build bcmath,openssl,tokenizer,sqlite3,pdo_sqlite,ftp,curl --build-all
./bin/spc build bcmath,openssl,tokenizer,sqlite3,pdo_sqlite,ftp,curl --build-all
```
You can also use the parameter `--with-php=x.y` to specify the downloaded PHP version, currently supports 7.4 ~ 8.2:
```bash
./bin/spc fetch --with-php=8.2 --all
```
If anything goes wrong, use `--debug` option to display full terminal output:
```bash
./bin/spc build openssl --debug
./bin/spc fetch --all --debug
```
### php-cli Usage
@ -128,8 +147,7 @@ The basic principles for contributing are as follows:
## Open-Source License
This project is based on the tradition of using the MIT License for old versions,
while the new version references source code from some other projects.
Special thanks to:
while the new version references source code from some other projects:
- [dixyes/lwmbs](https://github.com/dixyes/lwmbs) (Mulun Permissive License)
- [swoole/swoole-cli](https://github.com/swoole/swoole-cli) (Apache 2.0 LICENSE+SWOOLE-CLI LICENSE)
@ -145,4 +163,4 @@ and comply with the corresponding project's LICENSE.
This project is pure open source project, and some modules are separated for developing.
This section will be improved after refactor version released.
This section will be improved after refactor version released.

View File

@ -48,6 +48,8 @@ Compile A Statically Linked PHP With Swoole and other Extensions. [English READM
3. 选择 `Run workflow`,填入你要编译的 PHP 版本、目标类型、扩展列表。
4. 等待大约一段时间后,进入对应的任务中,获取 `Artifacts`
如果你选择了 `debug`,则会在构建时输出所有日志,包括编译的日志,以供排查错误。
### 手动构建
```bash
@ -64,6 +66,19 @@ chmod +x bin/spc
./bin/spc build "bcmath,openssl,tokenizer,sqlite3,pdo_sqlite,ftp,curl" --build-all
```
你也可以使用参数 `--with-php=x.y` 来指定下载的 PHP 版本,目前支持 7.4 ~ 8.2
```bash
./bin/spc fetch --with-php=8.2 --all
```
如果出现了任何错误,可以使用 `--debug` 参数来展示完整的输出日志,以供排查错误:
```bash
./bin/spc build openssl --debug
./bin/spc fetch --all --debug
```
### 使用 php-cli
> php-cli 是一个静态的二进制文件,类似 Go、Rust 语言编译后的单个可移植的二进制文件。
@ -121,9 +136,8 @@ cat micro.sfx code.php > single-app && chmod +x single-app
## 开源协议
本项目依据旧版本惯例采用 MIT License 开源,新版本采用了部分项目的源代码做参考,特别感谢
本项目依据旧版本惯例采用 MIT License 开源,自身的部分代码引用或修改自以下项目
- [dixyes/phpmicro](https://github.com/dixyes/phpmicro)Apache 2.0 LICENSE
- [dixyes/lwmbs](https://github.com/dixyes/lwmbs)(木兰宽松许可证)
- [swoole/swoole-cli](https://github.com/swoole/swoole-cli)Apache 2.0 LICENSE、SWOOLE-CLI LICENSE