From e2aa21fbeaf66561fcccf24a380de2e2d4953492 Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Sun, 9 Apr 2023 13:38:41 +0800 Subject: [PATCH] update README --- README-en.md | 34 ++++++++++++++++++++++++++-------- README.md | 18 ++++++++++++++++-- 2 files changed, 42 insertions(+), 10 deletions(-) diff --git a/README-en.md b/README-en.md index ec2a2d44..fd25e6b9 100755 --- a/README-en.md +++ b/README-en.md @@ -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. \ No newline at end of file +This section will be improved after refactor version released. diff --git a/README.md b/README.md index a44b1001..797154a2 100755 --- a/README.md +++ b/README.md @@ -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)