|
1 | 1 | # Build (Linux, macOS, FreeBSD)
|
2 | 2 |
|
3 | 3 | This section covers the build process for Linux, macOS, and FreeBSD. If you want to build on Windows,
|
4 |
| -please go to [Build on Windows](./build-on-windows). |
| 4 | +also need to read [Build on Windows](./build-on-windows). |
5 | 5 |
|
6 |
| -### Build locally (using SPC binary) |
| 6 | +### Build locally (using SPC binary) (recommended) |
7 | 7 |
|
8 | 8 | This project provides a binary file of static-php-cli.
|
9 | 9 | You can directly download the binary file of the corresponding platform and then use it to build static PHP.
|
10 | 10 | Currently, the platforms supported by `spc` binary are Linux and macOS.
|
11 | 11 |
|
12 |
| -Here's how to download from GitHub Actions: |
| 12 | +Here's how to download from self-hosted server: |
13 | 13 |
|
14 |
| -1. Enter [GitHub Actions](https://github.com/crazywhalecc/static-php-cli/actions/workflows/release-build.yml). |
15 |
| -2. Select the latest build task, select `Artifacts`, and download the binary file of the corresponding platform. |
16 |
| -3. Unzip the `.zip` file. After decompressing, add execution permissions to it: `chmod +x ./spc`. |
| 14 | +```bash |
| 15 | +# Download from self-hosted nightly builds (sync with main branch) |
| 16 | +# For Linux x86_64 |
| 17 | +curl -o spc https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-linux-x86_64 |
| 18 | +# For Linux aarch64 |
| 19 | +curl -o spc https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-linux-aarch64 |
| 20 | +# macOS x86_64 (Intel) |
| 21 | +curl -o spc https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-macos-x86_64 |
| 22 | +# macOS aarch64 (Apple) |
| 23 | +curl -o spc https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-macos-aarch64 |
| 24 | +# Windows (x86_64, win10 build 17063 or later) |
| 25 | +curl.exe -o spc.exe https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-windows-x64.exe |
| 26 | + |
| 27 | +# Add execute perm (Linux and macOS only) |
| 28 | +chmod +x ./spc |
| 29 | + |
| 30 | +# Run (Linux and macOS) |
| 31 | +./spc --version |
| 32 | +# Run (Windows powershell) |
| 33 | +.\spc.exe --version |
| 34 | +``` |
17 | 35 |
|
18 |
| -You can also download binaries from a self-hosted server: [enter](https://dl.static-php.dev/static-php-cli/spc-bin/nightly/). |
| 36 | +> If you are using the packaged `spc` binary, you will need to replace the leading `bin/spc` with `./spc` in all the commands below. |
19 | 37 |
|
20 | 38 | ### Build locally (using source code)
|
21 | 39 |
|
| 40 | +If you have problems using the spc binary, or if you need to modify the static-php-cli source code, download static-php-cli from the source code. |
| 41 | + |
22 | 42 | Currently, it supports building on macOS and Linux.
|
23 | 43 | macOS supports the latest version of the operating system and two architectures,
|
24 | 44 | while Linux supports Debian and derivative distributions, as well as Alpine Linux.
|
@@ -366,6 +386,8 @@ when you use static-php-cli to build PHP or modify and enhance the static-php-cl
|
366 | 386 | - `dev:extensions`: output all currently supported extension names, or output the specified extension information
|
367 | 387 | - `dev:php-version`: output the currently compiled PHP version (by reading `php_version.h`)
|
368 | 388 | - `dev:sort-config`: Sort the list of configuration files in the `config/` directory in alphabetical order
|
| 389 | +- `dev:lib-ver <lib-name>`: Read the version from the source code of the dependency library (only available for specific dependency libraries) |
| 390 | +- `dev:ext-ver <ext-name>`: Read the corresponding version from the source code of the extension (only available for specific extensions) |
369 | 391 |
|
370 | 392 | ```bash
|
371 | 393 | # output all extensions information
|
|
0 commit comments