Skip to content

Commit ab8a8f6

Browse files
committed
Fix test-extensions, adjust docs order
1 parent 86aa829 commit ab8a8f6

File tree

3 files changed

+69
-70
lines changed

3 files changed

+69
-70
lines changed

docs/en/guide/manual-build.md

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -57,32 +57,31 @@ cd static-php-cli
5757
composer update
5858
```
5959

60-
### Use System PHP
60+
### Use Precompiled Static PHP Binaries
6161

62-
Below are some example commands for installing PHP and Composer in the system.
63-
It is recommended to search for the specific installation method yourself or ask the AI search engine to obtain the answer,
64-
which will not be elaborated here.
62+
If you don't want to use Docker and install PHP in the system,
63+
you can directly download the php binary cli program compiled by this project itself. The usage process is as follows:
6564

66-
```bash
67-
# [macOS], need install Homebrew first. See https://brew.sh/
68-
# Remember change your composer executable path. For M1/M2 Chip mac, "/opt/homebrew/bin/", for Intel mac, "/usr/local/bin/". Or add it to your own path.
69-
brew install php wget
70-
wget https://getcomposer.org/download/latest-stable/composer.phar -O /path/to/your/bin/composer && chmod +x /path/to/your/bin/composer
65+
Deploy the environment using the command, the command will download a static php-cli binary from [self-hosted server](https://dl.static-php.dev/static-php-cli/).
66+
Next, it will automatically download Composer from [getcomposer](https://getcomposer.org/download/latest-stable/composer.phar) or [Aliyun mirror](https://mirrors.aliyun.com/composer/composer.phar).
7167

72-
# [Debian], you need to make sure your php version >= 8.1 and composer >= 2.0
73-
sudo apt install php-cli composer php-tokenizer
68+
::: tip
69+
Using precompiled static PHP binaries is currently only supported on Linux and macOS.
70+
The FreeBSD environment is currently not supported due to the lack of an automated build environment.
71+
:::
7472

75-
# [Alpine]
76-
apk add bash file wget xz php81 php81-common php81-pcntl php81-tokenizer php81-phar php81-posix php81-xml composer
73+
```bash
74+
bin/setup-runtime
75+
76+
# For users with special network environments such as mainland China, you can use mirror sites (aliyun) to speed up the download speed
77+
bin/setup-runtime --mirror china
7778
```
7879

79-
::: tip
80-
Currently, some versions of Ubuntu install older PHP versions,
81-
so no installation commands are provided. If necessary, it is recommended to add software sources such as ppa first,
82-
and then install the latest version of PHP and tokenizer, XML, and phar extensions.
80+
This script will download two files in total: `bin/php` and `bin/composer`. After the download is complete, there are two ways to use it:
8381

84-
Older versions of Debian may have an older (<= 7.4) version of PHP installed by default, it is recommended to upgrade Debian first.
85-
:::
82+
1. Add the `bin/` directory to the PATH: `export PATH="/path/to/your/static-php-cli/bin:$PATH"`, after adding the path,
83+
it is equivalent to installing PHP in the system, you can directly Use commands such as `composer`, `php -v`, or directly use `bin/spc`.
84+
2. Direct call, such as executing static-php-cli command: `bin/php bin/spc --help`, executing Composer: `bin/php bin/composer update`.
8685

8786
### Use Docker
8887

@@ -93,45 +92,46 @@ If you don't want to install PHP and Composer runtime environment on your system
9392
bin/spc-alpine-docker
9493
```
9594

96-
The first time the command is executed, `docker build` will be used to build a Docker image.
95+
The first time the command is executed, `docker build` will be used to build a Docker image.
9796
The default built Docker image is the `x86_64` architecture, and the image name is `cwcc-spc-x86_64`.
9897

99-
If you want to build `aarch64` static-php-cli in `x86_64` environment,
98+
If you want to build `aarch64` static-php-cli in `x86_64` environment,
10099
you can use qemu to emulate the arm image to run Docker, but the speed will be very slow.
101100
Use command: `SPC_USE_ARCH=aarch64 bin/spc-alpine-docker`.
102101

103-
If it prompts that sudo is required to run after running,
102+
If it prompts that sudo is required to run after running,
104103
execute the following command once to grant static-php-cli permission to execute sudo:
105104

106105
```bash
107106
export SPC_USE_SUDO=yes
108107
```
109108

110-
### Use Precompiled Static PHP Binaries
111-
112-
If you don't want to use Docker and install PHP in the system,
113-
you can directly download the php binary cli program compiled by this project itself. The usage process is as follows:
114-
115-
Deploy the environment using the command, the command will download a static php-cli binary from [self-hosted server](https://dl.static-php.dev/static-php-cli/).
116-
Next, it will automatically download Composer from [getcomposer](https://getcomposer.org/download/latest-stable/composer.phar) or [Aliyun mirror](https://mirrors.aliyun.com/composer/composer.phar).
109+
### Use System PHP
117110

118-
::: tip
119-
Using precompiled static PHP binaries is currently only supported on Linux and macOS.
120-
The FreeBSD environment is currently not supported due to the lack of an automated build environment.
121-
:::
111+
Below are some example commands for installing PHP and Composer in the system.
112+
It is recommended to search for the specific installation method yourself or ask the AI search engine to obtain the answer,
113+
which will not be elaborated here.
122114

123115
```bash
124-
bin/setup-runtime
116+
# [macOS], need install Homebrew first. See https://brew.sh/
117+
# Remember change your composer executable path. For M1/M2 Chip mac, "/opt/homebrew/bin/", for Intel mac, "/usr/local/bin/". Or add it to your own path.
118+
brew install php wget
119+
wget https://getcomposer.org/download/latest-stable/composer.phar -O /path/to/your/bin/composer && chmod +x /path/to/your/bin/composer
125120

126-
# For users with special network environments such as mainland China, you can use mirror sites (aliyun) to speed up the download speed
127-
bin/setup-runtime --mirror china
121+
# [Debian], you need to make sure your php version >= 8.1 and composer >= 2.0
122+
sudo apt install php-cli composer php-tokenizer
123+
124+
# [Alpine]
125+
apk add bash file wget xz php81 php81-common php81-pcntl php81-tokenizer php81-phar php81-posix php81-xml composer
128126
```
129127

130-
This script will download two files in total: `bin/php` and `bin/composer`. After the download is complete, there are two ways to use it:
128+
::: tip
129+
Currently, some versions of Ubuntu install older PHP versions,
130+
so no installation commands are provided. If necessary, it is recommended to add software sources such as ppa first,
131+
and then install the latest version of PHP and tokenizer, XML, and phar extensions.
131132

132-
1. Add the `bin/` directory to the PATH: `export PATH="/path/to/your/static-php-cli/bin:$PATH"`, after adding the path,
133-
it is equivalent to installing PHP in the system, you can directly Use commands such as `composer`, `php -v`, or directly use `bin/spc`.
134-
2. Direct call, such as executing static-php-cli command: `bin/php bin/spc --help`, executing Composer: `bin/php bin/composer update`.
133+
Older versions of Debian may have an older (<= 7.4) version of PHP installed by default, it is recommended to upgrade Debian first.
134+
:::
135135

136136
## Command - download
137137

docs/zh/guide/manual-build.md

Lines changed: 27 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -50,28 +50,28 @@ cd static-php-cli
5050
composer update
5151
```
5252

53-
### 使用系统 PHP 环境
53+
### 使用预编译静态 PHP 二进制运行 static-php-cli
5454

55-
下面是系统安装 PHP、Composer 的一些示例命令。具体安装方式建议自行搜索或询问 AI 搜索引擎获取答案,这里不多赘述。
55+
如果你不想使用 Docker、在系统内安装 PHP,可以直接下载本项目自身编译好的 php 二进制 cli 程序。使用流程如下:
5656

57-
```bash
58-
# [macOS], 需要先安装 Homebrew. See https://brew.sh/
59-
# Remember change your composer executable path. For M1/M2 Chip mac, "/opt/homebrew/bin/", for Intel mac, "/usr/local/bin/". Or add it to your own path.
60-
brew install php wget
61-
wget https://getcomposer.org/download/latest-stable/composer.phar -O /path/to/your/bin/composer && chmod +x /path/to/your/bin/composer
57+
使用命令部署环境,此脚本会从 [自托管的服务器](https://dl.static-php.dev/static-php-cli/) 下载一个当前操作系统的 php-cli 包,
58+
并从 [getcomposer](https://getcomposer.org/download/latest-stable/composer.phar)[Aliyun(镜像)](https://mirrors.aliyun.com/composer/composer.phar) 下载 Composer。
6259

63-
# [Debian], you need to make sure your php version >= 8.1 and composer >= 2.0
64-
sudo apt install php-cli composer php-tokenizer
60+
::: tip
61+
使用预编译静态 PHP 二进制目前仅支持 Linux 和 macOS。FreeBSD 环境因为缺少自动化构建环境,所以暂不支持。
62+
:::
63+
64+
```bash
65+
bin/setup-runtime
6566

66-
# [Alpine]
67-
apk add bash file wget xz php81 php81-common php81-pcntl php81-tokenizer php81-phar php81-posix php81-xml composer
67+
# 对于中国大陆地区等网络环境特殊的用户,可使用镜像站加快下载速度
68+
bin/setup-runtime --mirror china
6869
```
6970

70-
::: tip
71-
目前 Ubuntu 部分版本的 apt 安装的 php 版本较旧,故不提供安装命令。如有需要,建议先添加 ppa 等软件源后,安装最新版的 PHP 以及 tokenizer、xml、phar 扩展。
71+
此脚本总共会下载两个文件:`bin/php``bin/composer`,下载完成后,有两种使用方式:
7272

73-
较老版本的 Debian 默认安装的可能为旧版本(<= 7.4)版本的 PHP,建议先升级 Debian
74-
:::
73+
1.`bin/` 目录添加到 PATH 路径中:`export PATH="/path/to/your/static-php-cli/bin:$PATH"`,添加路径后,相当于系统安装了 PHP,可直接使用 `composer``php -v` 等命令,也可以直接使用 `bin/spc`
74+
2. 直接调用,比如执行 static-php-cli 命令:`bin/php bin/spc --help`,执行 Composer:`bin/php bin/composer update`
7575

7676
### 使用 Docker 环境
7777

@@ -92,28 +92,25 @@ bin/spc-alpine-docker
9292
export SPC_USE_SUDO=yes
9393
```
9494

95-
### 使用预编译静态 PHP 二进制
96-
97-
如果你不想使用 Docker、在系统内安装 PHP,可以直接下载本项目自身编译好的 php 二进制 cli 程序。使用流程如下:
98-
99-
使用命令部署环境,此脚本会从 [自托管的服务器](https://dl.static-php.dev/static-php-cli/) 下载一个当前操作系统的 php-cli 包,
100-
并从 [getcomposer](https://getcomposer.org/download/latest-stable/composer.phar)[Aliyun(镜像)](https://mirrors.aliyun.com/composer/composer.phar) 下载 Composer。
95+
### 使用系统 PHP 环境
10196

102-
::: tip
103-
使用预编译静态 PHP 二进制目前仅支持 Linux 和 macOS。FreeBSD 环境因为缺少自动化构建环境,所以暂不支持。
104-
:::
97+
下面是系统安装 PHP、Composer 的一些示例命令。具体安装方式建议自行搜索或询问 AI 搜索引擎获取答案,这里不多赘述。
10598

10699
```bash
107-
bin/setup-runtime
100+
# [macOS], 需要先安装 Homebrew. See https://brew.sh/
101+
# Remember change your composer executable path. For M1/M2 Chip mac, "/opt/homebrew/bin/", for Intel mac, "/usr/local/bin/". Or add it to your own path.
102+
brew install php wget
103+
wget https://getcomposer.org/download/latest-stable/composer.phar -O /path/to/your/bin/composer && chmod +x /path/to/your/bin/composer
108104

109-
# 对于中国大陆地区等网络环境特殊的用户,可使用镜像站加快下载速度
110-
bin/setup-runtime --mirror china
105+
# [Debian], you need to make sure your php version >= 8.4 and composer >= 2.0
106+
sudo apt install php-cli composer php-tokenizer
111107
```
112108

113-
此脚本总共会下载两个文件:`bin/php``bin/composer`,下载完成后,有两种使用方式:
109+
::: tip
110+
目前 Ubuntu 部分版本的 apt 安装的 php 版本较旧,故不提供安装命令。如有需要,建议先添加 ppa 等软件源后,安装最新版的 PHP 以及 tokenizer、xml、phar 扩展。
114111

115-
1.`bin/` 目录添加到 PATH 路径中:`export PATH="/path/to/your/static-php-cli/bin:$PATH"`,添加路径后,相当于系统安装了 PHP,可直接使用 `composer``php -v` 等命令,也可以直接使用 `bin/spc`
116-
2. 直接调用,比如执行 static-php-cli 命令:`bin/php bin/spc --help`,执行 Composer:`bin/php bin/composer update`
112+
较老版本的 Debian 默认安装的可能为旧版本(<= 8.3)版本的 PHP,建议先升级 Debian 或使用 Docker 或自带的静态二进制环境
113+
:::
117114

118115
## 命令 download - 下载依赖包
119116

src/globals/test-extensions.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,8 @@ function quote2(string $param): string
163163
} else {
164164
passthru('./bin/spc ' . $build_cmd . ' --build-embed', $retcode);
165165
}
166+
} else {
167+
$retcode = 0;
166168
}
167169

168170
exit($retcode);

0 commit comments

Comments
 (0)