You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/en/guide/manual-build.md
+40-40Lines changed: 40 additions & 40 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -57,32 +57,31 @@ cd static-php-cli
57
57
composer update
58
58
```
59
59
60
-
### Use System PHP
60
+
### Use Precompiled Static PHP Binaries
61
61
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:
65
64
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.
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).
71
67
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.
# 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
77
78
```
78
79
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:
83
81
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`.
86
85
87
86
### Use Docker
88
87
@@ -93,45 +92,46 @@ If you don't want to install PHP and Composer runtime environment on your system
93
92
bin/spc-alpine-docker
94
93
```
95
94
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.
97
96
The default built Docker image is the `x86_64` architecture, and the image name is `cwcc-spc-x86_64`.
98
97
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,
100
99
you can use qemu to emulate the arm image to run Docker, but the speed will be very slow.
101
100
Use command: `SPC_USE_ARCH=aarch64 bin/spc-alpine-docker`.
102
101
103
-
If it prompts that sudo is required to run after running,
102
+
If it prompts that sudo is required to run after running,
104
103
execute the following command once to grant static-php-cli permission to execute sudo:
105
104
106
105
```bash
107
106
export SPC_USE_SUDO=yes
108
107
```
109
108
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
117
110
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.
122
114
123
115
```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.
# 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.
使用预编译静态 PHP 二进制目前仅支持 Linux 和 macOS。FreeBSD 环境因为缺少自动化构建环境,所以暂不支持。
104
-
:::
97
+
下面是系统安装 PHP、Composer 的一些示例命令。具体安装方式建议自行搜索或询问 AI 搜索引擎获取答案,这里不多赘述。
105
98
106
99
```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.
0 commit comments