mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-04 15:25:41 +08:00
Update gnu-docker and fix icu build on glibc
This commit is contained in:
@@ -34,25 +34,6 @@ but **statically linked with all other dependencies**.
|
||||
The latest version of static-php-cli includes the `bin/spc-gnu-docker` script,
|
||||
which can create a CentOS 7.x (glibc-2.17) Docker container with one click and build a glibc compatible PHP static binary in the container.
|
||||
|
||||
First, clone the repository of this project and add the following content to the `config/env.custom.ini` file:
|
||||
|
||||
```ini
|
||||
; Modify this file name to `env.custom.ini`, and run `bin/spc-gnu-docker`,
|
||||
; you can compile a GNU libc based static binary !
|
||||
[global]
|
||||
SPC_SKIP_DOCTOR_CHECK_ITEMS="if musl-wrapper is installed,if musl-cross-make is installed"
|
||||
|
||||
[linux]
|
||||
CC=gcc
|
||||
CXX=g++
|
||||
AR=ar
|
||||
LD=ld
|
||||
SPC_DEFAULT_C_FLAGS=-fPIC
|
||||
SPC_NO_MUSL_PATH=yes
|
||||
SPC_CMD_VAR_PHP_MAKE_EXTRA_LDFLAGS_PROGRAM="-Wl,-O1 -pie"
|
||||
SPC_CMD_VAR_PHP_MAKE_EXTRA_LIBS="-ldl -lpthread -lm -lresolv -lutil"
|
||||
```
|
||||
|
||||
Then, run the following command once.
|
||||
The first run will take a long time because it needs to download the CentOS 7.x image and some build tools.
|
||||
|
||||
|
||||
@@ -29,25 +29,6 @@ musl-libc 是一个轻量级的 libc 实现,它的目标是与 glibc 兼容,
|
||||
|
||||
最新版的 static-php-cli 内置了 `bin/spc-gnu-docker` 脚本,可以一键创建一个 CentOS 7.x (glibc-2.17) 的 Docker 容器,并在容器中构建 glibc 兼容的 PHP 静态二进制文件。
|
||||
|
||||
请先克隆本项目的仓库,并将下面的内容添加到 `config/env.custom.ini` 文件中:
|
||||
|
||||
```ini
|
||||
; Modify this file name to `env.custom.ini`, and run `bin/spc-gnu-docker`,
|
||||
; you can compile a GNU libc based static binary !
|
||||
[global]
|
||||
SPC_SKIP_DOCTOR_CHECK_ITEMS="if musl-wrapper is installed,if musl-cross-make is installed"
|
||||
|
||||
[linux]
|
||||
CC=gcc
|
||||
CXX=g++
|
||||
AR=ar
|
||||
LD=ld
|
||||
SPC_DEFAULT_C_FLAGS=-fPIC
|
||||
SPC_NO_MUSL_PATH=yes
|
||||
SPC_CMD_VAR_PHP_MAKE_EXTRA_LDFLAGS_PROGRAM="-Wl,-O1 -pie"
|
||||
SPC_CMD_VAR_PHP_MAKE_EXTRA_LIBS="-ldl -lpthread -lm -lresolv -lutil"
|
||||
```
|
||||
|
||||
然后,先运行一次以下命令。首次运行时时间较长,因为需要下载 CentOS 7.x 的镜像和一些编译工具。
|
||||
|
||||
```bash
|
||||
@@ -73,4 +54,4 @@ glibc 构建为扩展的特性,不属于默认 static-php 的支持范围。
|
||||
如果你需要不使用 Docker 构建基于 glibc 的二进制,请参考 `bin/spc-gnu-docker` 脚本,手动构建一个类似的环境。
|
||||
|
||||
由于 glibc 二进制不是项目的主要目标,一般情况下我们不会额外测试 glibc 下的各个库和扩展的兼容性。
|
||||
任何特定库如果在 musl-libc 上构建成功,但在 glibc 上构建失败,请提交 issue,我们将会单独解决。
|
||||
任何特定库如果在 musl-libc 上构建成功,但在 glibc 上构建失败,请提交 issue,我们将会单独解决。
|
||||
|
||||
Reference in New Issue
Block a user