diff --git a/docs/en/guide/env-vars.md b/docs/en/guide/env-vars.md index 10581733..11cf9339 100644 --- a/docs/en/guide/env-vars.md +++ b/docs/en/guide/env-vars.md @@ -39,6 +39,21 @@ Or, if you need to modify an environment variable for a long time, you can modif For example, if you need to modify the `./configure` command for compiling PHP, you can find the `SPC_CMD_PREFIX_PHP_CONFIGURE` environment variable in the `config/env.ini` file, and then modify its value. +If your build conditions are more complex and require multiple `env.ini` files to switch, +we recommend that you use the `config/env.custom.ini` file. +In this way, you can specify your environment variables by writing additional override items +without modifying the default `config/env.ini` file. + +```ini +; This is an example of `config/env.custom.ini` file, +; we modify the `SPC_CONCURRENCY` and linux default CFLAGS passing to libs and PHP +[global] +SPC_CONCURRENCY=4 + +[linux] +SPC_DEFAULT_C_FLAGS="-O3" +``` + ## Library environment variables (Unix only) Starting from 2.2.0, static-php-cli supports custom environment variables for all compilation dependent library commands of macOS, Linux, FreeBSD and other Unix systems. diff --git a/docs/en/guide/index.md b/docs/en/guide/index.md index 6ae37db7..9f9bee4c 100644 --- a/docs/en/guide/index.md +++ b/docs/en/guide/index.md @@ -5,14 +5,10 @@ currently supporting Linux and macOS systems. In the guide section, you will learn how to use static php cli to build standalone PHP programs. -- [GitHub Action Build](./action-build) -- [Manual Build](./manual-build) +- [Build (local)](./manual-build) +- [Build (GitHub Actions)](./action-build) - [Supported Extensions](./extensions) -::: tip -If you are a native English speaker, some corrections to the documentation are welcome. -::: - ## Compilation Environment The following is the architecture support situation, where :gear: represents support for GitHub Action build, diff --git a/docs/en/guide/troubleshooting.md b/docs/en/guide/troubleshooting.md index 0dbb17d5..57898ed3 100644 --- a/docs/en/guide/troubleshooting.md +++ b/docs/en/guide/troubleshooting.md @@ -31,3 +31,5 @@ and then determine the command that reported the error. The error terminal output is very important for fixing compilation errors. When submitting an issue, please upload the last error fragment of the terminal log (or the entire terminal log output), and include the `spc` command and parameters used. + +If you are rebuilding, please refer to the [Local Build - Multiple Builds](./manual-build#multiple-builds) section. diff --git a/docs/zh/guide/env-vars.md b/docs/zh/guide/env-vars.md index 7a42d32c..9a2f9deb 100644 --- a/docs/zh/guide/env-vars.md +++ b/docs/zh/guide/env-vars.md @@ -36,6 +36,19 @@ SPC_CONCURRENCY=4 bin/spc build mbstring,pcntl --build-cli 例如,你需要修改编译 PHP 的 `./configure` 命令,你可以在 `config/env.ini` 文件中找到 `SPC_CMD_PREFIX_PHP_CONFIGURE` 环境变量,然后修改其值即可。 +但如果你的构建条件比较复杂,需要多种 env.ini 进行切换,我们推荐你使用 `config/env.custom.ini` 文件,这样你可以在不修改默认的 `config/env.ini` 文件的情况下, +通过写入额外的重载项目指定你的环境变量。 + +```ini +; This is an example of `config/env.custom.ini` file, +; we modify the `SPC_CONCURRENCY` and linux default CFLAGS passing to libs and PHP +[global] +SPC_CONCURRENCY=4 + +[linux] +SPC_DEFAULT_C_FLAGS="-O3" +``` + ## 编译依赖库的环境变量(仅限 Unix 系统) 从 2.2.0 开始,static-php-cli 对所有 macOS、Linux、FreeBSD 等 Unix 系统的编译依赖库的命令均支持自定义环境变量。 diff --git a/docs/zh/guide/troubleshooting.md b/docs/zh/guide/troubleshooting.md index 22b36f81..566850cf 100644 --- a/docs/zh/guide/troubleshooting.md +++ b/docs/zh/guide/troubleshooting.md @@ -18,3 +18,5 @@ 遇到编译错误时,如果没有开启 `--debug` 日志,请先开启调试日志,然后确定报错的命令。 报错的终端输出对于修复编译错误非常重要,请在提交 Issue 时一并将终端日志的最后报错片段(或整个终端日志输出)上传,并且包含使用的 `spc` 命令和参数。 + +如果你是重复构建,请参考 [本地构建 - 多次构建](./manual-build#多次构建) 章节,清理构建缓存后再次构建。