Compare commits

..

5 Commits
1.1.0 ... 1.1.1

Author SHA1 Message Date
Whale
0d89397cca Update multi-version-build.sh 2021-04-28 15:38:43 +08:00
Whale
028063174c Update static-compile-php.sh 2021-04-28 15:35:01 +08:00
Whale
fbfed34dc9 Update README.md 2021-04-28 15:34:23 +08:00
Whale
ca226fe4d9 fix libxml2 and curl compile bug 2021-04-28 15:23:28 +08:00
Whale
1902057be1 Update README.md 2021-04-28 02:14:22 +08:00
3 changed files with 9 additions and 5 deletions

View File

@@ -2,10 +2,10 @@
Compile A Statically Linked PHP With Swoole and other Extensions
编译纯静态的 PHP Binary 二进制文件带有各种扩展CLI 模式,暂不支持 CGI 和 FPM 模式)
[![版本](https://img.shields.io/badge/version-1.1.0-green.svg)]()
[![版本](https://img.shields.io/badge/version-1.1.1-green.svg)]()
## 环境需求
- 目前在 x86_64 平台试验成功,其他架构需自行测试
- 目前在 x86_64 和 aarch64(arm64) 架构上编译成功,其他架构需自行测试
- 需要 Alpine Linux测试环境为 3.13 版本,其他版本未测试)系统(也就是说需要 musl
- WSL2 也是支持的
@@ -46,7 +46,7 @@ Compile A Statically Linked PHP With Swoole and other Extensions
## 运行示例
编译后的状态
![image](https://user-images.githubusercontent.com/20330940/116053556-68a30800-a6ad-11eb-88f8-aba015899e43.png)
![image](https://user-images.githubusercontent.com/20330940/116291663-6df47580-a7c7-11eb-8df3-6340c6f87055.png)
在不同系统直接运行 Swoft
![image](https://user-images.githubusercontent.com/20330940/116053161-f16d7400-a6ac-11eb-87b8-e510c6454861.png)

View File

@@ -13,7 +13,7 @@ do
"$_main_dir""static-compile-php.sh" && \
cp "$_main_dir""php-dist/bin/php" "$_build_dir/" && \
cd "$_build_dir/" && \
tar -zcvf "php-$loop-static-bin.tar.gz" "./php" && \
tar -zcvf "php-$loop-static-bin-"$(uname -m)".tar.gz" "./php" && \
mv "./php" "./php-$loop" && \
cd "$_main_dir"
if [ $? -ne 0 ]; then

View File

@@ -23,7 +23,7 @@ function downloadIt() {
return 0
}
_script_ver="1.1.0"
_script_ver="1.1.1"
_php_ver="7.4.16"
_swoole_ver="4.6.6"
@@ -167,6 +167,7 @@ function compilePHPWithSwoole() {
cat "$_home_dir""ac_override_1" "$_home_dir""source/php-""$_php_ver/ext/curl/config.m4" "$_home_dir""ac_override_2" > /tmp/aa && \
mv /tmp/aa "$_home_dir""source/php-""$_php_ver/ext/curl/config.m4" && \
./buildconf --force && \
PKG_CONFIG_PATH="$PKG_CONFIG_PATH:""$_home_dir""opt/libxml2/lib/pkgconfig" && \
PKG_CONFIG_PATH="$PKG_CONFIG_PATH:""$_home_dir""opt/curl/lib/pkgconfig" ./configure LDFLAGS=-static \
--prefix="$_home_dir""php-dist" \
--disable-all \
@@ -231,6 +232,9 @@ apk add oniguruma-dev
apk add openssl-libs-static openssl-dev openssl
# php的gd支持如果不需要gd则去掉--enable-gd和下面的依赖
apk add libpng-dev libpng-static
# curl的c-ares支持如果不需要curl则去掉
apk add c-ares-static c-ares-dev
downloadAll && \
compileLiblzma && \