Compare commits

...

2120 Commits

Author SHA1 Message Date
henderkes
435d2c07b0 zstd stable too 2026-06-29 12:28:11 +07:00
henderkes
ed0a45da31 brotli stable 2026-06-29 12:26:39 +07:00
henderkes
6bc6e32dd0 strip env vars from configure command 2026-06-29 11:10:19 +07:00
henderkes
dac2ea5677 --with-sysconfdir option 2026-06-22 16:12:22 +07:00
henderkes
9398a6677d update protobuf 2026-06-14 11:52:30 +07:00
henderkes
967122cc7c fix 2026-06-09 15:14:47 +07:00
henderkes
53bd0fca4f add cpu builtins for zig 2026-06-05 19:33:44 +07:00
henderkes
daa694ab2c gmssl update 2026-06-05 10:07:12 +07:00
henderkes
1ae4a00e10 better zig-cc arch handling 2026-05-26 00:47:42 +00:00
henderkes
2b6d228bc3 oopsie 2026-05-22 15:43:57 +07:00
henderkes
7ebc7c0275 != generic needs nasm/yasm 2026-05-22 11:59:13 +07:00
henderkes
721ac4a390 enable hardware intrinsics for libaom 2026-05-22 11:49:15 +07:00
henderkes
11e19db480 add fastchart, fastjson and clickhouse extensions 2026-05-22 08:19:04 +07:00
henderkes
f027788a7d fix imagick CI build with amd only instructions 2026-05-22 08:18:27 +07:00
henderkes
bacf37e112 fix libheif 2026-05-22 08:14:35 +07:00
henderkes
d343ceebd9 libheif is c++ 2026-05-21 23:12:06 +07:00
henderkes
af01fc03f7 Merge branch 'feat/frankenphp-pgo' into feat/pgo 2026-05-16 19:12:15 +07:00
henderkes
fd882ce03e forward port #1138 2026-05-16 19:11:35 +07:00
Marc
8d038f435d Update rdkafka repository reference in source.json (#1134) 2026-05-09 10:44:43 +07:00
Marc
134186c94f Update rdkafka repository reference in source.json 2026-05-09 07:27:19 +07:00
Marc
ef95e4f857 fix centos 7 gd build (#1132) 2026-05-07 17:13:46 +07:00
Marc
fd4f70d526 oops 2026-05-07 16:51:56 +07:00
henderkes
c7738749e2 run tests 2026-05-07 16:33:39 +07:00
henderkes
44f9cb1ffd fix centos 7 gd build 2026-05-07 16:27:26 +07:00
henderkes
ff9a84967f fix zig-cc script with different PKG_ROOT_PATH (and filter out some gcc-only warning options) 2026-05-07 10:58:46 +07:00
henderkes
edeb5b9f0d fix musl check 2026-05-07 10:29:12 +07:00
Marc
82998a759f Merge branch 'main' into feat/pgo 2026-05-06 17:55:20 +07:00
henderkes
33141775c0 comments 2026-05-06 17:49:01 +07:00
Jerry Ma
970343b143 Fix old PHP extension with newer C standard bug (#1089) 2026-05-06 14:38:34 +08:00
henderkes
f553ee9e24 dont patch out configure command 2026-05-06 13:04:54 +07:00
Marc
e21bb528c0 Apply suggestion from @henderkes 2026-05-06 12:52:50 +07:00
henderkes
712beff2f5 fixes for thin lto 2026-05-06 09:35:20 +07:00
henderkes
410f1d2fc8 extra libs only option in craft 2026-05-05 19:19:00 +07:00
henderkes
a0c86c1519 use correct ar and ranlib for cmake 2026-05-05 17:56:31 +07:00
henderkes
5d4bb273ee god 2026-05-05 15:41:04 +07:00
henderkes
91290667e4 set c std libs instead 2026-05-05 15:28:21 +07:00
henderkes
aed01c9312 remove leftovers 2026-05-05 14:51:26 +07:00
henderkes
b4e7080b6f simpler patch 2026-05-05 14:50:05 +07:00
henderkes
a38fd23d5d explicitly set openssl dir? 2026-05-05 14:38:38 +07:00
henderkes
956e8d0b14 fix unixodbc with lto? 2026-05-05 14:31:37 +07:00
henderkes
cec488f10c fix fastlz header location 2026-05-05 13:58:02 +07:00
henderkes
7be718edeb forgot to add file 2026-05-05 11:25:38 +07:00
henderkes
5f43d6a4b4 ready for packages 2026-05-05 11:16:16 +07:00
henderkes
c5edacd8bf fix linter in CI 2026-05-04 20:06:48 +07:00
henderkes
6557fc9d7e fix last libs to use cflags 2026-05-04 20:00:25 +07:00
henderkes
bcafd9c962 only link static ext libraries into sapi builds 2026-05-04 18:14:00 +07:00
henderkes
7dfa4c5c3b only run micro patches when building it 2026-05-02 20:19:31 +07:00
henderkes
20030096d6 pass proper optimization flags to a few libs that ignored them 2026-05-02 20:04:02 +07:00
henderkes
b72b734bbe profile atomic 2026-05-01 21:10:27 +07:00
henderkes
814d3cba58 move pgo from new to static creation method 2026-04-30 19:46:24 +07:00
Marc
5293f76eaf Merge branch 'main' into feat/pgo 2026-04-30 19:36:02 +07:00
henderkes
d19930a8e2 unrelated cs-fix 2026-04-30 19:33:00 +07:00
henderkes
d774fda15d add cs profiling as optional second step profiling pass 2026-04-30 18:50:16 +07:00
Jerry Ma
5b5861c366 Let ghtar always use latest version by default & mongodb bugfix (#1125) 2026-04-30 12:41:07 +08:00
henderkes
b5dca48acf exit handlers patch instead of continuous 2026-04-30 10:50:40 +07:00
crazywhalecc
7a71a40824 Test 2026-04-30 11:22:56 +08:00
crazywhalecc
a9e1327a80 Fix phpunit mock data 2026-04-30 11:22:19 +08:00
crazywhalecc
93a227bc6d Fix mongodb 2.3.0 introduced in-tree build bug 2026-04-30 11:14:01 +08:00
crazywhalecc
4eaeeb8230 Make swoole using 6.2.0 2026-04-30 11:06:08 +08:00
crazywhalecc
0588401ee3 Improve GitHub source retrieval by using latest release endpoint and enhancing version handling 2026-04-30 11:05:49 +08:00
henderkes
b536d0c694 lint 2026-04-27 19:35:47 +07:00
henderkes
eff46209da add --pgi and --pgo to facilitate PGO builds 2026-04-27 19:34:45 +07:00
Marc
abfdae256a Add 'date', 'lexbor', 'random', and 'uri' to extensions (#1120) 2026-04-23 19:05:19 +07:00
Marc
450e0e1ecb Add 'date', 'lexbor', 'random', and 'uri' to extensions 2026-04-23 18:55:35 +07:00
Jerry Ma
a373df2444 Fix libde265 on arm64 macOS asm build bug (#1117) 2026-04-22 15:59:03 +08:00
Marc
95a4b4d738 patch 8.3 src to use avx512 cache vars (#1115) 2026-04-21 00:06:41 +07:00
Jerry Ma
4e9edf6c9d Update src/SPC/builder/unix/library/libde265.php 2026-04-21 00:21:52 +08:00
crazywhalecc
14fc3f8d87 Fix libde265 on arm64 macOS asm build bug 2026-04-20 23:55:00 +08:00
henderkes
f52e8ad449 patch 8.3 src to use avx512 cache vars 2026-04-20 07:32:13 +00:00
Jerry Ma
4318ef8fa3 fix aarch64 shared extensions segfault with zig 0.16.0 (#1110) 2026-04-18 11:41:59 +08:00
Marc
8630fd57e2 Merge branch 'main' into feat/decimal 2026-04-17 17:59:55 +07:00
henderkes
0a3c56ba49 set lcompiler_rt only when building shared extensions 2026-04-17 17:04:57 +07:00
Alex Rock Ancelet
b1a77b01e2 Add linux mint to ubuntu/debian variants 2026-04-17 17:04:57 +07:00
henderkes
f39d77dde0 lint 2026-04-17 14:19:29 +07:00
henderkes
cc7a22922c add -lcompiler_rt to SPC_COMPILER_EXTRA instead 2026-04-17 14:17:39 +07:00
henderkes
1a395a2b0f fix zig 0.16.0 2026-04-17 01:51:01 +07:00
Jerry Ma
bfe4a012b8 Add linux mint to ubuntu/debian variants (#1109) 2026-04-16 21:13:30 +08:00
henderkes
ab17fbe288 zig version 0.15.2 for now 2026-04-16 20:02:54 +07:00
Alex Rock Ancelet
7a65135c68 Add linux mint to ubuntu/debian variants 2026-04-16 14:12:07 +02:00
henderkes
f57986ccbf minify embed script 2026-04-16 18:06:27 +07:00
Marc
9bcb809117 fix libkrb5 and decimal shard build (#1107) 2026-04-16 17:40:47 +07:00
henderkes
2073652744 fix macOS 2026-04-16 14:29:13 +07:00
Marc
1440f104bb Merge branch 'main' into feat/decimal 2026-04-16 13:53:57 +07:00
henderkes
834cc4d16e fix lint 2026-04-16 13:50:52 +07:00
henderkes
a9c16b74d7 fix libkrb5 and decimal shard build 2026-04-16 13:46:12 +07:00
Marc
c532b9e893 remove workaround for zig < 0.16 (#1105) 2026-04-15 11:47:08 +07:00
henderkes
73dd885342 pin openssl to 3.x 2026-04-15 10:59:13 +07:00
henderkes
be24fd9467 remove workaround for zig < 0.16 2026-04-14 23:05:08 +07:00
Marc
bf1f54a091 Fix paths for PostgreSQL library and header file copying on Windows (#1102) 2026-04-14 13:36:32 +07:00
crazywhalecc
1c3dc91845 Fix paths for PostgreSQL library and header file copying on Windows 2026-04-14 11:25:15 +08:00
Marc
565ff27b71 add ext-decimal (#1095) 2026-04-12 17:44:50 +07:00
Marc
f48961c72d Remove unused import in libmpdec.php
Removed unused import of FileSystem.
2026-04-12 16:09:55 +07:00
henderkes
a0c2fefd24 fix windows crash 2026-04-12 15:55:57 +07:00
henderkes
f585cc446a attempt 2026-04-12 13:30:22 +07:00
henderkes
f43e915341 don't scan the test 2026-04-12 12:44:21 +07:00
henderkes
93f68b209f fix merge 2026-04-12 12:32:26 +07:00
Marc
3fb68f3989 Merge branch 'main' into feat/decimal 2026-04-12 12:31:00 +07:00
henderkes
4f27d2d9d1 add ext-decimal 2026-04-12 12:28:27 +07:00
Marc
562fbf2a9c add "deepclone" extension (#1094) 2026-04-12 11:47:47 +07:00
henderkes
cbf1ed7662 full test suite 2026-04-12 10:57:25 +07:00
henderkes
4bba584e88 add "deepclone" extension 2026-04-12 10:55:24 +07:00
crazywhalecc
0ed1bbc74a Fix typo 2026-04-11 01:01:21 +08:00
crazywhalecc
1272acd07e Fix bcmath with c23 bug 2026-04-11 01:00:30 +08:00
Jerry Ma
6e354b4c6a fix: icu-static-win, ext-swoole, krb5, sqlsrv with grpc (#1087) 2026-04-10 16:14:02 +08:00
crazywhalecc
864fa9d0eb Fix #1083 2026-04-10 16:09:35 +08:00
crazywhalecc
a27f5cc8be Oops 2026-04-10 14:26:03 +08:00
crazywhalecc
26a14bccbe Disable iouring on glibc build 2026-04-10 14:21:06 +08:00
crazywhalecc
cf48d131b3 Use direct link to official release instead of mirror 2026-04-10 13:52:21 +08:00
crazywhalecc
544fd15c0b test tmate 2026-04-10 13:26:14 +08:00
crazywhalecc
b04b079267 test 2026-04-10 13:22:06 +08:00
crazywhalecc
da49c056c9 test 2026-04-10 12:49:10 +08:00
crazywhalecc
7fc5dd428d Fix krb5 CI build by the way 2026-04-10 12:24:25 +08:00
crazywhalecc
6b62255091 test 2026-04-10 12:21:21 +08:00
crazywhalecc
9d777ca650 fix(icu_static_win): update paths for ICU static libraries and includes 2026-04-09 23:37:36 +08:00
Marc
20f95efcba fix(xlswriter): fix macOS build with modern Clang (C23) (#1086) 2026-04-09 14:30:42 +07:00
Marc
fb7730989c Apply suggestions from code review
Co-authored-by: Marc <m@pyc.ac>
2026-04-09 14:00:10 +07:00
Kévin Dunglas
4d2036f20e fix(xlswriter): use -std=gnu17 to fix K&R declarations rejected by C23
The bundled minizip in xlswriter has K&R C function declarations in
multiple files (mztools.c, ioapi.c). Apple Clang (Xcode 16+) defaults
to C23, which removed K&R from the standard, causing hard build errors.

Instead of patching individual files, downgrade the C standard to gnu17
for the whole build when xlswriter is enabled. This covers all K&R
occurrences in the bundled code.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 08:49:49 +02:00
Kévin Dunglas
105f0328e6 fix(xlswriter): convert K&R function declaration to ANSI C in bundled minizip
The bundled minizip in xlswriter (pinned at libxlsxwriter RELEASE_1.0.0)
uses a K&R-style function declaration in mztools.c. Modern Clang on macOS
(defaulting to C23) rejects this as a hard syntax error since K&R
declarations were removed from the C23 standard.

The upstream libxlsxwriter has already fixed this on their main branch.
This patch applies the same fix during the build process.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-08 21:33:59 +02:00
Jerry Ma
d411fac9a1 add framework coreservices to watcher library (#1082) 2026-04-04 20:05:47 +08:00
henderkes
ddb9e3e7e4 add framework coreservices to watcher library 2026-04-04 18:18:22 +07:00
Marc
fef361225a Fix file paths for SQLSRV (#1081) 2026-04-04 18:11:38 +07:00
crazywhalecc
0b2b1d51e1 Fix file paths for SQLSRV 2026-04-04 18:39:28 +08:00
Jerry Ma
820d77b8b2 [v2] Fix bunch of build bugs for Windows (#1078) 2026-04-03 19:58:57 +08:00
Jerry Ma
cd3eb3d41d Update src/globals/ext-tests/openssl.php 2026-04-03 19:53:23 +08:00
crazywhalecc
fb8f8d4ef8 Correct openssl test script condition 2026-04-03 15:49:02 +08:00
crazywhalecc
1a476d0e80 Fix xcopy command in FileSystem.php by removing the 'v' flag 2026-04-03 15:34:56 +08:00
crazywhalecc
e5ad72214c Add brotli to curl (just workaround for transitive deps) 2026-04-03 14:18:13 +08:00
crazywhalecc
c339b900f8 Disable simd for libjpeg 2026-04-03 11:33:55 +08:00
crazywhalecc
3ded9881e1 Disable openssl for ngtcp2 temporarily 2026-04-03 09:55:46 +08:00
crazywhalecc
08a6bf38a4 Remove zstd suggested libs for v2 (implemented on v3)
Anyway we don't support zstd windows build before
2026-04-02 18:04:03 +08:00
crazywhalecc
cae668a947 Remove zstd suggested libs for v2 (implemented on v3)
Anyway we don't support zstd windows build before
2026-04-02 17:59:15 +08:00
crazywhalecc
e592488d7a Add test 2026-04-02 16:34:51 +08:00
crazywhalecc
a7184d0411 Fix sqlsrv redundant cflags when building PHP 2026-04-02 16:32:43 +08:00
Marc
d535e4f102 libjpeg-turbo mustn't compile zlib symbols on its own (#1077) 2026-03-30 10:08:49 +07:00
henderkes
5a5f54bdcd brilliant to test php 8.1 2026-03-30 01:37:08 +07:00
henderkes
8f7897e13b test 2026-03-30 01:06:31 +07:00
henderkes
daae5f2a7c libjpeg-turbo mustn't compile zlib symbols on its own 2026-03-30 00:56:51 +07:00
Marc
766f7fa34f hard code protobuf version while we're on v2 (#1075) 2026-03-26 12:37:32 +07:00
henderkes
ecf712b2b7 hard code protobuf version while we're on v2 2026-03-26 12:32:27 +07:00
Jerry Ma
d35cbd7bf8 Add Windows builders for libaom and brotli (#1072) 2026-03-23 16:21:46 +08:00
crazywhalecc
d076df6b04 Bump version number 2026-03-23 16:21:24 +08:00
crazywhalecc
a99b6bebae Remove freetype useless lib suggestions 2026-03-23 16:08:09 +08:00
Hendrik Mennen
864678ab46 Merge branch 'main' into feat/windows-libaom-brotli 2026-03-22 13:12:47 +01:00
Hendrik Mennen
c03508a84b Improve zlib Windows library detection for future zlib versions (#1070)
Co-authored-by: Hendrik Mennen <hmennen@gambio.ec1.de>
2026-03-22 20:11:29 +08:00
Hendrik Mennen
963e2a084a Add Windows builders for libaom and brotli libraries
Both libraries are listed in lib.json and used as transitive dependencies
(libaom via libavif, brotli via freetype/curl) but had no Windows builder,
causing builds to fail with "library [X] is in the lib.json list but not
supported to compile".

libaom: Uses builddir instead of build to avoid collision with the
source tree's build/cmake/ directory. Matches the Unix builder's
AOM_TARGET_CPU=generic setting for portability.

brotli: Standard CMake build with shared libs and tools disabled.

Also adds static-libs-windows entry for libaom in lib.json.
2026-03-22 09:07:47 +01:00
Marc
4c6b7a3d55 fix libde265 on ancient debian OS (#1064) 2026-03-20 19:48:01 +07:00
Marc
5404926a14 Merge branch 'main' into fix/lide265 2026-03-20 19:47:47 +07:00
Nils Silbernagel
295df19484 Add shared-extensions, frankenphp and zts to build-unix workflow (#1062)
Co-authored-by: crazywhalecc <jesse2061@outlook.com>
2026-03-20 20:37:25 +08:00
Jerry Ma
b970bf8e3a Fix gd build on PHP 8.5 (#1043) 2026-03-20 20:00:42 +08:00
Jerry Ma
54915028d7 Fix zlib produced lib file names from different zlib version (#1066) 2026-03-20 19:35:51 +08:00
henderkes
823fe96942 attempt 2026-03-18 23:26:57 +07:00
henderkes
f2fa29809a why is it not failing here? 2026-03-18 18:37:16 +07:00
Marc
463ec546fa Merge branch 'main' into fix/lide265 2026-03-18 15:51:03 +07:00
henderkes
60b2aea09e fix libde265 on ancient debian OS? 2026-03-18 11:57:27 +07:00
Marc
4625c6a885 update default php version to 8.5 (#1058) 2026-03-11 15:09:07 +07:00
henderkes
85b0cd8b4b only disable when building ftp static, shared is fine 2026-03-11 13:54:24 +07:00
henderkes
1fcb74ad9b swoole-ftp conflicts with ftp 2026-03-11 13:42:38 +07:00
henderkes
1049a3ce66 curl is always supported now (swoole no longer supports php < 8.1) 2026-03-11 10:32:58 +07:00
henderkes
1b8b53d47f update swoole args for 6.2 2026-03-11 10:19:08 +07:00
henderkes
a232f578a4 test bulk 2026-03-11 10:11:39 +07:00
henderkes
70285cb53b actually update to 8.5 2026-03-11 09:48:50 +07:00
henderkes
a335d050cf cs fix 2026-03-11 09:46:41 +07:00
henderkes
ef4b2997a7 test 2026-03-11 09:45:56 +07:00
henderkes
901da8fa41 remove ldtl from odbc libs private (using built in ltdl) 2026-03-11 09:43:02 +07:00
henderkes
e49a5d7a50 make php 8.5 default 2026-03-11 09:42:39 +07:00
Jerry Ma
281b958075 Fix grpc build (#1055) 2026-03-10 20:35:51 +09:00
Marc
e31f64864e fix: FrankenPHP build args (#1057) 2026-03-10 18:13:34 +07:00
Kévin Dunglas
92f5b56c74 fix: FrankenPHP build args 2026-03-10 11:57:23 +01:00
Jerry Ma
2350d2d5ca Merge branch 'main' into fix/grpc-build 2026-03-10 14:52:21 +09:00
crazywhalecc
086c855a43 Use custom config.m4 for grpc extension 2026-03-10 13:49:53 +08:00
crazywhalecc
4fa5292913 Use custom config.m4 for grpc extension 2026-03-10 13:49:34 +08:00
Marc
9634b8bcda set custom binary name for frankenphp, allow linking against system openssl (fix mssql issues) (#1056) 2026-03-10 11:11:36 +07:00
Marc
5d5a50a33c Update src/SPC/builder/LibraryBase.php
Co-authored-by: Jerry Ma <jesse2061@outlook.com>
2026-03-10 10:57:49 +07:00
henderkes
1edf14e642 set custom binary name for frankenphp 2026-03-10 08:52:15 +07:00
henderkes
2277390a1a fix removeConfigureArgs in UnixAutoconfExecutor.php 2026-03-10 08:49:56 +07:00
henderkes
f93ad27c17 allow using some libs as system provided (work around mssql linking vs system openssl) 2026-03-10 08:47:38 +07:00
henderkes
b690566b39 simplify rm command 2026-03-10 08:43:48 +07:00
henderkes
16e772e1a8 add back in zig workaround as 0.16.x is not released yet 2026-03-10 08:42:17 +07:00
crazywhalecc
ad356b4a23 Fix grpc build 2026-03-09 20:12:14 +08:00
Jerry Ma
8c4e3d58a3 Add php-src mirror and use gmp mirror site (#1048) 2026-03-06 15:25:38 +09:00
Marc
8a51d64685 Add condition for ffi patch (#1050) 2026-03-06 12:59:23 +07:00
crazywhalecc
055bc7bc3c Add condition for ffi patch 2026-03-06 13:46:55 +08:00
Marc
7d7902e0e9 Update build flags for FrankenPHP in UnixBuilderBase (#1042) 2026-02-24 06:08:14 +07:00
Kévin Dunglas
2a8fa7d155 Update build flags for FrankenPHP in UnixBuilderBase 2026-02-23 16:29:43 +01:00
Marc
67ef8f6608 fix redownloading go-xcaddy every time, version 2.8.3 (#1034) 2026-02-17 22:36:27 +07:00
henderkes
d83a597689 unquote the string in case a shell script passes it stupidly 2026-02-17 21:49:30 +07:00
henderkes
5623fed37f fix redownloading go-xcaddy every time 2026-02-17 21:05:18 +07:00
Marc
38140d115f libavif needs at least one encoder to work (#1033) 2026-02-17 19:59:46 +07:00
henderkes
98117c3a04 remove pre built 2026-02-17 19:58:03 +07:00
Marc
b01d3ce12c Merge branch 'main' into feat/avif-dec 2026-02-17 19:18:38 +07:00
henderkes
608c915e14 should depend on it instead 2026-02-17 19:14:29 +07:00
henderkes
c680299654 libavif needs at least one encoder to work 2026-02-17 19:12:19 +07:00
Marc
794ab16b32 add input with-suggested-libs for build command (#1032) 2026-02-16 18:38:35 +07:00
tricker
661723c99a change logs name
Co-authored-by: Marc <m@pyc.ac>
2026-02-16 12:26:49 +01:00
Yoram
d9834d05c6 upload debug logs on 'build php' failures 2026-02-16 11:35:42 +01:00
Yoram
9a53ef3498 add input with-suggested-libs for build command 2026-02-13 14:35:01 +01:00
Marc
f680731f9d fix: Postgres build with ancient libc (#1029) 2026-02-11 17:42:36 +01:00
Jerry Ma
0fe1442f7e Bump version from 2.8.0 to 2.8.2 2026-02-12 00:02:38 +08:00
Jerry Ma
1e4780397b Update test-extensions.php for PHP versions and extensions
Commented out older PHP versions and Windows 2025 in the test configuration. Updated the extensions to test for Linux and Darwin.
2026-02-11 23:32:19 +08:00
Kévin Dunglas
6b67cb90fc fix: Postgres build with ancient libc 2026-02-11 16:24:13 +01:00
Jerry Ma
b89ff3c083 Add com_dotnet extension (#1023) 2026-02-03 19:08:19 +08:00
Marc
0cfa2036f0 fix spx shared libadd (#1022) 2026-01-30 20:23:18 +01:00
henderkes
c5882c1f8e fix gettext v1.0 release 2026-01-30 19:41:39 +01:00
henderkes
4531c9fe57 add option to allow linking musl dynamically on alpine 2026-01-27 00:57:58 +01:00
henderkes
223dd10ac6 fix spx shared libadd 2026-01-24 20:26:19 +01:00
Marc
1c28f0f455 bunch of fixes/changes to make packages build (#1006) 2026-01-19 12:46:24 +01:00
henderkes
b3c450291a up version 2026-01-19 12:00:06 +01:00
crazywhalecc
372760e469 Update patch point docs 2026-01-19 18:56:28 +08:00
henderkes
6cf4c40cd2 Merge remote-tracking branch 'origin/main' into henderkes-patch-1 2026-01-19 11:22:03 +01:00
henderkes
af75ffaf24 suggestions, change openssldir 2026-01-19 10:22:33 +01:00
Marc
ae0217b3a1 add excimer extension (#1018) 2026-01-19 09:25:30 +01:00
henderkes
1e2b4017ac test excimer 2026-01-17 11:28:47 +01:00
henderkes
19f941797e zig now supports -Wl,-exported_symbols_list 2026-01-17 11:28:05 +01:00
Marc
0b863cbc70 Merge branch 'main' into feat/excimer 2026-01-17 10:53:35 +01:00
henderkes
b09337de09 add excimer extension 2026-01-17 10:51:21 +01:00
henderkes
d902e70b4d fix arm64 builds 2026-01-16 12:28:41 +01:00
Jerry Ma
cd2dc5bce4 Fix nghttp2 and curl build configurations for static linking (#1014) 2026-01-13 16:51:57 +08:00
henderkes
34910d18e9 add patch point for shared ext build 2026-01-04 02:31:41 +01:00
henderkes
3a17cec521 deploy extensions with -release flag too 2026-01-03 19:15:57 +01:00
henderkes
94644d374f fix 2026-01-03 19:12:16 +01:00
henderkes
f8b0c2c980 add release thing to extension build too 2026-01-03 19:08:14 +01:00
henderkes
6bbb3c969c remove -release handling functionality 2026-01-03 17:03:43 +01:00
henderkes
76025b95c1 missing space 2026-01-03 16:46:14 +01:00
henderkes
1be353fd13 more concise message 2026-01-03 16:45:55 +01:00
henderkes
54001ab868 simplify logic a bit 2026-01-03 16:33:40 +01:00
henderkes
890ff475f1 our memcache patch prevents shared building 2026-01-03 14:09:16 +01:00
henderkes
559a2909a9 use little trick to order libargon2 before libsodium 2026-01-02 23:21:29 +01:00
henderkes
fff2484529 postgresql doesn't build under c23 2026-01-02 22:52:03 +01:00
henderkes
d1b194999d use OPENSSL_CONF directory for openssl default configuration 2026-01-02 21:13:22 +01:00
henderkes
64f7a3553e don't need it anymore 2026-01-01 12:33:55 +01:00
henderkes
a06cc32491 pin libpng to released tags, not git 2025-12-30 11:58:57 +01:00
henderkes
022fdb2fc5 fix no-strip 2025-12-29 23:58:54 +01:00
henderkes
7688a55656 don't get zig master branch 2025-12-29 22:16:53 +01:00
henderkes
08388c0b15 force enable tailcall vm with zig 2025-12-29 22:12:25 +01:00
henderkes
e7a88f1df7 enable fat for gmp when next version releases 2025-12-29 21:15:53 +01:00
henderkes
2f3122627e make grpc php 8.5 compatible 2025-12-28 12:44:24 +01:00
henderkes
93a35908de factor grpc extension out to ext-grpc, keep library for now, even though unused 2025-12-28 12:11:56 +01:00
henderkes
5ef4623051 grpc will fail for php 8.5, it's not updated yet 2025-12-27 23:05:35 +01:00
henderkes
e952f1c76a we don't even need to build grpc library for grpc extension... 2025-12-27 22:36:24 +01:00
henderkes
09b89a30f9 WIP: use system libraries for grpc without building our own grpc lib 2025-12-27 22:20:02 +01:00
henderkes
9a681a9fa6 add mariadb mysqlnd plugins 2025-12-27 21:22:10 +01:00
Jerry Ma
8650ce4f8f Add MACOSX_DEPLOYMENT_TARGET to env.ini (#1009) 2025-12-26 17:15:45 +08:00
crazywhalecc
f7ca621efe Test 2025-12-26 15:03:54 +08:00
henderkes
6b5200002e fix downloader selecting drafts 2025-12-20 23:29:25 +01:00
henderkes
53f7cdefe0 fix swoole compilation with php 8.5.1 2025-12-18 20:12:01 +01:00
henderkes
e1a14bbb9f fix implicit include 2025-12-18 17:39:05 +01:00
henderkes
9e051c8c80 fix: check for link first before checking for is_dir 2025-12-18 17:32:02 +01:00
henderkes
e677be74d7 remove 2025-12-18 17:32:02 +01:00
henderkes
037d224fd7 why does phpstan think this is necessary? 2025-12-18 17:32:02 +01:00
henderkes
ce44e00bd4 @crazywhalecc how to use patch points to delete source dirs? 2025-12-18 17:32:01 +01:00
henderkes
0247458853 we were installing to wrong dir if source name != lib name 2025-12-18 17:32:01 +01:00
henderkes
656a58c3fa remove source dir after successful build in CI environment 2025-12-18 17:32:01 +01:00
Jerry Ma
9fdfef5057 macOS don't need to disable avx2 explicitly (#1007) 2025-12-18 21:21:47 +08:00
Marc
18c5ccfe9d the libwebp 1.6.0 bug affects centos 7 too (#1004) 2025-12-16 09:33:20 +01:00
henderkes
d064e1353c the libwebp 1.6.0 bug affects centos 7 too 2025-12-15 18:50:20 +01:00
Jerry Ma
3c89ce6c7f Update version to 2.7.10 (#997) 2025-12-10 17:14:27 +08:00
Marc
07ea1e2887 update libwebp and libxml2 (#982) 2025-12-10 10:01:24 +01:00
Jerry Ma
f0b5e4f59e Fix typo in ncurses.php enable-symlinks option (#994) 2025-12-10 15:43:24 +08:00
Marc
a54021bf19 Apply suggestion from @henderkes 2025-12-10 08:42:28 +01:00
henderkes
dce63d3c87 we need extensions to explicitly tell which c std they need 2025-12-06 11:18:10 +01:00
henderkes
47ab5d7584 use c17 for extensions as well? 2025-12-05 13:57:28 +01:00
henderkes
b2182b4fe1 use source extract hook for pdo_sqlsrv 2025-12-05 12:20:14 +01:00
henderkes
1d5aec037b c17 instead 2025-12-05 12:14:57 +01:00
henderkes
6b5f702719 ncurses can't build with std=c23 (default with gcc 15) 2025-12-05 11:43:51 +01:00
henderkes
7bdcda1d62 gmp can't build with std=c23 (default with gcc 15) 2025-12-05 11:37:35 +01:00
henderkes
66840a8eed update xdebug to use pie sources 2025-12-05 09:15:22 +01:00
henderkes
98773ee5a6 zig toolchain can always use libc 2025-12-03 15:02:14 +01:00
henderkes
719d818fd1 we need to check for structure of pdo_sqlsrv extension 2025-12-02 21:34:32 +01:00
henderkes
b8444070ee update go-xcaddy version automatically 2025-12-01 20:41:58 +01:00
henderkes
5b4f4f8e55 maybe? 2025-12-01 19:55:51 +01:00
henderkes
22d263c0a8 maybe explicit mavx2?! 2025-12-01 19:27:44 +01:00
henderkes
150d866c15 revert turning off sse for libwebp, need to check why debian fails building 2025-12-01 19:12:43 +01:00
henderkes
c051a48d56 don't add -l:libstdc++.a if we're not actually using gcc/clang 2025-12-01 17:28:59 +01:00
henderkes
b965ffcd82 don't build extra programs 2025-12-01 17:16:59 +01:00
henderkes
7f863d182f don't remove dir, just don't build tests 2025-12-01 17:10:56 +01:00
henderkes
d1041c57dc remove openssl source/test dir (4.1gb?!) 2025-12-01 17:05:50 +01:00
henderkes
14b822a185 don't build avx2 if we don't have it 2025-12-01 16:55:52 +01:00
Marc
7204d277b4 Update PHP extensions for Linux and Darwin 2025-12-01 11:39:56 +01:00
Marc
5a0fd40dc4 update libwebp and libxml2 2025-12-01 09:55:46 +01:00
Marc
59a6e27532 add pcov extension (shared only, like xdebug) (#979) 2025-12-01 08:12:39 +01:00
Marc
6b3b841c0e Fix cross-device warning in rename function (#978) 2025-11-30 16:08:09 +01:00
henderkes
e6591ffe9c add pcov extension (shared only, like xdebug) 2025-11-29 14:03:17 +01:00
crazywhalecc
e316971764 Fix cross-device warning in rename function 2025-11-29 14:08:34 +08:00
Marc
d55278714f we need to change source_path for shared build (#977) 2025-11-26 16:10:27 +07:00
Jerry Ma
cb7eca9049 Bump version from 2.7.8 to 2.7.9 2025-11-26 17:08:49 +08:00
henderkes
5b8c9e6f09 we need to change source_path for shared build 2025-11-26 09:37:21 +01:00
Jerry Ma
5d1043334d Add extension maxminddb support for macOS and Linux (#975) 2025-11-26 15:32:26 +08:00
Marc
f24cbcf909 fix silly mistake in trader config.m4 (#973) 2025-11-25 08:12:50 +01:00
henderkes
76a07c32ba fix silly mistake in trader config.m4 2025-11-24 14:24:12 +01:00
Marc
e0c69086dc don't download musl if zig isn't building for musl (#972) 2025-11-22 10:07:35 +01:00
henderkes
5606b70c1c don't download musl if zig isn't building for musl 2025-11-22 09:04:17 +01:00
Marc
28ae4242a6 add extra libs for curl (psl, krb5, unistring, idn2) (#968) 2025-11-21 15:05:40 +01:00
Jerry Ma
f14df1925c Store original source directory before modification 2025-11-21 22:03:41 +08:00
Marc
e9ad3c0011 Merge branch 'main' into feat/libcurl-extra 2025-11-21 09:21:22 +01:00
Marc
e2ad31e858 Support PHP 8.5 release (#971) 2025-11-21 09:16:13 +01:00
Marc
af614cd7ce Fix indentation in PhpSource.php 2025-11-21 08:51:30 +01:00
Marc
e21b0ec89d Apply suggestion from @henderkes 2025-11-20 18:21:39 +01:00
Marc
3069b51c09 we have 8.5! 2025-11-20 18:19:41 +01:00
henderkes
1662ac4cf8 framework! 2025-11-19 15:20:05 +01:00
henderkes
1e09017549 frameworks? 2025-11-19 14:49:37 +01:00
henderkes
84e9f13688 framework? 2025-11-19 14:48:10 +01:00
henderkes
2b0a0bdad9 fix cs 2025-11-19 13:54:45 +01:00
henderkes
e8d1970f55 secure_getenv not available on macos 2025-11-19 13:54:17 +01:00
henderkes
6861e9c2c7 append ld_library_path for musl toolchain 2025-11-19 11:59:09 +01:00
henderkes
376b8e7569 remove psl 2025-11-19 10:48:24 +01:00
Marc Henderkes
875e1d05cd libedit instead of readline 2025-11-18 17:50:49 +01:00
Marc Henderkes
9382161b6f Revert "add gsasl"
This reverts commit a1b8d201ae.
2025-11-18 17:49:10 +01:00
Marc Henderkes
a1b8d201ae add gsasl 2025-11-18 17:47:26 +01:00
Marc Henderkes
1fed8f2802 add required libs to krb5 2025-11-18 17:22:27 +01:00
Marc Henderkes
ecea6c12cd libs for macos too 2025-11-18 14:35:58 +01:00
Marc Henderkes
81dce02431 use lgpl 2025-11-18 14:06:15 +01:00
Marc Henderkes
a33ca44ca9 test curl 2025-11-18 11:28:25 +01:00
Marc
aee733b51f Merge branch 'main' into feat/libcurl-extra 2025-11-18 11:22:05 +01:00
Marc Henderkes
54ceca8680 add extra libs for curl (psl, krb5, unistring, idn2) 2025-11-18 11:17:12 +01:00
Jerry Ma
90981e3877 Export php binary external debug symbol files (#953) 2025-11-17 11:53:30 +08:00
henderkes
d69826eb4a update php 8.5 to RC5 2025-11-16 11:30:53 +01:00
Marc
dc83282019 remove SPC_CMD_VAR_PHP_CONFIGURE_CFLAGS, use eu-strip (#966) 2025-11-12 20:51:06 +01:00
henderkes
23c0d6f4aa simplify deployBinary a little bit 2025-11-12 10:11:29 +01:00
henderkes
8e4d4b7be5 suggestion 2025-11-11 16:51:30 +01:00
henderkes
ee906aaff9 Merge remote-tracking branch 'origin/feat/no-strip' into frankenphp/mbed 2025-11-11 15:56:10 +01:00
henderkes
e2b80e7f03 update building of frankenphp 2025-11-11 15:53:44 +01:00
henderkes
09073c5517 sort config and remove lonesome configure cflags 2025-11-11 15:51:28 +01:00
Marc
00050f4d0e Merge branch 'main' into feat/no-strip 2025-11-11 15:17:16 +01:00
crazywhalecc
cff6ec17ea Remove escape backslashes 2025-11-11 15:02:21 +01:00
henderkes
64079d9331 simplify regex 2025-11-11 15:02:20 +01:00
henderkes
541889d17b update to rc4 2025-11-11 15:02:20 +01:00
henderkes
c91128995d update freetype download to get latest version 2025-11-11 15:02:20 +01:00
henderkes
fd2b7af1dc make --with-frankenphp-app=dir work with docker scripts 2025-11-11 15:02:20 +01:00
henderkes
081e2d2846 fix debugflags being backwards 2025-11-11 15:02:19 +01:00
DubbleClick
9edb9417a1 add --with-frankenphp-app option to embed an app
# Conflicts:
#	config/lib.json
#	src/SPC/builder/unix/UnixBuilderBase.php
2025-11-11 15:02:17 +01:00
Marc
4ae4165ba2 add --with-frankenphp-app=/path/to/app option (#891) 2025-11-10 10:37:07 +01:00
crazywhalecc
e441a575ea Remove escape backslashes 2025-11-10 13:26:17 +08:00
henderkes
1575016885 simplify regex 2025-11-09 23:35:49 +01:00
crazywhalecc
987ad4b846 Use diff to detect and deploy-patch new shared extensions that built with php 2025-11-09 17:13:41 +08:00
crazywhalecc
f4b03ae835 Introduce standalone DirDiff util class 2025-11-09 17:12:22 +08:00
henderkes
d6de01d05c update to rc4 2025-11-09 10:01:19 +01:00
henderkes
09b7159119 update freetype download to get latest version 2025-11-08 09:41:12 +01:00
henderkes
4198ddd5d1 make --with-frankenphp-app=dir work with docker scripts 2025-11-07 11:06:50 +01:00
Marc
8332ed87e0 Merge branch 'main' into frankenphp/mbed 2025-11-07 10:51:55 +01:00
crazywhalecc
f6b091498f Fix missing debug link and debug option 2025-11-06 16:51:46 +08:00
crazywhalecc
a45f314447 Remove for pure test 2025-11-06 16:31:24 +08:00
crazywhalecc
8c8cb70174 phpstan fix 2025-11-06 16:27:11 +08:00
crazywhalecc
f09c18e78f Use separated deploy functions 2025-11-06 16:24:59 +08:00
crazywhalecc
f5d93d2f54 Merge branch 'main' into feat/no-strip 2025-11-06 14:55:54 +08:00
Marc
7402fbf7c1 Use cmake to build librdkafka, add helper function for SPCConfigUtil (#955) 2025-11-04 14:58:58 +01:00
crazywhalecc
2c590e5895 Define dependencies with kv array 2025-11-04 15:52:52 +08:00
crazywhalecc
463a98b1bf Support suggested libs not specified by with-suggested-libs 2025-11-04 13:51:11 +08:00
crazywhalecc
6d1c6d7f61 Add PHPDocs 2025-11-04 13:38:11 +08:00
crazywhalecc
08362fb6e5 Add helper function for SPCConfigUtil 2025-11-04 13:36:29 +08:00
crazywhalecc
4d5641f6ec Change librdkafka to cmake 2025-11-04 13:35:43 +08:00
crazywhalecc
f34ecf9468 Use pkg-configs for librdkafka 2025-11-04 13:35:31 +08:00
crazywhalecc
aa5c829fae Add missing file and line for Unhandled exception 2025-11-04 13:35:15 +08:00
Marc
fc118d709e Remove deduplication of pkg-config libraries
Removed deduplication of pkg-config libraries.
2025-11-03 21:58:46 +01:00
henderkes
589a4a9803 test rdkafka with all suggested libs 2025-11-03 21:13:47 +01:00
Marc
944e314bab Merge branch 'main' into feat/rdkafka-ssl 2025-11-03 20:48:19 +01:00
henderkes
0b17ce9e61 test rdkafka with all suggested libs 2025-11-03 20:47:42 +01:00
henderkes
ed4978bb89 add frankenphp version 2025-11-03 20:40:50 +01:00
henderkes
7a4f28e939 add frankenphp version 2025-11-03 20:39:26 +01:00
henderkes
5cb6a75e7d add extra features to librdkafka (curl, ssl, sasl 2025-11-03 20:29:15 +01:00
crazywhalecc
757af25d8f Suggestions 2025-11-01 00:49:50 +08:00
crazywhalecc
5e3e7eccbf Update version to 2.7.7 2025-10-31 16:48:55 +08:00
crazywhalecc
9738fcd6cd Update env.ini docs 2025-10-31 16:48:36 +08:00
crazywhalecc
5a6a33303c Export php binary debug symbols for mac, linux and windows 2025-10-31 16:48:21 +08:00
Marc
ae15d6c5f5 fix postgresql libraries when --with-suggested-libs is false (#952) 2025-10-31 09:46:21 +01:00
henderkes
ff15973a25 suggestions 2025-10-31 09:08:15 +01:00
henderkes
b88a68dab8 fix postgresql libraries when --with-suggested-libs is false 2025-10-29 18:55:26 +01:00
Jerry Ma
b05bdcd83d Add snmp and net-snmp support for macOS and Linux (#946)
Co-authored-by: Marc <m@pyc.ac>
2025-10-29 11:56:36 +08:00
Jerry Ma
6a4ad34324 Add trader extension support (#951) 2025-10-29 11:54:35 +08:00
henderkes
9a2d94cc33 fix debugflags being backwards 2025-10-28 18:50:16 +01:00
Jerry Ma
f1d1d4fe10 Beautify docs (#948) 2025-10-28 18:56:18 +08:00
crazywhalecc
fa6fa1c425 Add docs 2025-10-27 09:56:47 +08:00
Jerry Ma
f8c8300c9c Add Windows CGI SAPI build support (#927) 2025-10-25 16:04:00 +08:00
crazywhalecc
09198b431f Use unified configure args format 2025-10-25 15:41:48 +08:00
crazywhalecc
f426ced789 Use phpmicro patches instead 2025-10-25 13:42:04 +08:00
crazywhalecc
bab330b64e Unify CGI deploy functions 2025-10-25 03:03:40 +08:00
crazywhalecc
b59a06face Add backward patches for win32 2025-10-25 02:56:38 +08:00
crazywhalecc
bb44e88c3b Merge branch 'refs/heads/main' into sapi/cgi-win
# Conflicts:
#	src/globals/test-extensions.php
2025-10-25 00:11:45 +08:00
Marc
8649068159 Merge branch 'main' into frankenphp/mbed 2025-10-24 16:50:28 +02:00
Marc
5476385553 Update PHP 8.5 to RC3, enable swoole-stdext for upcoming 6.1.0 release. (#944) 2025-10-24 12:09:46 +02:00
henderkes
56bac35768 do both in one go 2025-10-24 12:09:24 +02:00
henderkes
4cdc6a07ae fix php 8.5 2025-10-24 11:49:11 +02:00
crazywhalecc
c30b34ae5c Fix gettext missing symbols on macOS 2025-10-24 17:02:15 +08:00
Marc
da5c6fd084 Merge branch 'main' into fix/php85 2025-10-24 10:47:29 +02:00
Jerry Ma
a4b6499530 Fix libevent build, use newer cmake options (#945) 2025-10-24 16:34:07 +08:00
henderkes
eb4445ea59 use release tarballs from Daniel rather than automatically generated ones from github 2025-10-24 10:06:29 +02:00
crazywhalecc
be51bcfdfc Fix libevent build, use newer cmake options 2025-10-24 13:55:33 +08:00
henderkes
7bc4131c02 use correct license for gettext as we only build libs now, update gmp to dynamically check version 2025-10-23 23:11:30 +02:00
henderkes
da8debdade test php 8.5 with gettext 2025-10-23 22:19:53 +02:00
henderkes
ef5e664981 don't build iconv program, or gettext programs 2025-10-23 22:14:57 +02:00
henderkes
8e50af3a7e update to rc3 2025-10-23 21:28:49 +02:00
henderkes
8e96c64918 add stdext to swoole 2025-10-23 21:28:48 +02:00
henderkes
8a9c8a279d why does this fix compilation? 2025-10-23 21:28:48 +02:00
Marc
72ca0cecd1 Update license path for attr package (#941) 2025-10-23 13:32:43 +02:00
Marc
3564f6d0a7 Fix zip archive strip function for cross-device move (#942) 2025-10-23 13:32:12 +02:00
henderkes
d3e2b4b5b2 don't even build tools in the first place 2025-10-23 13:11:20 +02:00
crazywhalecc
c6de6e7056 test zip unarchive 2025-10-23 16:29:46 +08:00
crazywhalecc
55322a282c Fix rename cross-device link bug (using copy-delete) 2025-10-23 15:19:45 +08:00
Marc
6789ea81ff Update license path for acl in source.json 2025-10-22 19:52:21 +02:00
Marc
ac8a9af89c Update license path for attr package 2025-10-22 19:43:54 +02:00
Marc
553b817b2a prevent libedit from building strlcat/strlcpy, no idea why their sour… (#937) 2025-10-21 21:14:39 +07:00
henderkes
96592bce3e fix 2025-10-21 14:26:44 +02:00
henderkes
4e393886aa no idea why our source has that uncommented 2025-10-21 14:23:55 +02:00
henderkes
2e13be2a7a prevent libedit from building strlcat/strlcpy, no idea why their soure code doesn't prevent this correctly itself 2025-10-21 13:54:34 +02:00
Jerry Ma
41fb29eba4 Feat/pie (#936) 2025-10-21 18:58:04 +08:00
Jerry Ma
b519291fa2 PIE download support & Downloader and ConfigValidator enhance (#934) 2025-10-21 16:20:13 +08:00
crazywhalecc
dd752cd5be Fix windows 7z unzip strip function, fix windows pkg extract files path 2025-10-21 15:50:12 +08:00
Marc
6a153f9aa0 also install-modules of course... (#933) 2025-10-21 10:06:56 +07:00
henderkes
bba390dbcc add runtime libs to unixshell (debian 11 is stupid and doesn't add them automatically) 2025-10-20 23:04:33 +02:00
henderkes
32efeb970c don't build ossfuzzer for zip 2025-10-20 23:00:23 +02:00
henderkes
310335813f use libedit for postgreqsql 2025-10-20 21:24:21 +02:00
crazywhalecc
487980c9a8 phpunit fix 2025-10-20 13:48:52 +08:00
crazywhalecc
f8801e224f phpstan fix 2025-10-20 13:43:05 +08:00
crazywhalecc
5e229a0b01 Update dependencies 2025-10-20 13:41:41 +08:00
crazywhalecc
49cfcbe92d Update docs 2025-10-20 13:41:33 +08:00
crazywhalecc
4e4ce282db Fix zip extract not strip dir bug 2025-10-20 13:41:25 +08:00
crazywhalecc
e2fd3e18d6 Refactor ConfigValidator, make it more strict 2025-10-20 13:41:02 +08:00
crazywhalecc
605c06f85c Add pie support for downloading sources 2025-10-20 13:39:13 +08:00
Marc
4cdefeab81 test with modules to build
linux should use install-modules now, macOS should not (zip is not built with php)
2025-10-19 11:03:39 +02:00
henderkes
8ab09898f0 conditional install-modules 2025-10-19 10:41:14 +02:00
henderkes
9c8b4d627c also install-modules of course... 2025-10-19 09:08:50 +02:00
Marc
8923077120 don't use full install target, don't install-binaries (#932) 2025-10-18 21:21:42 +07:00
henderkes
29c31d90e5 also only do that for macos (saves build time) 2025-10-18 11:35:41 +02:00
henderkes
e281d26a3a Merge remote-tracking branch 'origin' into fix/frankenphp-readline 2025-10-18 11:35:14 +02:00
henderkes
8ed68f481a don't pass unused envs 2025-10-18 11:31:20 +02:00
henderkes
b1abff61a5 don't use full install target, don't install-binaries 2025-10-18 11:08:55 +02:00
crazywhalecc
15638cea4c Add log dir expose, unify SPC_FIX_DEPLOY_ROOT parsing 2025-10-18 12:52:59 +08:00
Marc
9ed77c10e0 use the spx upstream version (#931) 2025-10-17 23:55:37 +07:00
crazywhalecc
ccf262d202 Update test workflow to trigger on pull request events only 2025-10-17 13:28:00 +08:00
crazywhalecc
4be894bc10 Remove ds and gd test 2025-10-17 10:15:05 +08:00
crazywhalecc
6440863ce4 Remove igbinary 2025-10-17 09:25:44 +08:00
henderkes
25d7c72b6e use the upstream version 2025-10-16 23:19:24 +07:00
crazywhalecc
dc4dd6ffa4 Full test 2025-10-16 20:52:20 +08:00
crazywhalecc
bf79134405 Fix tsrmls cache define patches 2025-10-16 20:42:26 +08:00
crazywhalecc
4f8b9d0f81 Fix patches 2025-10-16 02:18:24 +08:00
crazywhalecc
70bda268e5 Fix patches, add more debug comments 2025-10-16 01:51:22 +08:00
crazywhalecc
e559dce9d5 Reduce tests 2025-10-16 01:35:30 +08:00
crazywhalecc
6a98a6bf5e Use BUILD_BIN_PATH instead 2025-10-16 01:32:56 +08:00
crazywhalecc
9b53133ba4 test 2025-10-16 01:19:10 +08:00
crazywhalecc
5b319b0df1 test 2025-10-16 01:16:22 +08:00
crazywhalecc
572bf919aa test 2025-10-16 01:13:26 +08:00
crazywhalecc
1d960a9084 test 2025-10-16 01:05:06 +08:00
crazywhalecc
4b28d1c2df test 2025-10-16 01:04:42 +08:00
crazywhalecc
9c8fd4d45d cs fix 2025-10-16 00:59:33 +08:00
crazywhalecc
b62f029da7 cs fix 2025-10-16 00:56:28 +08:00
crazywhalecc
c711a3666e Add Windows CGI SAPI build support 2025-10-16 00:55:21 +08:00
Marc
487c6da4ac switch readline to libedit (#919) 2025-10-15 10:21:00 +02:00
Marc
e942b13d73 Merge branch 'main' into libedit 2025-10-13 21:28:15 +02:00
Jerry Ma
c5ae719b9c Update src/SPC/builder/unix/library/postgresql.php
Co-authored-by: Marc <m@pyc.ac>
2025-10-14 00:08:40 +08:00
crazywhalecc
7b6e707e24 Remove unnecessary macOS 15 bug CFLAGS from PostgreSQL build configuration 2025-10-14 00:08:40 +08:00
crazywhalecc
0114700dad Fix PostgreSQL build compatibility for aarch64 on glibc 2.17 and update test configurations 2025-10-14 00:08:40 +08:00
Marc
ec9364db69 use latest zip version for building shared (#917) 2025-10-13 11:28:16 +02:00
Marc
033e29985e Merge branch 'main' into feature/shared-exts 2025-10-13 11:20:54 +02:00
Marc
61cba2342d Drop macos-13 from actions runner (#922) 2025-10-13 11:20:37 +02:00
Marc
a3acad4ef3 Update config/source.json 2025-10-13 10:59:31 +02:00
Marc
1e13eb4abe Merge branch 'main' into ci/macos-15-intel 2025-10-13 10:38:48 +02:00
Jerry Ma
1bac06fe3c Remove more macOS 14 case from shared extensions switch
Yeah. Copied by tab.
2025-10-13 08:27:40 +08:00
Marc
762a768969 Merge branch 'main' into feature/shared-exts 2025-10-12 23:23:25 +02:00
Marc
d0a6e3a860 update pgsql version to 18.0, php 8.5 to RC2 (#916) 2025-10-12 22:59:09 +02:00
henderkes
995187d258 extra information for steps 2025-10-12 22:32:27 +02:00
henderkes
5333a04e1c clarification 2025-10-12 22:27:38 +02:00
henderkes
19be5263b5 add error 2025-10-12 22:26:06 +02:00
crazywhalecc
6e79401ab5 Add missing libs for suggested option defined 2025-10-13 00:21:13 +08:00
crazywhalecc
903036f1c0 Bump version 2025-10-13 00:00:31 +08:00
crazywhalecc
6bd3eea0fe Use SPCConfigUtil for postgresql build, refactor patches 2025-10-12 23:54:59 +08:00
crazywhalecc
f28a3cf5a3 Drop macos-13 from actions runner 2025-10-12 22:33:22 +08:00
Marc
c828c2c6e4 Merge branch 'main' into feature/shared-exts 2025-10-12 11:35:57 +02:00
Marc
26ccaa4449 Merge branch 'main' into libedit 2025-10-12 11:34:11 +02:00
Marc
ae1193ab16 Merge branch 'main' into pgsql-18 2025-10-12 11:28:49 +02:00
Marc
6d6a29368e fix building of shared extensions (grpc, simdjson, soap) (#905) 2025-10-12 11:24:32 +02:00
crazywhalecc
897cb00351 Use failsafe for SPC_EXTRA_PHP_VARS 2025-10-12 16:42:38 +08:00
henderkes
8a1689b79d don't fail build without ldap 2025-10-11 13:20:20 +02:00
henderkes
018dfae15e suggestions 2025-10-11 10:38:51 +02:00
Marc
c83e803c85 Merge branch 'main' into pgsql-18 2025-10-10 18:47:48 +02:00
henderkes
fa4d33671d update to RC2 2025-10-10 18:35:15 +02:00
henderkes
f8d77b9b50 remove pointless comments 2025-10-08 11:55:21 +02:00
henderkes
6594811536 remove pointless SPC_CMD_PREFIX_PHP_MAKE 2025-10-08 11:48:40 +02:00
henderkes
cc7eb7cd84 Merge remote-tracking branch 'origin/main' into libedit 2025-10-08 11:37:54 +02:00
Marc
e6408b4693 Fix static linux cli -a not working issue (#893) 2025-10-08 11:37:27 +02:00
henderkes
330c3486af extra readline check to make sure -a works 2025-10-08 10:45:23 +02:00
henderkes
b9dfb5afe3 maybe better this way 2025-10-08 10:17:14 +02:00
henderkes
565ac87b65 only apply readline fix for CLI compilation on linux 2025-10-08 10:05:02 +02:00
henderkes
f0c39c1770 fix #19871 2025-10-08 09:46:20 +02:00
henderkes
896cf889e4 test readline 2025-10-08 09:27:04 +02:00
henderkes
6b91570054 fix clang musl compilation 2025-10-08 09:26:20 +02:00
henderkes
31906b36e5 reorder stuff for readline 2025-10-08 08:48:30 +02:00
henderkes
4e2d4f3f05 fix ncurses build error (?: [] in case of false) 2025-10-08 08:47:48 +02:00
henderkes
ffdc2dc85a fix #918 (use COPYING.LIB instead of COPYING for libiconv) 2025-10-08 08:18:43 +02:00
DubbleClick
911bc74bf4 add libedit 2025-10-08 08:16:54 +02:00
henderkes
3467c9d291 patch correct file 2025-10-06 22:53:41 +02:00
henderkes
15cd8543f1 arm64 fix 2025-10-06 22:50:37 +02:00
henderkes
864db0ebc5 fix macos finally I hope 2025-10-06 22:49:28 +02:00
henderkes
9ee623112d attempt to fix macOS? 2025-10-06 22:43:03 +02:00
henderkes
d789b1a472 fix musl toolchain (needs LD_LIBRARY_PATH) 2025-10-06 22:31:23 +02:00
henderkes
17a25b44e2 attempt fix for aarch64 #2 2025-10-06 22:26:00 +02:00
henderkes
781260f3fc attempt fix for aarch64 2025-10-06 22:11:17 +02:00
henderkes
6c43fa55b1 don't use -static, shared libraries cannot link against static musl libc and linking isn't done for static libraries yet 2025-10-06 21:37:36 +02:00
henderkes
c4440668bb make sure -DFRONTEND is used 2025-10-06 21:28:57 +02:00
henderkes
e437bf2ffe don't test macos 13 2025-10-06 21:05:05 +02:00
henderkes
0f2d2d5734 test pgsql without macos 13 2025-10-06 21:03:57 +02:00
henderkes
a49ae05599 use latest zip version for building shared 2025-10-06 21:00:45 +02:00
henderkes
8ae2755dbe update php 8.5 to rc1 2025-10-06 20:14:52 +02:00
henderkes
3966bd5f0a update pgsql version to 18.0 2025-10-06 20:06:37 +02:00
Marc
384ba54c79 update extension count (#914) 2025-10-04 08:56:30 +02:00
Marc
26dbc922eb update extension count
we now sit at 101 🎉
2025-10-04 08:39:45 +02:00
henderkes
31a4498056 bring back simdjson tests, extension headers do not properly guard for avx512 symbols 2025-09-30 15:07:22 +02:00
henderkes
044275d909 typo 2025-09-30 14:22:38 +02:00
henderkes
c5316f9231 -v3 doesn't have avx512 yet 2025-09-30 14:21:31 +02:00
henderkes
2d1a61d184 explicitly disable avx512 if zig and march not high enough 2025-09-30 14:00:13 +02:00
henderkes
f7744188f4 fix configutil 2025-09-30 00:34:30 +02:00
henderkes
5b6c923eef snappy is a c++ lib 2025-09-30 00:31:20 +02:00
henderkes
b0b031afb2 add docstring 2025-09-30 00:18:32 +02:00
henderkes
fe09d8c03e add docstring 2025-09-30 00:17:53 +02:00
henderkes
c2813d5736 move hasCpp to SPCConfigUtil 2025-09-30 00:12:59 +02:00
Marc
8b2b658ced Merge branch 'main' into fix/grpc-shared 2025-09-29 23:27:58 +02:00
henderkes
e862bacc8a php 8.5 has beta 3 2025-09-29 21:15:56 +02:00
henderkes
cac57dbf79 php 8.5 has beta 3 2025-09-29 21:15:18 +02:00
crazywhalecc
345fe783cc Add version table in docs 2025-09-24 15:46:54 +08:00
crazywhalecc
55efe6d65b Add gnu-bulk 2025-09-24 15:46:54 +08:00
crazywhalecc
dccbc30972 update README 2025-09-24 15:46:54 +08:00
crazywhalecc
f914a82379 Add PHP version, remove duplicate desc 2025-09-24 15:46:54 +08:00
crazywhalecc
18979d8fb6 Simplify README 2025-09-24 15:46:54 +08:00
henderkes
21149f6807 simdjson needs patch 2025-09-23 12:42:29 +02:00
henderkes
93e6dcab1d cflags and cxxflags separately 2025-09-23 12:01:09 +02:00
henderkes
59dedbea2c simdjson requires +evex512 (for zig-cc) 2025-09-23 12:00:15 +02:00
henderkes
8bda4fd31e simdjson requires +evex512 2025-09-23 11:59:30 +02:00
henderkes
8039ea49f9 soap requires libxml and session 2025-09-23 11:56:12 +02:00
henderkes
fc90b4ae23 allow appending pkg_config_path #910 2025-09-22 13:10:48 +02:00
henderkes
e02be69e40 update grpc from 1.68.x to 1.75.x 2025-09-21 21:01:07 +02:00
henderkes
35a90f2769 skip -mcpu or -march=armv8-... flags because zig doesn't support them (stupid grpc build thirdparty hardcode) 2025-09-21 20:32:47 +02:00
henderkes
fa87149631 shallow submodules as well (grpc download goes from 2.9 gb to 900mb) 2025-09-21 19:59:24 +02:00
Marc
8dfe722e14 Merge branch 'main' into fix/grpc-shared 2025-09-19 15:31:25 +02:00
henderkes
dcbfe1e0ab e-dant/watcher is a c++ library too 2025-09-19 15:29:49 +02:00
Marc
e11946fd10 also install g++ with doctor (not preinstalled on ubuntu, not include… (#904) 2025-09-19 15:22:17 +02:00
henderkes
44399cd185 remove -Wl,--as-needed for imagemagick build 2025-09-19 09:21:17 +02:00
henderkes
927d7f55ba make sure -ldl is not taken as needed, problem on EL8 2025-09-18 22:47:01 +02:00
henderkes
e323d7b155 revert to private 2025-09-18 21:41:35 +02:00
henderkes
d0b253c346 not required 2025-09-18 21:36:38 +02:00
henderkes
81430e6853 also use libstdc++.a for grpc? 2025-09-18 21:29:46 +02:00
henderkes
83696e92b7 remove whitespace 2025-09-18 20:12:41 +02:00
henderkes
b0538c09bf deduplicate those to make it more readable 2025-09-18 20:09:17 +02:00
henderkes
40f89d1dca is shared_libadd enough? 2025-09-18 19:44:48 +02:00
henderkes
fa2e041cc9 test shared grpc, imagick 2025-09-18 19:01:10 +02:00
Marc
3c614663a3 Merge branch 'main' into fix/grpc-shared 2025-09-18 18:22:42 +02:00
henderkes
b5c7185374 add comment for new method 2025-09-18 18:20:26 +02:00
henderkes
d0a9a3a594 fix return of array 2025-09-18 18:17:48 +02:00
henderkes
2e6329bb86 add cpp-library for imagemagick too 2025-09-18 18:16:42 +02:00
henderkes
d3ba04fc5b fix grpc shared build (ignores CXXFLAGS, needs CPPFLAGS) 2025-09-18 18:16:41 +02:00
Marc
7a78ea0185 Merge branch 'main' into fix/g++ 2025-09-18 17:35:44 +02:00
henderkes
36b04f9eba also install g++ with doctor (not preinstalled on ubuntu, not included in gcc package) 2025-09-18 17:24:08 +02:00
Marc
79ab6490fd fix CustomPackage handling (#897) 2025-09-18 13:37:26 +02:00
henderkes
191d345250 update paths to only install once 2025-09-18 12:41:36 +02:00
henderkes
311ee40ae4 update LinuxToolCheckList.php to install perl-Time-Piece to make openssl work 2025-09-18 11:58:58 +02:00
henderkes
808d224b08 build frankenphp before shared extensions again 2025-09-18 09:07:18 +02:00
Marc
4247883664 Merge branch 'main' into fix-zig 2025-09-18 08:06:23 +02:00
Marc
3198cc40c1 Remove icu backend from libxml2 (#903) 2025-09-17 10:46:05 +02:00
Marc Henderkes
8680e83af3 fix dba building shared 2025-09-16 14:43:49 +02:00
Marc
0156f33a20 Merge branch 'main' into remove-icu-backend 2025-09-16 13:35:46 +02:00
Marc Henderkes
df8b2dbf16 better patching for libstdc++ when extensions forget they need it 2025-09-16 13:10:10 +02:00
Marc Henderkes
30e174ac95 use any available english locale instead of requiring en_US.utf-8 2025-09-16 13:10:09 +02:00
Marc Henderkes
b9f8f02d98 don't use libicu backend for libxml2
(it's discouraged from being used, the first path always goes through iconv, icu is only the fallback)
2025-09-16 13:10:09 +02:00
henderkes
0b0ae270da we lost a v somehow 2025-09-10 23:35:17 +07:00
henderkes
893ce31b17 only install pkgs for crafting when necessary 2025-09-10 23:28:20 +07:00
crazywhalecc
e35d6c2651 Oh, we also support windows here 2025-09-09 19:43:08 +08:00
crazywhalecc
8dd0512335 Fix macOS lib-depends 2025-09-09 19:43:08 +08:00
henderkes
5c1194ea92 fix custompackage handling 2025-09-09 12:10:06 +07:00
Marc
953ed83df5 Merge pull request #896 from crazywhalecc/fix-zig
Fix zig -isystem overriding
2025-09-08 11:00:03 +02:00
henderkes
c330d02e78 update pkg paths to not double the $arch-$os 2025-09-08 14:18:03 +07:00
henderkes
af6a23011c fix zig relative directory 2025-09-08 13:33:44 +07:00
Abi أب
882ae07deb libxml2 arg typo 2025-09-07 22:56:41 +08:00
crazywhalecc
be7c002869 Patch only when building cli 2025-09-07 16:10:50 +08:00
crazywhalecc
e621e4a5a1 test 2025-09-07 15:38:38 +08:00
crazywhalecc
bd815d4ea2 Fix static linux cli -a not working issue 2025-09-07 14:10:28 +08:00
crazywhalecc
4bc30b0b6f Add php-src/config.log for SPCException 2025-09-07 11:50:51 +08:00
DubbleClick
4d3501118e add --with-frankenphp-app option to embed an app 2025-09-05 21:47:41 +07:00
Marc
8d303348d9 Merge pull request #883 from crazywhalecc/sapi/cgi
Add cgi support for macOS and Linux
2025-09-05 11:52:26 +02:00
Marc
2a2f4120b9 Merge pull request #889 from crazywhalecc/franken
use our toolchain for go mod
2025-09-05 11:47:15 +02:00
Marc
15f8887f14 Update config/lib.json 2025-09-05 16:25:15 +07:00
crazywhalecc
fe945ab3ea Merge branch 'main' into sapi/cgi
# Conflicts:
#	composer.lock
2025-09-05 17:15:28 +08:00
crazywhalecc
e2b6f4cedd Merge branch 'main' into sapi/cgi 2025-09-05 17:14:27 +08:00
Jerry Ma
d82c86cf62 Fix docker doctor fix pkgroot volume overwrite bug (#882)
* Fix docker doctor fix pkgroot volume overwrite bug

* cs fix

* Remove pkgroot-private

* Use arch-specified pkgroot

* Update setup-runtime php version

* Add docker-entrypoint.sh

* Update dependencies

* cs fix

* test
2025-09-05 17:13:40 +08:00
henderkes
9df2867175 just always require libxml2 until we rework sapis to require their own stuff 2025-09-05 15:52:07 +07:00
henderkes
5c803d1553 fix cs 2025-09-05 15:31:30 +07:00
henderkes
d45b1853f8 fix cs 2025-09-05 15:28:51 +07:00
henderkes
1ac621fb9c use our toolchain for go mod 2025-09-05 15:20:24 +07:00
crazywhalecc
4e74ac1937 test 2025-09-05 15:02:45 +08:00
crazywhalecc
959734ac31 cs fix 2025-09-05 11:17:45 +08:00
crazywhalecc
166f3de52f Merge branch 'main' into feat/cgi 2025-09-05 11:17:34 +08:00
crazywhalecc
e3adfff16f Update dependencies 2025-09-05 11:14:56 +08:00
crazywhalecc
7cbc374278 Add docker-entrypoint.sh 2025-09-05 11:04:42 +08:00
crazywhalecc
129041402d Update setup-runtime php version 2025-09-05 11:00:57 +08:00
crazywhalecc
9ac578dfd6 Use arch-specified pkgroot 2025-09-05 11:00:46 +08:00
crazywhalecc
ef709a169b Remove pkgroot-private 2025-09-05 11:00:25 +08:00
Marc
2eeba33f94 Merge pull request #885 from crazywhalecc/dumb_github
switch getting frankenphp version to go mod (bypass rate limits)
2025-09-04 18:15:40 +02:00
henderkes
f4b2b9ae7d fix cs 2025-09-04 17:45:13 +07:00
henderkes
e44efb2a54 use go mod to bypass github rate limiting 2025-09-04 17:42:17 +07:00
henderkes
598f6d55c5 keep retrying more 2025-09-04 16:28:17 +07:00
crazywhalecc
a2c5c7e6e6 Add cgi SAPI 2025-09-04 14:05:00 +08:00
crazywhalecc
4f6e646812 cs fix 2025-09-04 12:13:57 +08:00
crazywhalecc
a79564f685 Fix docker doctor fix pkgroot volume overwrite bug 2025-09-04 12:03:13 +08:00
crazywhalecc
a77e49cbc9 Stubborn phpstan 2025-09-02 00:17:44 +08:00
crazywhalecc
cefb737fd2 Update version to 2.7.3 2025-09-02 00:17:44 +08:00
crazywhalecc
8c8aba2dd5 Fix unixodbc driver config searching path 2025-09-02 00:17:44 +08:00
Marc
97b18e9121 Merge pull request #877 from crazywhalecc/franken-retries
retry fetching frankenphp release info
2025-09-01 15:29:21 +02:00
gemini
ddc9cc2237 Fix cli generator: prefer-pre-built belongs to download-options rather than build-options 2025-09-01 20:44:37 +08:00
DubbleClick
aff803f334 retry fetching frankenphp release info 2025-09-01 19:07:29 +07:00
Marc
38ec03fe30 Merge pull request #871 from crazywhalecc/fix/frankenphp-dynamic-exports
build frankenphp and embed after shared extensions
2025-08-31 15:06:11 +02:00
Marc
55836771c9 Merge pull request #869 from crazywhalecc/pkg-config-pkg
turn pkg-config into a package
2025-08-31 15:04:41 +02:00
crazywhalecc
08a68796bf Call export in dynamic symbol getter 2025-08-31 18:05:09 +08:00
crazywhalecc
3b9efcb2d4 Put it into toolchain manager to skip in unit test 2025-08-31 15:24:29 +08:00
crazywhalecc
022ba3dce4 Merge branch 'main' into pkg-config-pkg
# Conflicts:
#	src/globals/test-extensions.php
2025-08-31 15:20:50 +08:00
crazywhalecc
86973e622d sort config 2025-08-31 15:06:59 +08:00
crazywhalecc
0fa38bad6d Use existing pkg-config builds and pre-built contents for packages 2025-08-31 15:04:34 +08:00
crazywhalecc
465bd3ce85 Use separated functions for exporting symbols 2025-08-31 14:24:28 +08:00
Jerry Ma
0c9130ab6c Update node version in vitepress-deploy.yml 2025-08-31 13:44:37 +08:00
crazywhalecc
6c75ecf0c4 Add docs search 2025-08-31 11:47:41 +08:00
DubbleClick
d533a0591b skip line before preg_replacing 2025-08-30 19:31:22 +07:00
DubbleClick
3f74d58503 fix macos, for real this time 2025-08-30 14:12:13 +07:00
DubbleClick
1ba92ccc99 fix patch version stripping (.\d -> .\d+) 2025-08-30 12:02:15 +07:00
DubbleClick
75db184077 fix macos command to print defined symbols? 2025-08-29 17:50:47 +07:00
DubbleClick
66902d74c4 cs fix 2025-08-29 16:38:48 +07:00
DubbleClick
f6cc6af39c macos? 3 2025-08-29 16:36:43 +07:00
DubbleClick
0da8dcf04a macos? 2 2025-08-29 15:14:54 +07:00
DubbleClick
190be6c7b9 macos? 2025-08-29 14:12:00 +07:00
DubbleClick
2972ab31d7 don't add empty dynamic list x) 2025-08-29 12:15:56 +07:00
DubbleClick
4b4ae9b014 write to a --dynamic-list file
see https://sourceware.org/binutils/docs-2.36/ld/Options.html
2025-08-29 10:53:38 +07:00
DubbleClick
20db00afcc no need to test all static targets, nothing changes for them 2025-08-29 10:26:46 +07:00
DubbleClick
56c90ca4a3 use all symbols from libphp.a, so we don't need to build shared extensions 2025-08-29 10:24:51 +07:00
DubbleClick
fad2314539 found ENABLE_SHARED option in liburing! 2025-08-29 09:25:32 +07:00
DubbleClick
460eb02086 build frankenphp and embed after shared extensions, make sure the linker doesn't drop libphp.a symbols that extensions need 2025-08-29 08:52:55 +07:00
Marc
5a30d509e7 Merge pull request #864 from crazywhalecc/swoolehooks
swoole hooks can be compiled if pgsql/sqlite are not compiled in statically
2025-08-29 03:46:30 +02:00
crazywhalecc
0f0050115c Update cli generator, add frankenphp SAPI, add copy-to-clipboard func 2025-08-28 22:35:51 +08:00
crazywhalecc
bf55db959e Add swoole-hook-odbc notes 2025-08-28 22:35:23 +08:00
DubbleClick
39a9840d49 why is phpstan so stupid about this constant? 2025-08-28 12:14:26 +07:00
DubbleClick
866ca264d9 only disable it for x86_64 2025-08-28 11:35:46 +07:00
DubbleClick
f18725083a disable opcache jit automatically on alpine target (only required for php < 8.5) 2025-08-28 11:32:33 +07:00
crazywhalecc
20fbbb1dbe test 2025-08-28 11:01:58 +08:00
crazywhalecc
1a7bf2d070 test 2025-08-28 10:49:02 +08:00
crazywhalecc
fc7e8ebc53 extension test 2025-08-28 10:29:22 +08:00
crazywhalecc
532360886e Merge branch 'main' into swoolehooks 2025-08-28 10:29:07 +08:00
crazywhalecc
117a54d077 extension test 2025-08-28 10:14:47 +08:00
DubbleClick
f2c131a2cc wno-int-conversion 2025-08-27 17:01:07 +07:00
DubbleClick
6f0310e8f7 cs fix 2025-08-27 16:46:58 +07:00
DubbleClick
c7141003db oops 2025-08-27 16:46:09 +07:00
DubbleClick
d32bdb2825 all env vars 2025-08-27 16:45:47 +07:00
DubbleClick
a66abfa583 test all OS 2025-08-27 16:35:24 +07:00
DubbleClick
2551772de4 use system cc 2025-08-27 16:34:29 +07:00
DubbleClick
25fe794acc trim all items 2025-08-27 14:36:05 +07:00
DubbleClick
694fd2f1e0 turn pkg-config into a package instead of a library 2025-08-27 14:33:39 +07:00
DubbleClick
5a4b920ae2 pkg-config patch 2025-08-27 13:04:08 +07:00
DubbleClick
95f1b65bca fix perl installation by checking for FindBin 2025-08-27 13:03:57 +07:00
DubbleClick
25401e5959 cs fix 2025-08-27 12:43:48 +07:00
DubbleClick
3da58d5c24 filter micro patches to not be '' 2025-08-27 11:48:59 +07:00
DubbleClick
08ab3c17d6 fix perl-IPC-Cmd check so it doesn't try installing it every time 2025-08-27 11:40:06 +07:00
DubbleClick
ecdb94b429 suggestions 2025-08-27 08:31:48 +07:00
DubbleClick
00892c20fa fix odbc libs when iconv is built too 2025-08-26 20:44:30 +07:00
DubbleClick
c433aed521 fix macos? 2025-08-26 19:35:10 +07:00
DubbleClick
1243fb9678 don't test macos as it just fails either way, add odbc test 2025-08-26 18:55:22 +07:00
DubbleClick
d9c2247f99 fix alpine realpath -s issue 2025-08-26 18:16:44 +07:00
DubbleClick
0d4d4283d1 only install library for liburing 2025-08-26 18:04:43 +07:00
DubbleClick
effefd4844 string 2025-08-26 14:51:07 +07:00
DubbleClick
2d409db2f9 we don't need a min glibc version, just don't use --use-libc! 2025-08-26 14:42:34 +07:00
DubbleClick
00f262571c cs fix 2025-08-26 14:08:09 +07:00
DubbleClick
4eac953c71 ensure liburing is only pulled in by suggested libs when glibc >= 2.30 (or musl) 2025-08-26 14:07:49 +07:00
DubbleClick
43352ab986 don't print repeated --ri swoole check 2025-08-26 01:01:45 +07:00
DubbleClick
9803bf6c3f prevent warning message from addons 2025-08-26 00:59:54 +07:00
DubbleClick
ba326973e5 prevent infinite recursion if ext suggests addons that depend on the extension 2025-08-26 00:56:57 +07:00
DubbleClick
a1f2126c00 update comments 2025-08-26 00:38:35 +07:00
DubbleClick
b1da64d46b add swoole-hook-odbc to work the same way as the other hooks 2025-08-26 00:24:40 +07:00
DubbleClick
2694dd9e21 add liburing for swoole 2025-08-25 22:57:04 +07:00
Marc
37e0f1d3f3 Update src/SPC/command/BuildPHPCommand.php 2025-08-25 19:50:41 +07:00
DubbleClick
f80aee5133 get rid of $rt 2025-08-25 19:31:15 +07:00
DubbleClick
65ee7479ac suggestion and clean up frankenphp build 2025-08-25 19:29:10 +07:00
DubbleClick
868f6d408b only feed -lgcov to the go driver 2025-08-25 18:44:03 +07:00
DubbleClick
efdfbf437a use format string 2025-08-25 18:23:04 +07:00
DubbleClick
2b57bca55c remove useless import 2025-08-25 15:30:04 +07:00
DubbleClick
99ccbf8a40 @crazywhalecc please look what's wrong with macos 2025-08-25 15:28:53 +07:00
DubbleClick
9fe322375f use 8.4 for tests only 2025-08-25 14:55:30 +07:00
DubbleClick
d13e369994 test swoole 2025-08-25 13:11:40 +07:00
DubbleClick
a46ad7b81e cs fix 2025-08-25 12:58:12 +07:00
DubbleClick
324ba0d3dc use type=addon and arg-type=none 2025-08-25 12:57:49 +07:00
DubbleClick
1c7fa0132d remove space 2025-08-25 12:44:34 +07:00
DubbleClick
93223a9d44 too much pgo, too little pdo 2025-08-25 12:43:21 +07:00
DubbleClick
b6d4af218b zts -> --enable-swoole-thread 2025-08-25 12:42:36 +07:00
DubbleClick
448941f741 don't request configurearg if it's not used (ease debugging) 2025-08-25 12:36:10 +07:00
DubbleClick
7e0e9091be explicitly enable swoole-mysql too 2025-08-25 12:11:56 +07:00
DubbleClick
8104ff7236 update checks for shared swoole-hook extensions 2025-08-25 12:08:53 +07:00
DubbleClick
75f734daa8 cs fix 2025-08-25 11:22:35 +07:00
DubbleClick
779a724875 go's gcc driver is the dumbest shit to ever exist 2025-08-25 11:21:08 +07:00
DubbleClick
e975e151f9 swoole hooks can be compiled if pgsql/sqlite are not compiled in statically 2025-08-25 11:09:02 +07:00
Marc
a5351e1546 Merge pull request #863 from crazywhalecc/brotli-watcher
fix gcc version detection
2025-08-25 05:32:46 +02:00
DubbleClick
af90b840ee format string 2025-08-25 09:59:27 +07:00
DubbleClick
2558c02470 oopsie 2025-08-25 09:59:06 +07:00
DubbleClick
df60ccff0e also make sure clang version uses dots 2025-08-25 09:52:03 +07:00
DubbleClick
2ed8bbf391 add cflags and ldflags to frankenphp build 2025-08-25 09:29:19 +07:00
DubbleClick
ef3025798d fix gcc compiler version 2025-08-25 09:29:06 +07:00
Marc
bea3bd8392 Merge pull request #861 from crazywhalecc/fix/macos-ar
Add macOS AR and LD
2025-08-22 07:23:49 +02:00
crazywhalecc
99e8900aba Add macOS AR and LD 2025-08-22 13:19:42 +08:00
Marc
1c4a6ca02e Merge pull request #860 from crazywhalecc/brotli-watcher
add brotli and watcher to lib-suggests
2025-08-21 15:31:35 +02:00
DubbleClick
b5fa7be53f add brotli and watcher to lib-suggests 2025-08-20 13:40:54 +07:00
Marc
3804e842bb Merge pull request #858 from crazywhalecc/fix/imagick
imagick needs static libstdc++ on gcc-toolset (successor of devtoolse) too
2025-08-20 07:56:08 +02:00
DubbleClick
e6832ecf61 add msgpack suggestion 2025-08-19 20:15:41 +07:00
DubbleClick
ed3e29bade devtoolset any version 2025-08-19 20:03:16 +07:00
DubbleClick
811aeb58ea imagick needs static libstdc++ on gcc-toolset (successor of devtoolset) too 2025-08-19 20:01:10 +07:00
Marc
6b5aaa38ae Merge pull request #857 from crazywhalecc/fix/lstdcpp
move -lstdc++ to the end of the libraries
2025-08-19 10:51:28 +02:00
DubbleClick
4e9545262d finish the redis thingy from the year long open PR 2025-08-19 10:42:30 +07:00
DubbleClick
d48c84d81b move -lstdc++ to the end of the libraries 2025-08-19 10:27:52 +07:00
Jerry Ma
cbddb2652d Merge pull request #856 from crazywhalecc/fix/windows-cmd
Fix WindowsCmd execution, use popen instead of proc_open
2025-08-18 12:07:09 +08:00
Jerry Ma
5f629253ac Merge pull request #853 from crazywhalecc/fix/exception-reflection
Enhance exception handling by binding builder and extra info to exception handler
2025-08-16 19:33:13 +08:00
crazywhalecc
8d84a95c01 Fix WindowsCmd execution, use popen instead of proc_open 2025-08-16 17:54:24 +08:00
crazywhalecc
2cabaf6402 8.5 extension test 2025-08-15 13:19:14 +08:00
crazywhalecc
ad25ac49b8 Update to beta1, extension test 2025-08-15 12:28:26 +08:00
crazywhalecc
d0412a88df Use PatchException instead of ExecutionException for patchFile 2025-08-15 12:04:06 +08:00
crazywhalecc
a3ae1eb2f0 Remove redundant builer options 2025-08-15 11:54:34 +08:00
crazywhalecc
2e616af836 PHPStan fix 2025-08-11 13:32:59 +08:00
Jerry Ma
4fd8afcee4 Update src/SPC/exception/ExceptionHandler.php
Co-authored-by: Marc <m@pyc.ac>
2025-08-11 13:30:10 +08:00
Jerry Ma
e96b4f5541 Update src/SPC/exception/ExceptionHandler.php
Co-authored-by: Marc <m@pyc.ac>
2025-08-11 13:30:04 +08:00
Jerry Ma
9978a56b1e Update src/SPC/exception/ExceptionHandler.php
Co-authored-by: Marc <m@pyc.ac>
2025-08-11 13:29:59 +08:00
Jerry Ma
d3a5be13ea Update src/SPC/exception/ExceptionHandler.php
Co-authored-by: Marc <m@pyc.ac>
2025-08-11 13:29:54 +08:00
Jerry Ma
5ba0de12eb Update src/SPC/exception/ExceptionHandler.php
Co-authored-by: Marc <m@pyc.ac>
2025-08-11 13:29:48 +08:00
Jerry Ma
a73c097c94 Update src/SPC/command/BuildPHPCommand.php
Co-authored-by: Marc <m@pyc.ac>
2025-08-11 13:29:42 +08:00
Jerry Ma
d3840b19fa Update src/SPC/builder/BuilderProvider.php
Co-authored-by: Marc <m@pyc.ac>
2025-08-11 13:29:36 +08:00
crazywhalecc
b34b6594de Suggestions 2025-08-11 12:05:41 +08:00
crazywhalecc
2fba61e9bd Enhance exception handling by binding builder and extra info to ExceptionHandler 2025-08-11 10:48:48 +08:00
crazywhalecc
1e9434221b Remove spc.env.log due to potential secret leaks 2025-08-07 16:25:01 +08:00
crazywhalecc
afd6791075 Fix phpunit 2025-08-07 13:09:18 +08:00
crazywhalecc
b3b53b6b4d Use latest version of logger 2025-08-07 13:09:18 +08:00
crazywhalecc
b8b8cf6ea9 Update version to 2.7.2 2025-08-07 13:09:18 +08:00
crazywhalecc
9a340e1ad8 Update docs, GitHub issue templates, workflows 2025-08-07 13:09:18 +08:00
crazywhalecc
29dc5e4ea7 Chore 2025-08-07 13:09:18 +08:00
crazywhalecc
08fa49b791 Remove craft.log 2025-08-07 13:09:18 +08:00
crazywhalecc
333b776e77 Refactor all command class exception handling 2025-08-07 13:09:18 +08:00
crazywhalecc
f68f060be2 Refactor all (except command) modules using new exceptions 2025-08-07 13:09:18 +08:00
crazywhalecc
722bb31815 Introduce AttributeMapper for managing extensions and doctor attributes 2025-08-07 13:09:18 +08:00
crazywhalecc
e28580de00 Refactor shell utilities: reorganize namespaces and introduce Shell base class 2025-08-07 13:09:18 +08:00
crazywhalecc
cc447a089a Refactor all exception classes, remove unclear RuntimeException, InvalidArgumentException 2025-08-07 13:09:18 +08:00
crazywhalecc
0c9a30256e Remove all @throws PHPDoc, it's almost useless for SPC anymore 2025-08-07 13:09:18 +08:00
Jerry Ma
fa10142f13 Merge pull request #847 from crazywhalecc/fix/spc-exe
Fix spc build actions version, add spc validation
2025-08-06 01:03:38 +08:00
Jerry Ma
c342741670 Update version to 2.7.1 2025-08-05 23:13:19 +08:00
Jerry Ma
64d49003e0 Update release-build.yml 2025-08-05 21:26:35 +08:00
crazywhalecc
b0c93c7418 Fix spc build actions version, add spc validation 2025-08-05 18:59:30 +08:00
Jerry Ma
085abd635e Merge pull request #819 from crazywhalecc/php-85
Add PHP 8.5 initial support
2025-08-05 12:01:47 +08:00
DubbleClick
3789c7c335 only enable one of password-argon2 or openssl-argon2 2025-08-04 10:14:48 +07:00
crazywhalecc
4fb4e42896 Revert 2025-08-04 01:10:08 +08:00
crazywhalecc
81e7a0c554 Add without argon2 option 2025-08-03 23:01:24 +08:00
crazywhalecc
4cbe4ea82d Revert corrupted revert 2025-08-03 23:01:09 +08:00
crazywhalecc
ea4905cd0d Add argon2 support for PHP-NTS < 8.5 2025-08-03 22:59:40 +08:00
crazywhalecc
3c09ba59d7 Merge remote-tracking branch 'origin/php-85' into php-85 2025-08-03 22:55:17 +08:00
Jerry Ma
430f436b79 Update src/SPC/builder/macos/MacOSBuilder.php
Co-authored-by: Marc <m@pyc.ac>
2025-08-03 22:48:09 +08:00
Jerry Ma
93001dce88 Update src/SPC/builder/macos/MacOSBuilder.php
Co-authored-by: Marc <m@pyc.ac>
2025-08-03 22:47:02 +08:00
Jerry Ma
2d6d25cadf Update src/SPC/builder/linux/LinuxBuilder.php
Co-authored-by: Marc <m@pyc.ac>
2025-08-03 22:46:47 +08:00
crazywhalecc
b644da8210 Remove redundant patches for openssl 2025-08-03 22:45:24 +08:00
crazywhalecc
f1a9a28ed7 Use backup file function to avoid multiple build conflict 2025-08-03 02:06:08 +08:00
crazywhalecc
643926886c Test original 2025-08-03 02:00:19 +08:00
crazywhalecc
9a5a59d876 Test 2025-08-03 01:49:15 +08:00
crazywhalecc
e7fe91faef Fix patch, use pure socket client directly 2025-08-03 01:23:47 +08:00
crazywhalecc
e6cf05ddff Test 2025-08-03 01:12:28 +08:00
crazywhalecc
c3e9a2816b Test 2025-08-03 00:29:13 +08:00
Marc
0bb8e83d68 Merge pull request #844 from crazywhalecc/swoole-v6
change swoole to version 6.x because 5.x is not compatible with php 8.4+
2025-08-02 23:06:35 +07:00
crazywhalecc
d0053534ab tmate 2025-08-02 23:06:16 +08:00
crazywhalecc
38725c2bb4 Update ca certificates 2025-08-02 22:22:09 +08:00
DubbleClick
b8fe70e5ee change swoole to version 6.x because 5.x is not compatible with php 8.4+ 2025-08-02 20:23:26 +07:00
crazywhalecc
3960a21e05 Use full domain test list 2025-08-02 18:40:55 +08:00
crazywhalecc
e14301d991 Symbol workaround for cross toolchain 2025-08-02 18:07:32 +08:00
Jerry Ma
65f74044d8 Update tests.yml 2025-08-02 03:03:20 +08:00
Jerry Ma
f6eba32be5 Update tests.yml 2025-08-02 02:38:24 +08:00
crazywhalecc
af62e55da8 Add missing space 2025-08-02 01:38:32 +08:00
crazywhalecc
22a8191b97 Fix opcache jit option parsing in builder 2025-08-02 01:29:20 +08:00
Jerry Ma
17ff5f63bf Update tests.yml 2025-08-02 00:58:36 +08:00
crazywhalecc
48a7d814f8 Test jit 2025-08-01 17:00:35 +08:00
crazywhalecc
2c5cf07e9c cs fix, fix file name 2025-08-01 15:45:33 +08:00
crazywhalecc
cace504a63 Workaround for windows openssl temporarily 2025-08-01 15:42:34 +08:00
crazywhalecc
efa47af347 Add git source test 2025-08-01 15:17:13 +08:00
crazywhalecc
1c9fbdb032 Use none base combination 2025-08-01 15:01:55 +08:00
crazywhalecc
ac2eb3adae Remove redis test 2025-08-01 14:21:38 +08:00
crazywhalecc
d6081ee10f Support alpha4 2025-08-01 13:00:12 +08:00
crazywhalecc
8b9b72958e Add PHP_BUILD_COMPILER for different toolchain 2025-08-01 12:48:48 +08:00
crazywhalecc
34edb6e329 Add PHP_BUILD_PROVIDER to env.ini 2025-08-01 10:58:31 +08:00
crazywhalecc
9487051796 Add PHP_BUILD_PROVIDER for PHP >= 8.4 2025-08-01 02:25:12 +08:00
crazywhalecc
7d0577460f cs-fix 2025-08-01 02:05:46 +08:00
crazywhalecc
6b23f4b34a Fix PHPUnit test on Windows, ignore calling linux system util for other OS 2025-08-01 01:53:38 +08:00
crazywhalecc
451de4a6f6 Fix ConfigValidator and sort config 2025-08-01 01:50:32 +08:00
crazywhalecc
33d587ee9e Remove redis test (https://github.com/phpredis/phpredis/pull/2676) 2025-08-01 01:32:37 +08:00
crazywhalecc
6b381238fe Remove collision, it's useless at all 2025-08-01 01:29:35 +08:00
crazywhalecc
07d66ade85 Add separated patchedBeforeWindowsConfigure 2025-08-01 01:28:56 +08:00
crazywhalecc
e1c9240698 README update 2025-08-01 00:51:04 +08:00
crazywhalecc
d3e8af23bc Whoops 2025-08-01 00:50:51 +08:00
crazywhalecc
5f9fe2948c Fix missing SPC_EXTRA_LIBS with type error bug 2025-08-01 00:09:05 +08:00
crazywhalecc
4c54d99621 Remove pcntl 2025-07-31 23:49:53 +08:00
crazywhalecc
72beba76c3 Merge remote-tracking branch 'origin/php-85' into php-85 2025-07-31 23:46:43 +08:00
crazywhalecc
1047d471ed Merge branch 'main' into php-85
# Conflicts:
#	src/SPC/builder/linux/LinuxBuilder.php
#	src/SPC/store/source/PhpSource.php
#	src/globals/test-extensions.php
2025-07-31 23:46:34 +08:00
crazywhalecc
0496af47df Fix windows PHP 8.5 build 2025-07-31 23:43:44 +08:00
Jerry Ma
0ae4bcbd6f Merge pull request #806 from crazywhalecc/zig
Add zig toolchain support & shared build improvement
2025-07-31 22:44:48 +08:00
DubbleClick
c58bc038f4 version 2.7.0 2025-07-31 21:11:42 +07:00
DubbleClick
ecaa31f38d no start group for macos 2025-07-31 21:11:15 +07:00
crazywhalecc
96a7aabda0 Don't show shell log 2025-07-31 21:31:48 +08:00
crazywhalecc
be857913cd Add alt for re2c 2025-07-31 01:54:28 +08:00
crazywhalecc
601444d0a5 Add re2c build for spc-gnu-docker 2025-07-31 01:44:44 +08:00
crazywhalecc
3c972ac905 Add re2c build 2025-07-31 00:55:25 +08:00
crazywhalecc
6984c29a3a suggestion 2025-07-31 00:11:49 +08:00
crazywhalecc
cb0ea67a28 Fix x86_64 macOS bison finder path 2025-07-31 00:09:13 +08:00
crazywhalecc
fcdb029b10 Install re2c manually in gnu docker 2025-07-31 00:07:23 +08:00
crazywhalecc
5f33a07f4c Fix windows builds when unix configure does not exist 2025-07-30 23:57:52 +08:00
crazywhalecc
357c04def0 Merge branch 'main' into php-85
# Conflicts:
#	src/SPC/util/PkgConfigUtil.php
2025-07-30 23:25:49 +08:00
crazywhalecc
0dfa6e63bd Fix dev:lib-version command with dependencies 2025-07-30 23:23:27 +08:00
crazywhalecc
af10cacdff Add openssl version getter for Windows, test openssl 2025-07-30 23:23:12 +08:00
crazywhalecc
5f5d934d58 Add openssl argon2 password hash support for PHP 8.5 2025-07-30 23:02:28 +08:00
DubbleClick
fda637bb03 suggestions 2025-07-30 10:24:21 +07:00
DubbleClick
76d17ebef0 -static was too much 2025-07-29 13:34:01 +07:00
crazywhalecc
df76ecb60f Fix PHPUnit test, remove unneeded test (function is dynamic) 2025-07-29 12:14:31 +08:00
DubbleClick
83dae09208 cs fix 2025-07-29 10:49:08 +07:00
DubbleClick
430364aacd quicker tests 2025-07-29 10:40:46 +07:00
DubbleClick
81f359dbcf fix tests 2025-07-29 10:39:21 +07:00
crazywhalecc
9ed3c8b498 phpstan 2025-07-29 11:25:06 +08:00
DubbleClick
72abd63b69 cs fix 2025-07-29 10:24:05 +07:00
crazywhalecc
ed67393d33 Move opcache JIT handling from Linux and MacOS builders to Extension 2025-07-29 11:22:58 +08:00
DubbleClick
e8bc892d8b Merge branch 'main' of https://github.com/crazywhalecc/static-php-cli into zig 2025-07-29 10:20:30 +07:00
Jerry Ma
fafe7d5778 Merge pull request #835 from crazywhalecc/chore/test-and-validate
Chore: PHPUnit test & docs & PHPDoc for vendor mode
2025-07-29 11:08:53 +08:00
DubbleClick
a968b19be0 remove zig stuff from tests for now, since we need to keep gcc default 2025-07-29 10:02:21 +07:00
crazywhalecc
e9dbeb1e34 Refactor opcache JIT handling and version checks in Linux and MacOS builders 2025-07-29 10:59:36 +08:00
DubbleClick
feaff0a08c fix macos 2025-07-29 09:20:33 +07:00
DubbleClick
342192fd67 remove lto related stuff again, not worth using 2025-07-28 19:43:01 +07:00
crazywhalecc
4efb3dfc9a Add check for Bison version in MacOS tool checklist, trigger extension test 2025-07-28 16:47:04 +08:00
crazywhalecc
b9bec5b526 Whoops, extension test 2025-07-28 16:00:32 +08:00
crazywhalecc
1ae0752933 Trigger full extension test 2025-07-28 15:58:07 +08:00
crazywhalecc
0696acb9c5 Add support for re2c in tool checklists and environment setup 2025-07-28 15:54:55 +08:00
DubbleClick
3087dc86f8 https://www.phoronix.com/news/GNU-Binutils-2.44 ld.gold is deprecated
don't deprecate libc usage yet, we don't want people to switch to gcc/clang yet
2025-07-28 14:51:13 +07:00
crazywhalecc
973c8f082f Add php-src git version support 2025-07-28 15:36:53 +08:00
crazywhalecc
85e89e4326 alpha2 2025-07-28 10:17:14 +08:00
crazywhalecc
fb106a3d41 Merge branch 'refs/heads/main' into php-85
# Conflicts:
#	src/globals/test-extensions.php
2025-07-28 10:12:13 +08:00
DubbleClick
fb2d676293 zig doesn't support windows (php doesn't support mingw, zig can only compile mingw) 2025-07-27 01:22:11 +07:00
DubbleClick
944cca709f use $AR in second part of command too 2025-07-27 01:10:21 +07:00
DubbleClick
5b4cbbb669 set permissions 2025-07-27 01:08:34 +07:00
DubbleClick
a8492f06bb use zig's linker too (ends up getting used automatically in most cases, anyway, but better be explicit) 2025-07-27 01:07:54 +07:00
DubbleClick
b6f673cd68 Use $AR instead of ar. Compatibility with -flto(=thin). 2025-07-27 00:59:32 +07:00
DubbleClick
42b4272965 idk 2025-07-26 23:46:36 +07:00
DubbleClick
5beb083c55 no musl check? 2025-07-26 23:39:32 +07:00
DubbleClick
cf529adc79 uh, oh, we forgot to do post init 2025-07-26 23:35:38 +07:00
DubbleClick
5a4da8ed5d install zig before doctor 2025-07-26 23:28:17 +07:00
DubbleClick
bd3092ae90 wtf? 2025-07-26 23:24:59 +07:00
DubbleClick
76094fd305 hello? 2025-07-26 23:20:27 +07:00
DubbleClick
e1edaa24cc "zig-cc" cannot create shared objects according to conftests... 2025-07-26 23:14:29 +07:00
DubbleClick
d0d51ccf82 trigger CI again after clearing cache 2025-07-26 22:23:00 +07:00
DubbleClick
05053b5cd6 cs fix 2025-07-26 21:45:48 +07:00
DubbleClick
978552136c try to make everything -flto=thin compatible (librdkafka fails for some reason) 2025-07-26 21:44:01 +07:00
DubbleClick
fb62a0e338 small adjustments 2025-07-26 20:12:18 +07:00
DubbleClick
630f861c62 move musl check so it doesn't keep prompting for install 2025-07-26 15:18:20 +07:00
DubbleClick
c2b3b78846 switch to libmimalloc.a because go linker is sometimes doing unpredictable things 2025-07-26 13:51:34 +07:00
DubbleClick
6e74dabc1c reduce libphp.a size by stripping .a archives inside it as well 2025-07-26 13:48:22 +07:00
DubbleClick
2cb1a95132 change dependency tracking 2025-07-26 11:13:29 +07:00
DubbleClick
70a9ffe4a2 now test gnu again 2025-07-25 20:00:46 +07:00
DubbleClick
3cbd52c1f9 test with zig-cc instead 2025-07-25 18:44:30 +07:00
DubbleClick
753c720716 remove test, seems like removing musl from paths was successful 2025-07-25 17:56:42 +07:00
DubbleClick
d627363132 please please...? 2025-07-25 17:52:33 +07:00
DubbleClick
da8c38575e please...? 2025-07-25 17:16:35 +07:00
DubbleClick
a355e4d0e7 run macos tests again 2025-07-25 16:55:51 +07:00
DubbleClick
5482f130ba make sure we don't use musl ld 2025-07-25 16:55:16 +07:00
DubbleClick
18a5215da9 cs fix 2025-07-25 16:26:34 +07:00
DubbleClick
a3efe86cac logging 2025-07-25 16:26:07 +07:00
DubbleClick
ed3a78b56d revert macos mistake 2025-07-25 16:26:02 +07:00
DubbleClick
af63723794 revert DYLD_LIBRARY_PATH 2025-07-25 16:24:22 +07:00
DubbleClick
a0edca5e5b docs for function 2025-07-25 16:22:42 +07:00
DubbleClick
a9fab86269 rename getStaticAndSharedLibs 2025-07-25 16:18:04 +07:00
DubbleClick
821411cfd6 only -lstdc++ on linux 2025-07-25 16:17:13 +07:00
DubbleClick
a8be88d771 fix swow 2025-07-25 16:13:48 +07:00
DubbleClick
b4392aded7 always install musl libc (to be able to compile dynamic with zig) 2025-07-25 16:11:11 +07:00
DubbleClick
37a453b3cd of course x) 2025-07-25 12:57:40 +07:00
DubbleClick
51fcc6b231 test musl again (succeeds locally :) 2025-07-25 12:32:49 +07:00
DubbleClick
199b3b5582 Merge branch 'main' of https://github.com/crazywhalecc/static-php-cli into zig 2025-07-25 12:03:37 +07:00
crazywhalecc
6c3ff7da32 Change LDFLAGS_PROGRAM to hard-coded 2025-07-25 12:58:19 +08:00
crazywhalecc
a375ab9780 Fix custom pkg download callable not working bug 2025-07-25 12:58:19 +08:00
crazywhalecc
f47c3a2d20 Fix macOS missing lib when linking 2025-07-25 12:58:19 +08:00
DubbleClick
029f2db620 oh dear god what am I doing 2025-07-25 11:12:49 +07:00
DubbleClick
0acf238c74 suggested are required too 2025-07-25 11:02:47 +07:00
DubbleClick
27a4d5af54 better description of function 2025-07-25 10:04:06 +07:00
DubbleClick
ea56e460d0 zig script 2025-07-25 10:00:49 +07:00
DubbleClick
00e78dd84f fix imagick problem, for some reason it must be in the --start-group --end-group 2025-07-25 09:59:24 +07:00
DubbleClick
7eb5fb4520 l:libstdc++.a 2025-07-25 09:30:15 +07:00
Marc
8ff52e2e36 -lphp shared not static 2025-07-24 23:47:01 +07:00
DubbleClick
8c5dc91895 test gnu (test musl again later, jxl fails with avx shit again) 2025-07-24 22:53:19 +07:00
DubbleClick
155e22a9f9 with_dependencies was removed 2025-07-24 22:01:32 +07:00
DubbleClick
7177afd7f8 phpstan fix 2025-07-24 21:57:56 +07:00
DubbleClick
eca7a43a01 get rid of extra logic for shared and static libraries, rely on SPCConfigUtil 2025-07-24 21:42:31 +07:00
DubbleClick
dd99f258c1 do not pull it symbols from libpq during conftests... 2025-07-24 21:32:14 +07:00
DubbleClick
5c9a3e236b array_reverse again 2025-07-24 21:29:34 +07:00
DubbleClick
7b07137b5b typo 2025-07-24 18:43:10 +07:00
DubbleClick
eb898a8867 add ulimit -n for zigtoolchain 2025-07-24 17:14:20 +07:00
DubbleClick
c86360c9c4 typo 2025-07-24 16:43:36 +07:00
DubbleClick
1d6b2bd002 cs fix 2025-07-24 15:51:50 +07:00
DubbleClick
41bb3e7319 move -Wno-date-time to ZigToolchain instead of env.ini 2025-07-24 15:51:08 +07:00
Jerry Ma
f500945298 Merge pull request #833 from crazywhalecc/feat/install-pkg-options
Add --no-alt and --skip-extract option to install-pkg command
2025-07-24 16:35:15 +08:00
DubbleClick
6da3f78df6 force disable AVX512 for zig 2025-07-24 15:12:11 +07:00
DubbleClick
407f6d4671 remove zig specifics 2025-07-24 15:03:33 +07:00
DubbleClick
6c76187f5d remove old code 2025-07-24 14:59:47 +07:00
DubbleClick
8c8800f156 work around it for -target without version... 2025-07-24 14:32:47 +07:00
DubbleClick
b3f1103143 well shit, zig cannot build libjxl 2025-07-24 14:28:34 +07:00
DubbleClick
84e470d213 Merge branch 'main' of https://github.com/crazywhalecc/static-php-cli into zig 2025-07-24 11:02:11 +07:00
crazywhalecc
52a623f31e Suggestions 2025-07-24 12:00:17 +08:00
crazywhalecc
abd7d3cfb4 Add --no-alt and --skip-extract option to install-pkg command 2025-07-24 00:42:30 +08:00
Jerry Ma
f543b55f19 Merge pull request #826 from crazywhalecc/grpc
fix grpc support (use cmake, openssl)
2025-07-23 22:03:55 +08:00
crazywhalecc
f2a3ae409f Use latest minimal micro.sfx for self-packing 2025-07-23 21:37:38 +08:00
DubbleClick
4e4cf4bbc7 fix weird macos thing?! 2025-07-23 17:33:49 +07:00
DubbleClick
d532b57810 use mbstring extension everywhere 2025-07-23 17:21:32 +07:00
DubbleClick
aa337c0c84 space ._. 2025-07-23 16:51:35 +07:00
DubbleClick
cc1f899948 re2.pc didn't have prefix listed 2025-07-23 16:50:26 +07:00
DubbleClick
848c30547c Merge branch 'main' of https://github.com/crazywhalecc/static-php-cli into grpc 2025-07-23 16:25:12 +07:00
Marc
c8cc0131da Merge pull request #831 from crazywhalecc/fix/varname-placeholder
Change variable name for placeholder
2025-07-23 16:24:56 +07:00
crazywhalecc
b0c0ecb59c Rename to suggestions 2025-07-23 15:33:26 +08:00
crazywhalecc
45f257ef14 Change variable name for placeholder 2025-07-23 15:13:38 +08:00
DubbleClick
fa38fa1410 easier debugging for breakpoints 2025-07-23 14:13:22 +07:00
DubbleClick
ee492dcde1 patch pc files 2025-07-23 14:10:28 +07:00
DubbleClick
22bec873a8 more merge stuff 2025-07-23 13:55:09 +07:00
DubbleClick
958fd0cdcb Merge branch 'main' of https://github.com/crazywhalecc/static-php-cli into grpc 2025-07-23 13:51:33 +07:00
Marc
0d0c789d8b Merge pull request #828 from crazywhalecc/feat/pkg-config-integration
Add real pkg-config integration
2025-07-23 13:49:36 +07:00
crazywhalecc
3d19299d30 Patch both 2025-07-23 14:35:34 +08:00
DubbleClick
4c56c96326 lib-suggests: ldap was missing for curl 2025-07-23 13:16:23 +07:00
crazywhalecc
42e2f6a89d Update composer deps, trigger extension test 2025-07-23 12:49:13 +08:00
Jerry Ma
c715f20fe3 Merge pull request #830 from crazywhalecc/fix/pack-location-independent
Patch pkg-config and la files with placeholder when packing pre-built content
2025-07-23 12:38:29 +08:00
crazywhalecc
e02ce4c151 Fix gnu docker openssl build 2025-07-23 12:15:18 +08:00
crazywhalecc
9f7a7a5703 Add packing placeholder 2025-07-23 11:52:25 +08:00
crazywhalecc
147fd396cf Fix openssl pc file 2025-07-23 11:52:05 +08:00
crazywhalecc
293a95da6d Use absolute path for pc files 2025-07-23 11:51:28 +08:00
DubbleClick
952ecb2eec test all affected operating systems! 2025-07-23 10:50:29 +07:00
DubbleClick
31e7cd31c1 make sure that mimalloc.o is *always* first, no matter if $_ENV['LIBS'] is set 2025-07-23 10:49:23 +07:00
DubbleClick
51ec8199e4 bring back static lib logic 2025-07-23 10:46:30 +07:00
DubbleClick
f75c58b7d2 revert to double array_reverse, because static libs with dependencies are backwards 2025-07-23 10:21:36 +07:00
DubbleClick
f8970a21be fix cs 2025-07-23 09:53:31 +07:00
DubbleClick
b6be20727d fix a few accidental array_reverse calls, pkg-config --static instead of pkg-config --libs 2025-07-23 09:47:35 +07:00
crazywhalecc
9c4a6b46b6 Fix pkg-config missing option 2025-07-23 09:57:09 +08:00
crazywhalecc
779c7cec30 test pgsql 2025-07-23 01:32:42 +08:00
crazywhalecc
154a21fbaf phpstan, extension test 2025-07-23 00:48:37 +08:00
crazywhalecc
a2e0efaed3 extension test 2025-07-23 00:45:06 +08:00
crazywhalecc
0d408e0df1 Allow empty target 2025-07-23 00:38:36 +08:00
crazywhalecc
b5ceda5955 Fix libxslt build again 2025-07-23 00:38:25 +08:00
crazywhalecc
ffa5219d23 trigger extension test 2025-07-22 23:18:19 +08:00
crazywhalecc
099425abc8 Fix c++, check pkg-config exists before calling PkgConfigUtil 2025-07-22 22:46:13 +08:00
crazywhalecc
dea3c4afeb Looks like ngtcp2 does not happy with pkg-config 2025-07-22 22:25:46 +08:00
crazywhalecc
4cdafe2497 Fix unique and reverse order 2025-07-22 22:25:21 +08:00
crazywhalecc
a88f9933d2 Fix unique and reverse order 2025-07-22 22:25:16 +08:00
crazywhalecc
a095d489f3 Fix libwebp static libs order 2025-07-22 22:09:45 +08:00
crazywhalecc
2c81ca2bf8 Replace example.com 2025-07-22 22:00:39 +08:00
crazywhalecc
f2ccabf062 Fix library base, fix brotli and curl libs, trigger extension test 2025-07-22 21:54:27 +08:00
crazywhalecc
6dd4406782 Disable extension test's UPX 2025-07-22 21:19:11 +08:00
crazywhalecc
062cc84d51 Fix phpunit 2025-07-22 21:15:22 +08:00
crazywhalecc
dfbc9a7fff Trigger common extension test 2025-07-22 21:14:25 +08:00
crazywhalecc
1888b735d1 Fix all extension builds 2025-07-22 21:13:35 +08:00
Marc
a44dc0a5f6 cd later 2025-07-22 19:45:58 +07:00
crazywhalecc
6634ade6b4 Fix library build failure not interrupt bug 2025-07-22 20:41:35 +08:00
DubbleClick
6962d24b52 unify CMakeExecutor and AutoConfExecutor 2025-07-22 19:12:17 +07:00
DubbleClick
eb56690684 use escapeshellarg 2025-07-22 19:03:16 +07:00
DubbleClick
4b7020fbbb also escape if it contains a space 2025-07-22 19:01:46 +07:00
DubbleClick
f9a8231820 simpler check 2025-07-22 19:01:07 +07:00
crazywhalecc
7e977414a7 Use spc-config instead of SPC_EXTRA_LIBS, trigger extension test 2025-07-22 19:59:44 +08:00
DubbleClick
c96d503dae fix cs 2025-07-22 18:45:28 +07:00
DubbleClick
8c603d59c6 simplify path 2025-07-22 18:42:34 +07:00
DubbleClick
bdb705e89a only escape path if required 2025-07-22 18:38:17 +07:00
DubbleClick
9172c39a26 change --with-prefix to --with-path, add --enable-path (yes, grpc uses that...) 2025-07-22 18:29:58 +07:00
DubbleClick
3ca7c15208 simplify back to --enable, it actually supports paths :O 2025-07-22 18:21:33 +07:00
DubbleClick
cfda1e93a0 add macos ldflags 2025-07-22 17:17:11 +07:00
DubbleClick
8f8a493b20 trigger deprecation again 2025-07-22 17:04:56 +07:00
DubbleClick
5aa9255909 cs fix 2025-07-22 16:27:05 +07:00
DubbleClick
107fb08e34 simplify patch logic for grpc (--enable-grpc=PATH does not actually pass a path, needs to be --with-grpc=PATH) 2025-07-22 16:26:37 +07:00
crazywhalecc
95a94da66f Add --no-php option to spc-config 2025-07-22 17:26:34 +08:00
crazywhalecc
c8eb62e8f0 Add real pkg-config integration 2025-07-22 17:23:13 +08:00
DubbleClick
4010a84d88 set up tmate 2025-07-22 15:00:22 +07:00
crazywhalecc
c0db3a69d7 Update composer deps 2025-07-22 14:46:51 +08:00
crazywhalecc
5dbf401615 Fix macOS libphp.dylib compatibility 2025-07-22 14:46:41 +08:00
crazywhalecc
c5811ae947 Reduce grpc building things 2025-07-22 14:46:28 +08:00
crazywhalecc
e1595e1091 Remove old workaround code 2025-07-22 14:46:01 +08:00
DubbleClick
aa366d4213 remove linux target os 2025-07-22 13:06:48 +07:00
crazywhalecc
20ab4afb4b Merge branch 'main' into grpc
# Conflicts:
#	src/globals/test-extensions.php
2025-07-22 13:57:31 +08:00
DubbleClick
1300919c44 cs fix 2025-07-22 12:50:04 +07:00
DubbleClick
81b96c2b30 Merge remote-tracking branch 'origin/main' into zig 2025-07-22 12:49:42 +07:00
Marc
a98f72cc32 Merge pull request #824 from crazywhalecc/tiff
add Lerc, JBIG and JXL libraries for use in imagick
2025-07-22 12:46:45 +07:00
DubbleClick
9ba9b87405 makes more sense 2025-07-22 12:44:51 +07:00
DubbleClick
1e42ef042b Merge remote-tracking branch 'origin/zig' into zig 2025-07-22 12:42:54 +07:00
DubbleClick
206bc95ee2 use correct musl lib 2025-07-22 12:42:45 +07:00
crazywhalecc
b746e50233 Make IANA happier than apple 2025-07-22 13:21:18 +08:00
crazywhalecc
a8dcfce99e chore 2025-07-22 13:16:34 +08:00
crazywhalecc
f69f8d1e4a Move zig-toolchain-only things to zig toolchain class 2025-07-22 13:16:26 +08:00
DubbleClick
9c9ffb615f cs fix 2025-07-22 12:07:03 +07:00
DubbleClick
62a58d410f describe centos 7 behaviour better 2025-07-22 11:49:13 +07:00
DubbleClick
9e7e2e30a4 goddamn centos 7 2025-07-22 11:48:12 +07:00
crazywhalecc
3350888af6 Merge remote-tracking branch 'origin/zig' into zig 2025-07-22 12:46:54 +08:00
DubbleClick
22552262b3 add different build dir in again 2025-07-22 11:43:19 +07:00
DubbleClick
a0f474db20 redundant 2025-07-22 11:39:07 +07:00
DubbleClick
d5cd42b0e7 delete cs fixer wrapper 2025-07-22 11:38:42 +07:00
DubbleClick
307d3dda20 join array to string 2025-07-22 11:30:00 +07:00
crazywhalecc
86e3e51b5a Drop legacy phpmicro support 2025-07-22 12:29:41 +08:00
crazywhalecc
4fc081fcc6 Correct chdir to original dir 2025-07-22 12:25:43 +08:00
crazywhalecc
ff30e0f99a Use https instead of http for gnu docker 2025-07-22 12:24:48 +08:00
DubbleClick
6594f6b653 fix remaining errors 2025-07-22 11:23:42 +07:00
DubbleClick
0942637d12 Merge remote-tracking branch 'origin/grpc' into grpc
# Conflicts:
#	src/SPC/builder/extension/grpc.php
#	src/SPC/builder/unix/library/grpc.php
2025-07-22 10:55:48 +07:00
DubbleClick
bb96db4395 rework static lib detection 2025-07-22 10:54:44 +07:00
DubbleClick
f31f0d6168 should be fixed properly 2025-07-22 10:48:14 +07:00
DubbleClick
1f4a3e4b8f oh, it will likely be this instead 2025-07-22 10:48:14 +07:00
DubbleClick
b30f2bc193 for some reason alpine docker fails in CI, but not locally, after I added this? 2025-07-22 10:48:14 +07:00
DubbleClick
b43d0746f4 cs fix 2025-07-22 10:48:14 +07:00
DubbleClick
227210209c -static-libstdc++ and -static-libgcc for static builds (musl toolchain) 2025-07-22 10:48:14 +07:00
DubbleClick
3dd3cf2814 use pkgconfig to determine libs fix cs 2025-07-22 10:48:14 +07:00
DubbleClick
e98e221d93 use pkgconfig to determine libs 2025-07-22 10:48:14 +07:00
DubbleClick
81a59be0c4 use =package 2025-07-22 10:48:14 +07:00
DubbleClick
8eb7723114 enable tests 2025-07-22 10:48:13 +07:00
DubbleClick
45d96734dd grpc can be built shared too 2025-07-22 10:48:13 +07:00
DubbleClick
915ffd84c8 remove grpc_php_ext_src 2025-07-22 10:48:13 +07:00
DubbleClick
161a92aff7 needed --libs --static 2025-07-22 10:48:13 +07:00
DubbleClick
9b207807eb doesn't even work yet, there has to be a better way than to add 2913912309 libraries 2025-07-22 10:48:13 +07:00
DubbleClick
0bdafed92f fix cs 2025-07-22 10:47:35 +07:00
DubbleClick
2ebd230a08 use git instead of patching deps.sh 2025-07-22 10:43:51 +07:00
DubbleClick
6d60000952 Merge branch 'tiff' of https://github.com/crazywhalecc/static-php-cli into tiff 2025-07-22 10:26:25 +07:00
DubbleClick
1b6422eed3 suggestion 2 2025-07-22 10:22:53 +07:00
DubbleClick
a643c44ac6 suggestion 1 2025-07-22 10:22:53 +07:00
DubbleClick
02732036de test shared imagick.so build 2025-07-22 10:22:53 +07:00
DubbleClick
c0483b4b34 don't download libpng, zlib, brotli, as we already build them 2025-07-22 10:22:53 +07:00
DubbleClick
eff6c0666b disable jni instead of sjpeg 2025-07-22 10:22:53 +07:00
DubbleClick
ed97669d9e force usage of already built brotli lib 2025-07-22 10:22:52 +07:00
DubbleClick
ddb14e2db7 install libatomic-devel for devtoolset-10 2025-07-22 10:22:52 +07:00
DubbleClick
c452252a7d add jxl to test 2025-07-22 10:22:52 +07:00
DubbleClick
6fcd301cf5 fix 2025-07-22 10:22:52 +07:00
DubbleClick
52862a3d63 fix libtiff libs being defined after configure 2025-07-22 10:22:52 +07:00
DubbleClick
ff092b4e9d add libjxl #755 2025-07-22 10:22:52 +07:00
DubbleClick
0d6453751d fixes 2025-07-22 10:22:52 +07:00
Marc
082b9a907b Update src/SPC/builder/unix/library/jbig.php
Co-authored-by: Jerry Ma <jesse2061@outlook.com>
2025-07-22 10:22:52 +07:00
DubbleClick
5675a1e2ad Revert "only uncomment that line temporarily"
This reverts commit d07fadde76.
2025-07-22 10:22:52 +07:00
DubbleClick
8601c26f2d only uncomment that line temporarily 2025-07-22 10:22:52 +07:00
DubbleClick
ece7a04437 oops 2025-07-22 10:22:52 +07:00
DubbleClick
9d2d3d2d0a test
# Conflicts:
#	src/globals/test-extensions.php
2025-07-22 10:22:48 +07:00
DubbleClick
cec445eab5 sort 2025-07-22 10:21:09 +07:00
DubbleClick
8116e8898e fix lerc build (needs -lstdc++) 2025-07-22 10:21:09 +07:00
DubbleClick
be0dbcd9eb add jbig 2025-07-22 10:21:09 +07:00
DubbleClick
5c44703f53 add lerc 2025-07-22 10:21:09 +07:00
Marc
c364970e05 Merge pull request #827 from crazywhalecc/feat/git-submodules
Allow specifying submodules for git source
2025-07-22 10:19:30 +07:00
Jerry Ma
b2385cf80c Update src/SPC/store/Downloader.php
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-07-21 23:33:20 +08:00
Jerry Ma
2b1d03d9d4 Update src/SPC/store/Downloader.php
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-07-21 23:29:38 +08:00
crazywhalecc
5b6f33a2a1 Allow specifying submodules for git source 2025-07-21 23:21:00 +08:00
Marc
352955d608 absolute dir? 2025-07-21 21:36:33 +07:00
Marc
e07b281577 fix build dir conflict 2025-07-21 21:25:33 +07:00
Marc
71f4e45256 remove workaround 2025-07-21 21:22:41 +07:00
Marc
828f51500d disable ubuntu latest (jit error until php-src fixes it) 2025-07-21 21:01:39 +07:00
DubbleClick
4a0a7e0df3 suggestion 2 2025-07-21 19:34:31 +07:00
DubbleClick
3c8b588312 suggestion 1 2025-07-21 19:32:44 +07:00
DubbleClick
711d61d120 testing frankenphp with php 8.1 makes no sense 2025-07-21 19:00:53 +07:00
Marc
bce363e543 make sure we didn't break any other OS 2025-07-21 18:32:57 +07:00
DubbleClick
d66d7b3a73 should be fixed properly 2025-07-21 16:56:39 +07:00
DubbleClick
024542d361 oh, it will likely be this instead 2025-07-21 16:03:28 +07:00
DubbleClick
7d85aacace for some reason alpine docker fails in CI, but not locally, after I added this? 2025-07-21 16:00:28 +07:00
DubbleClick
31b2e6779d cs fix 2025-07-21 14:29:27 +07:00
DubbleClick
2b39a6d535 -static-libstdc++ and -static-libgcc for static builds (musl toolchain) 2025-07-21 14:29:01 +07:00
DubbleClick
e490a1763a use pkgconfig to determine libs fix cs 2025-07-21 12:12:18 +07:00
DubbleClick
bf4b35aa0a use pkgconfig to determine libs 2025-07-21 12:10:14 +07:00
DubbleClick
1f7d3ec91d use =package 2025-07-21 10:55:21 +07:00
DubbleClick
23412d6bfa enable tests 2025-07-21 09:46:06 +07:00
DubbleClick
bd0042f079 grpc can be built shared too 2025-07-21 09:43:01 +07:00
DubbleClick
0ccf1a1c5d remove grpc_php_ext_src 2025-07-21 09:41:36 +07:00
DubbleClick
76d7002646 needed --libs --static 2025-07-21 09:33:29 +07:00
DubbleClick
38cc4cfe7e doesn't even work yet, there has to be a better way than to add 2913912309 libraries 2025-07-21 00:32:43 +07:00
DubbleClick
d91b476f33 test shared imagick.so build 2025-07-20 10:37:37 +07:00
DubbleClick
f7080c61d5 don't download libpng, zlib, brotli, as we already build them 2025-07-20 02:49:30 +07:00
DubbleClick
26842fba27 disable jni instead of sjpeg 2025-07-20 02:17:00 +07:00
DubbleClick
dce1065af5 force usage of already built brotli lib 2025-07-20 02:06:43 +07:00
DubbleClick
f0af17abe4 install libatomic-devel for devtoolset-10 2025-07-20 01:44:09 +07:00
DubbleClick
fbd56da7ad add jxl to test 2025-07-20 01:21:33 +07:00
DubbleClick
0ef8b8c175 fix 2025-07-20 01:17:58 +07:00
DubbleClick
230879a0db fix libtiff libs being defined after configure 2025-07-20 01:13:51 +07:00
DubbleClick
2ef64e4597 add libjxl #755 2025-07-20 00:11:29 +07:00
DubbleClick
6c18862fd1 fixes 2025-07-19 23:54:38 +07:00
Marc
6c109c52f6 Update src/SPC/builder/unix/library/jbig.php
Co-authored-by: Jerry Ma <jesse2061@outlook.com>
2025-07-19 17:56:54 +07:00
Jerry Ma
f3400b8756 Merge pull request #822 from yoramdelangen/fix/workflow-reuse-upload-license-conflicts
fix: conflict upload names when reusing workflow more then once
2025-07-19 18:37:08 +08:00
DubbleClick
b79b1f5750 cs fix 2025-07-19 15:23:18 +07:00
DubbleClick
9b72f57463 use www.example.com 2025-07-19 15:22:23 +07:00
DubbleClick
6f9a45b54a shared extensions may also need to patch 2025-07-19 15:17:44 +07:00
DubbleClick
683461d918 actually path php makefile 2025-07-19 15:12:15 +07:00
DubbleClick
ada203c00c str_starts_with 2025-07-19 15:11:22 +07:00
DubbleClick
01887d652c add extra runtime objects for shared libraries built directly by php make too 2025-07-19 15:10:42 +07:00
DubbleClick
fff23649cf only comment out that line temporarily 2025-07-18 20:45:46 +07:00
DubbleClick
c7762a5b65 Revert "only uncomment that line temporarily"
This reverts commit d07fadde76.
2025-07-18 20:44:04 +07:00
DubbleClick
d07fadde76 only uncomment that line temporarily 2025-07-18 20:30:51 +07:00
DubbleClick
ac7a09edd1 oops 2025-07-18 14:52:39 +07:00
Marc
f30f095f00 Merge branch 'main' into tiff 2025-07-18 14:47:59 +07:00
DubbleClick
d91a66ee8d test 2025-07-18 14:47:05 +07:00
DubbleClick
7db7ed97ee sort 2025-07-18 14:41:10 +07:00
DubbleClick
6b9d49eb71 fix lerc build (needs -lstdc++) 2025-07-18 14:39:17 +07:00
DubbleClick
7c9e8e3e40 add jbig 2025-07-18 14:04:55 +07:00
DubbleClick
5586f627d3 add lerc 2025-07-18 13:51:33 +07:00
Marc
04f3f0872d Merge branch 'main' into zig 2025-07-18 12:47:58 +07:00
Marc
e4921087d9 Merge pull request #823 from crazywhalecc/fix/curl-patch
Fix curl build for non-windows
2025-07-18 12:37:38 +07:00
crazywhalecc
005b78413c Fix curl build for non-windows 2025-07-18 13:23:46 +08:00
DubbleClick
c752f4d4b5 tidy too 2025-07-18 11:56:29 +07:00
DubbleClick
991e2dee5a stable 2025-07-18 11:53:57 +07:00
DubbleClick
33d974bb3d use stable sources for swoole and swow 2025-07-18 11:53:36 +07:00
Yoram
0a1677af95 add build-meta to use php-version and os for artifacts upload name 2025-07-17 10:19:54 +02:00
Yoram
7ffbb10587 fix: conflict upload names when reusing workflow more then once 2025-07-17 09:48:22 +02:00
Jerry Ma
3d45890a2d Merge pull request #821 from crazywhalecc/fix/windows-curl-sspi
Fix/windows curl sspi
2025-07-17 13:58:31 +08:00
Jerry Ma
bb5eb64b28 Merge pull request #802 from crazywhalecc/feat/safe-pack
Check lib-suggest before packing libs
2025-07-17 13:34:15 +08:00
crazywhalecc
e6a050de82 Use SPC_EXTRA_LIBS instead of SPC_WINDOWS_EXEC_LIBS 2025-07-17 13:14:18 +08:00
crazywhalecc
7e7eb844a7 cs-fix 2025-07-17 12:26:30 +08:00
crazywhalecc
e56c628bec Add windows tests 2025-07-17 12:23:03 +08:00
crazywhalecc
c604f88685 Disallow alt for php-src 2025-07-17 12:21:50 +08:00
crazywhalecc
83db186972 Fix curl static build for Windows 2025-07-17 12:21:13 +08:00
DubbleClick
e675af9a18 use zts of course... 2025-07-16 18:58:08 +07:00
Marc
ca8cd7ff3d Merge branch 'main' into zig 2025-07-16 18:43:48 +07:00
DubbleClick
b05002ee9b manual compilation doesn't respect CFLAGS, so pass them directly 2025-07-16 17:50:39 +07:00
DubbleClick
b3c665907b always dump error when extension sanity test fails 2025-07-16 12:34:30 +07:00
DubbleClick
64776e3868 don't do host shenanigans with libffi 2025-07-16 12:28:22 +07:00
DubbleClick
df4d66ad4b disable jbig for imagemagick 2025-07-15 23:29:33 +07:00
crazywhalecc
f0612591be Test bulk (without amqp, swoole) and spc-max 2025-07-15 23:31:26 +08:00
crazywhalecc
5838c87140 Merge remote-tracking branch 'origin/php-85' into php-85 2025-07-15 22:08:16 +08:00
crazywhalecc
1ce3ba0f30 Update docs and READMEs 2025-07-15 22:08:10 +08:00
Jerry Ma
dc8f7de75a Merge branch 'main' into php-85 2025-07-15 21:59:48 +08:00
crazywhalecc
d3f8e94fe9 Use new branch of micro, extension test 2025-07-15 21:57:49 +08:00
crazywhalecc
88cf0184cc extension test 2025-07-15 21:57:06 +08:00
crazywhalecc
b9e096abfa Download alpha version for 8.5 2025-07-15 21:14:15 +08:00
crazywhalecc
ec959f6239 Add 8.5 patch support for phpmicro 2025-07-15 21:14:02 +08:00
crazywhalecc
5f2459ae43 Avoid useless exception on startup version mismatch 2025-07-15 21:11:38 +08:00
Jerry Ma
9af3b745a2 Merge pull request #792 from crazywhalecc/fix/ext-imap-extraction
Skip re-extract ext-imap source
2025-07-10 21:39:34 +08:00
crazywhalecc
a5cd5fcb31 Fix test and bump docker image version 2025-07-10 20:20:29 +08:00
crazywhalecc
ec153fa6ff Workaround for swoole with alpine 3.21 2025-07-10 20:10:54 +08:00
crazywhalecc
dd72b32559 Merge 2025-07-10 12:59:27 +08:00
DubbleClick
4f4e1ca80d revert 2025-07-09 09:50:58 +07:00
DubbleClick
dd6c1d9607 patch pkgconf prefix to BUILD_ROOT_PATH instead of /../.. 2025-07-08 22:56:36 +07:00
DubbleClick
7b5f4e9dd0 cs fix 2025-07-08 11:25:44 +07:00
DubbleClick
9cd17fca1c make sure that libargon2 is always linked in before libsodium 2025-07-07 22:44:07 +07:00
DubbleClick
385a46b96f update notes for argon2 2025-07-07 21:19:57 +07:00
DubbleClick
04cbba3f4e enable-pie for openssl 2025-07-07 21:09:39 +07:00
DubbleClick
5ab5908ef5 comment it out again 2025-07-06 09:51:12 +07:00
DubbleClick
9bf65ffe83 figure out what libphp it pulls in and why 2025-07-06 08:34:01 +07:00
DubbleClick
10c8fe1f26 make it fail again (so we can later enable tmate) 2025-07-05 22:51:57 +07:00
DubbleClick
01517f82b8 disable tmate 2025-07-05 22:22:51 +07:00
DubbleClick
67277ccc21 explicitly state libphp we built? 2025-07-05 21:54:36 +07:00
DubbleClick
b12cb3350f move tmate session thingy 2025-07-05 20:00:55 +07:00
DubbleClick
3ff8c504f8 cs fix, enable action-tmate 2025-07-05 19:19:17 +07:00
DubbleClick
939b9eb8a8 fix debug flags 2025-07-05 19:13:16 +07:00
Marc
9935eba336 Update test-extensions.php 2025-07-05 15:56:36 +07:00
Marc
4024f9d6dd Update SPCTarget.php 2025-07-05 14:47:27 +07:00
DubbleClick
a097484a51 update isStatic check to ignore SPC_LIBC if using Gcc/Clang/Musl toolchain 2025-07-05 14:26:04 +07:00
DubbleClick
b0cfb4b2c4 don't clog our build CI when cs fix, phpstan or phpunit fail 2025-07-05 14:00:43 +07:00
DubbleClick
05f3abe944 cs fix 2025-07-05 13:53:12 +07:00
DubbleClick
a191c136dc strip all may strip things needed for relocation on musl 2025-07-05 13:52:47 +07:00
DubbleClick
e31e228d10 don't hardcode architecture 2025-07-05 12:19:26 +07:00
DubbleClick
47cbdf555f oops, needs musl 2025-07-05 12:13:02 +07:00
DubbleClick
26aca723cb update php-cs fixer to get rid of PHP_CS_FIXER_IGNORE_ENV variable 2025-07-05 12:11:48 +07:00
DubbleClick
93d6a45a78 *full* shared extension build linked against musl libc dynamically works! 2025-07-05 12:01:52 +07:00
DubbleClick
2ac20cf3af remove unnecessary LDFLAGS_PROGRAM env var 2025-07-05 10:44:40 +07:00
crazywhalecc
112f607d6e Add linux-only for extra runtime objects 2025-07-05 11:42:00 +08:00
crazywhalecc
c9d33bffc8 Chore 2025-07-05 10:49:55 +08:00
crazywhalecc
59f9143a3c Remove redundant postfix in openssl 2025-07-05 10:49:36 +08:00
crazywhalecc
d7f3005b69 Fix missing dash 2025-07-05 10:49:20 +08:00
crazywhalecc
5f8cd972cd Move extra runtime object to zig toolchain 2025-07-05 10:48:56 +08:00
DubbleClick
013a19e25b rename COMPILER_EXTRA to SPC_COMPILER_EXTRA 2025-07-04 14:39:42 +07:00
DubbleClick
94c38df1ba remove superfluous build-frankenphp script 2025-07-04 14:32:47 +07:00
DubbleClick
d65d82ff0a remove extra libraries for php configure/make, since they're the same and only depend on the target libc 2025-07-04 14:27:48 +07:00
DubbleClick
3070376fb6 dont use 32 bit objects 2025-07-03 20:37:50 +07:00
DubbleClick
e019b65ef7 does this break tests again? 2025-07-03 16:40:04 +07:00
DubbleClick
ccdb6a031f test native-linux-gnu again? 2025-07-03 15:42:42 +07:00
DubbleClick
e5c5b77a9a don't run extra logic in zig-cc script if there's no version string in SPC_TARGET 2025-07-03 14:46:07 +07:00
DubbleClick
3444e308fd cs fix 2025-07-03 13:51:54 +07:00
DubbleClick
8b37c64088 don't replace -lc++? 2025-07-03 13:50:06 +07:00
DubbleClick
f6a1065cd7 fix libc detection too 2025-07-03 12:44:49 +07:00
DubbleClick
4a2b28e88c fix isStatic detection for native-native 2025-07-03 12:33:55 +07:00
DubbleClick
6355a97b47 don't pass --build-shared when not using zig toolchain 2025-07-03 12:26:11 +07:00
DubbleClick
20c4056561 test native-native in CI 2025-07-03 12:25:36 +07:00
DubbleClick
a5a87b975b update target declaration to be correct 2025-07-03 12:20:59 +07:00
DubbleClick
456d12fb58 fix error suppression 2025-07-03 11:59:39 +07:00
DubbleClick
c735960ff8 Revert "remote -lutil?"
This reverts commit aff3373b78.
2025-07-03 11:43:05 +07:00
DubbleClick
cebd95b2c7 suggestion 2025-07-03 11:21:24 +07:00
DubbleClick
aff3373b78 remote -lutil? 2025-07-03 11:11:21 +07:00
DubbleClick
420fe497a5 patch correct pc 2025-07-03 09:23:59 +07:00
DubbleClick
f6a292b57b cleaner 2025-07-02 21:38:58 +07:00
DubbleClick
39ffb8d99d why does exec work but output=$(...) doesn't? 2025-07-02 21:32:24 +07:00
DubbleClick
2ac5438f6b libheif and libde265 report dependency on -lc++ instead of -lstdc++ 2025-07-02 16:11:21 +07:00
DubbleClick
76b36cef35 fix macos test 2025-07-02 14:26:15 +07:00
DubbleClick
4b38da76b1 test frankenphp too 2025-07-02 14:01:06 +07:00
DubbleClick
cc285ae8d8 cs fix 2025-07-02 12:57:58 +07:00
DubbleClick
a5a020eef1 Revert "add cache file option to autoconf executor by default (if cflags and ldflags match default)"
This reverts commit abe27598de.
2025-07-02 12:56:11 +07:00
DubbleClick
6f68d7b7f1 Revert "add cache file option to autoconf executor by default (if cflags and ldflags match default)"
This reverts commit 5577cd0fab.
2025-07-02 12:55:59 +07:00
DubbleClick
abe27598de add cache file option to autoconf executor by default (if cflags and ldflags match default) 2025-07-02 11:47:36 +07:00
DubbleClick
5577cd0fab add cache file option to autoconf executor by default (if cflags and ldflags match default) 2025-07-02 11:47:20 +07:00
DubbleClick
0695fb9381 cs fixer 2025-07-02 09:33:33 +07:00
DubbleClick
b5aa7fc213 simplify script a bit 2025-07-02 09:26:11 +07:00
DubbleClick
b16638d813 place -lstdc++ in compiler_extra 2025-07-02 09:23:31 +07:00
DubbleClick
a0564628c4 try removing -lstdc++ (this will likely make a few extensions fail to load with undefined gxx_personality_v0 again, but we can use COMPILER_EXTRA there) 2025-07-01 23:32:55 +07:00
DubbleClick
719bde87b7 allow compilation with empty target 2025-07-01 23:31:54 +07:00
DubbleClick
d8ee308a5f allow explicitly setting toolchain (simplify testing without constantly overriding CC and CXX) 2025-07-01 23:01:53 +07:00
Marc
a5d26d6517 Merge pull request #813 from crazywhalecc/fix-native
fix g++ not found error
2025-07-01 22:12:09 +07:00
DubbleClick
8b3a22cbe4 better error message 2025-07-01 18:23:02 +07:00
DubbleClick
8d47e56010 sanity check after toolset init 2025-07-01 18:22:05 +07:00
DubbleClick
a6d68b9ecf fix ncurses 2025-07-01 18:09:17 +07:00
DubbleClick
d275d6cc69 fix native chain 2025-07-01 18:06:18 +07:00
DubbleClick
e5ea32e9c0 fix in case it's not set 2025-07-01 17:57:36 +07:00
DubbleClick
5bc4504e37 fix g++ not found error 2025-07-01 17:53:35 +07:00
DubbleClick
fd89e83798 musl paths in zig toolchain are hogwash, of course 2025-07-01 17:08:19 +07:00
DubbleClick
88f9172866 bring back opcache jit fix 2025-07-01 16:57:56 +07:00
DubbleClick
27f57cc23a fix zig runtime 2025-07-01 16:40:12 +07:00
DubbleClick
f6c6011061 err, we need to install zig of course 2025-07-01 16:25:08 +07:00
DubbleClick
408b3b4060 try to test with zig? 2025-07-01 16:21:57 +07:00
DubbleClick
55fd7ba8e6 bring back static -lstdc++ for rhel 2.17 2025-07-01 15:58:04 +07:00
DubbleClick
e34eb502db fix tests failing to deprecation 2025-07-01 15:05:44 +07:00
DubbleClick
292df38c10 isInstalled for GoXcaddy 2025-07-01 14:59:34 +07:00
DubbleClick
a483c42893 redis check if static or shared 2025-07-01 14:45:28 +07:00
DubbleClick
bebcb978f6 conflicts with shared tests 2025-07-01 14:41:14 +07:00
DubbleClick
ba7f994a71 simplify zig script 2025-07-01 14:12:51 +07:00
DubbleClick
9c7e2171f6 formatting 2025-07-01 14:07:41 +07:00
DubbleClick
b7e8587608 cs fixes 2025-07-01 14:02:10 +07:00
DubbleClick
0a33fba23e zig toolchain stuff 2025-07-01 14:01:48 +07:00
DubbleClick
5370af4a84 don't zig the tests yet 2025-07-01 13:06:03 +07:00
DubbleClick
df0d5fdbe8 merge fix 2025-07-01 13:02:59 +07:00
DubbleClick
7b33ee79dd make sure that $TARGET splits for -dynamic, otherwise it resolves to "-target 'native-native -dynamic'" 2025-07-01 12:56:51 +07:00
DubbleClick
ad8322b6a6 add zig to libc/static target parsing 2025-07-01 12:55:32 +07:00
DubbleClick
c43a10027b fix 2025-07-01 11:02:20 +07:00
DubbleClick
2ebdc4509c < 2025-07-01 11:00:24 +07:00
Jerry Ma
4cb4c9c6a5 Merge pull request #812 from crazywhalecc/sponsor-badge
Add special sponsors
2025-06-30 22:09:36 +08:00
Jerry Ma
9190335a70 Merge pull request #810 from crazywhalecc/refactor/spc-target
refactor: replace SPC_LIBC with SPC_TARGET and update related logic
2025-06-30 21:49:01 +08:00
crazywhalecc
4e244789a2 Add frankenphp SAPI 2025-06-30 21:45:45 +08:00
crazywhalecc
6de7b8e63b Add special sponsors 2025-06-30 21:41:48 +08:00
Marc
68e500eea0 Merge branch 'main' into refactor/spc-target 2025-06-30 20:16:59 +07:00
Marc
840e09a684 Merge pull request #811 from crazywhalecc/fix/micro-patches
Fix/micro patches
2025-06-30 20:16:19 +07:00
crazywhalecc
d00a5223d3 Add exception for checking patch file exist 2025-06-30 19:45:26 +08:00
crazywhalecc
3965a899c7 Add missing directory separator 2025-06-30 19:41:32 +08:00
DubbleClick
956667bf08 fix alpine doctor saying gettext-dev isn't installed 2025-06-30 13:40:51 +07:00
DubbleClick
51e23d21cd remove w32 patches (other branch isn't merged yet) 2025-06-30 12:56:12 +07:00
crazywhalecc
44c6d6288e Refactor LinuxMuslCheck to use MuslToolchain class for toolchain check 2025-06-30 13:04:49 +08:00
Jerry Ma
e5848086c3 Update bin/spc-gnu-docker
Co-authored-by: Marc <m@pyc.ac>
2025-06-30 12:19:17 +08:00
Jerry Ma
138e5588e9 Update bin/spc-gnu-docker
Co-authored-by: Marc <m@pyc.ac>
2025-06-30 12:18:49 +08:00
crazywhalecc
ab5828a560 Remove redundant path in gnu docker 2025-06-30 09:05:56 +08:00
DubbleClick
1839f13149 thanks, autocomplete, for the useless flag 2025-06-29 22:57:25 +07:00
DubbleClick
320c21d272 -static, not static 2025-06-29 22:26:30 +07:00
crazywhalecc
e1e48922de Use isStatic instead of isStaticTarget 2025-06-29 22:49:48 +08:00
DubbleClick
3940f032af fix tests 2025-06-29 21:09:59 +07:00
crazywhalecc
956688d9f4 Fix CI again 2025-06-29 19:53:22 +08:00
crazywhalecc
7f45f4aeec Fix phpunit, add SPC_SKIP_TOOLCHAIN_CHECK 2025-06-29 19:48:09 +08:00
DubbleClick
78666ff7de support for frankenphp linked dynamically too 2025-06-29 18:28:42 +07:00
DubbleClick
dbdf10c75a support for dynamic linking of musl libc 2025-06-29 18:24:25 +07:00
DubbleClick
2564da2615 Reapply "just strip out the error and return the output instead of executing again without version"
This reverts commit 1d29ac228c.
2025-06-29 16:56:24 +07:00
DubbleClick
bd25de15cc okay this drove me crazy... 2025-06-29 16:50:19 +07:00
crazywhalecc
fcaa7c5f42 Add no-env-check for builder 2025-06-29 16:21:22 +08:00
crazywhalecc
e36800b951 phpunit fix 2025-06-29 16:03:38 +08:00
crazywhalecc
977fbaa8ef Suggestions 2025-06-29 16:00:17 +08:00
DubbleClick
6ed62aa05c use CC=cc to install xcaddy 2025-06-29 13:31:43 +07:00
DubbleClick
1d29ac228c Revert "just strip out the error and return the output instead of executing again without version"
This reverts commit d588e6e4fd.
2025-06-29 10:40:48 +07:00
DubbleClick
a44d90671c fix existing check for Zig::fetch 2025-06-29 00:49:39 +07:00
DubbleClick
d6b0912492 run glibc test with shared extensions against 2.28 this time 2025-06-29 00:40:03 +07:00
DubbleClick
d588e6e4fd just strip out the error and return the output instead of executing again without version 2025-06-29 00:06:40 +07:00
DubbleClick
19ddddf618 self:: instead of SourcePatcher:: 2025-06-28 23:45:02 +07:00
DubbleClick
a7bf1e9676 we need to patch swoole early enough 2025-06-28 23:33:13 +07:00
DubbleClick
02f2837f86 adjust craft command for zig 2025-06-28 22:55:30 +07:00
crazywhalecc
0598eff9c5 Add suffix support for SPC_TARGET 2025-06-28 23:13:40 +08:00
crazywhalecc
a6364389ba Add suffix support for SPC_TARGET 2025-06-28 23:11:26 +08:00
DubbleClick
9e9474a026 extra patch for swoole for CFLAGS too 2025-06-28 22:09:58 +07:00
crazywhalecc
c23c5ae614 Disable openmp for imagemagick 2025-06-28 23:08:17 +08:00
DubbleClick
de3cb2f686 no "" 2025-06-28 21:59:12 +07:00
crazywhalecc
454b5a77ad Add SPC_LIBC mapping to SPC_TARGET 2025-06-28 22:59:02 +08:00
DubbleClick
4a493f3f6d don't set rpath because on musl it'll fall over with static binaries 2025-06-28 21:50:57 +07:00
DubbleClick
61274cb865 use extra COMPILER_EXTRA env variable to make sure it's actually passed to compiler 2025-06-28 21:21:29 +07:00
crazywhalecc
8145a7536b Fix spc-gnu-docker path 2025-06-28 19:05:52 +08:00
crazywhalecc
e41d7899c7 Add comments, re-trigger tests 2025-06-28 18:14:10 +08:00
Jerry Ma
88d99a7dea Update src/SPC/store/SourcePatcher.php
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-06-28 18:04:45 +08:00
crazywhalecc
90823e3b17 Use explict glibc toolchain target 2025-06-28 17:28:02 +08:00
crazywhalecc
3357f286ab Remove libgomp deps 2025-06-28 17:13:22 +08:00
crazywhalecc
ad080da026 Refactor micro patching logic in SourcePatcher 2025-06-28 17:06:51 +08:00
crazywhalecc
25c2def710 Remove unnecessary SPC_MICRO_PATCHES 2025-06-28 16:47:19 +08:00
crazywhalecc
604131b31d Use own exception 2025-06-28 16:45:20 +08:00
crazywhalecc
924da6ae69 extension test 2025-06-28 16:39:02 +08:00
crazywhalecc
12aadf18cc refactor: replace SPC_LIBC with SPC_TARGET and update related logic 2025-06-28 16:36:05 +08:00
DubbleClick
aa516522aa why isn't this triggered? 2025-06-27 23:35:04 +07:00
DubbleClick
efb1ff5a93 test fix 2? 2025-06-27 22:56:49 +07:00
DubbleClick
aff9ff20e8 test fix? 2025-06-27 22:55:23 +07:00
DubbleClick
4c8a173213 build_lib_path is better 2025-06-27 22:53:18 +07:00
DubbleClick
b6240f16fb clean files before compiling because it may try to link the wrong one 2025-06-27 22:51:53 +07:00
DubbleClick
f5281535d9 strip libphp.so and frankenphp 2025-06-27 22:48:15 +07:00
DubbleClick
96babd0939 crazy test 2025-06-27 22:06:19 +07:00
DubbleClick
464c2dca85 cs fix 2025-06-27 22:01:56 +07:00
DubbleClick
43dc04b4d0 building shared libphp.so on musl is really pointless and should be an error, since static compilations cannot load it 2025-06-27 22:01:37 +07:00
DubbleClick
e92f043cfa really stupid patch for swoole 2025-06-27 21:38:16 +07:00
DubbleClick
ff95b464ce really stupid patch for swoole 2025-06-27 21:26:06 +07:00
DubbleClick
69e1acd5ae really stupid patch 2025-06-27 20:28:59 +07:00
DubbleClick
e162a0ecd6 libaom uses different PIC check 2025-06-27 19:37:10 +07:00
DubbleClick
383045d1c0 cs fix 2025-06-27 19:27:02 +07:00
DubbleClick
e6bec8eb57 fix lib extra cflags 2025-06-27 19:26:08 +07:00
DubbleClick
d2dea83c63 don't check for musl toolkit when running zig, add -static to ncurses 2025-06-27 18:21:22 +07:00
DubbleClick
797aaf1ea8 remove libdir 2025-06-27 14:51:36 +07:00
DubbleClick
5a7fd8c24e we shouldn't need that, need to figure out the cause 2025-06-27 09:26:57 +07:00
DubbleClick
cc4ec4b598 add back debug 2025-06-27 00:17:24 +07:00
DubbleClick
55d78579c8 pgsql x86_64 fix? 2025-06-27 00:11:28 +07:00
Marc
d94542049c Update test-extensions.php
no debug do I can see where it fails
2025-06-26 22:58:48 +07:00
DubbleClick
6dec25b4f4 space 2025-06-26 22:03:08 +07:00
DubbleClick
8c7049913b can build shared extensions on ubuntu 24.04 now 2025-06-26 17:56:33 +07:00
DubbleClick
7edd8e6e19 test glibc of course 2025-06-26 17:39:42 +07:00
DubbleClick
2b4eb7127d what the frick is going on with my phpstorm 2025-06-26 17:39:05 +07:00
DubbleClick
9a3ce775a8 complete test suite 2025-06-26 17:36:50 +07:00
DubbleClick
2ff78e531e cs fix, where did that come from? 2025-06-26 17:25:46 +07:00
DubbleClick
03a33d87ff fix frankenphp build 2025-06-26 17:23:37 +07:00
DubbleClick
176e5627e5 hahaha, musl 2.17 is a little far away 2025-06-26 16:49:26 +07:00
DubbleClick
5801d05047 test musl (I have not tested this yet!) 2025-06-26 16:47:07 +07:00
DubbleClick
815ba75c76 we can build musl with zig cc too, don't need musl toolchain 2025-06-26 16:43:37 +07:00
DubbleClick
fff16b4019 refactor our 2025-06-26 16:03:57 +07:00
DubbleClick
e408a2cf1d suggestion and aarch64 fix 2025-06-26 15:55:41 +07:00
DubbleClick
b535600297 this is insane 2025-06-26 15:44:21 +07:00
DubbleClick
762c554468 test zig 2025-06-26 14:39:49 +07:00
DubbleClick
a8c7057aba fix windows 2025-06-26 14:30:42 +07:00
DubbleClick
935f3fc37c cs fix 2025-06-26 14:29:00 +07:00
DubbleClick
fae2878c41 refactor env var logic out to packages, abomination of a zig-cc script... 2025-06-26 14:24:00 +07:00
DubbleClick
d30ccb810c Merge remote-tracking branch 'origin/main' into zig 2025-06-26 12:30:50 +07:00
DubbleClick
8d75a85d6d ziggy 2025-06-26 12:30:04 +07:00
DubbleClick
625bfd1bec don't escape 2025-06-26 11:18:34 +07:00
Jerry Ma
b04ffadf13 Merge pull request #756 from crazywhalecc/feat/intl-win
Add intl support for windows
2025-06-26 10:50:05 +08:00
DubbleClick
b142610800 move to systemutil 2025-06-25 14:52:50 +07:00
crazywhalecc
5681722c09 Fix global env manager, add in-ini variable parsing 2025-06-25 15:32:18 +08:00
DubbleClick
9a3a536479 runtime object patch for shared extensions 2025-06-25 14:32:00 +07:00
DubbleClick
55f01149e4 prevent warning 2025-06-25 13:56:12 +07:00
DubbleClick
6f5fc43490 remove extra -lunwind patch since we don't only need it in opcache 2025-06-25 11:26:45 +07:00
DubbleClick
cb62ffdfc2 we manage -fno-sanitize in code, only needed for opcache with jit 2025-06-25 11:24:01 +07:00
DubbleClick
40ac705c46 remove openmp support entirely, system packages distribute it disabled, the ini disables it by default and the authors recommend disabling it. WIth a distinction between libgomp, libomp and the non-existent usable static libraries for them, it's just not worth it. 2025-06-25 11:21:58 +07:00
Marc
3ac4a71085 add missing comma 2025-06-25 10:31:29 +07:00
Marc
2963ced1d5 Merge branch 'main' into feat/intl-win 2025-06-25 10:28:45 +07:00
Marc
175aafee50 Merge pull request #800 from crazywhalecc/asm_arith
remove disabling of asm arithmetic
2025-06-25 10:15:37 +07:00
Marc
b75a3d6e81 Merge pull request #804 from crazywhalecc/feat/del-download-type
Allow deleting pre-built or source only for del-download
2025-06-25 09:33:52 +07:00
DubbleClick
5334727528 remove -L/usr/lib64 (need to put it in the zig-cc script, stupid to add it in 15 different places instead) 2025-06-24 23:07:17 +07:00
DubbleClick
253206de22 better 2025-06-24 22:57:12 +07:00
DubbleClick
5a60f4c02b another librdkafka patch 2025-06-24 22:56:48 +07:00
DubbleClick
63fcdd9db4 default param 2025-06-24 21:04:08 +07:00
DubbleClick
832c0230e2 getcctype default 2025-06-24 21:03:32 +07:00
DubbleClick
e1028b0348 swoole has date time conversion error in c++ code, clang needs -lunwind 2025-06-24 20:43:38 +07:00
DubbleClick
2433752273 needless default 2025-06-24 13:17:43 +07:00
DubbleClick
1b0b551fc6 handle case where libphp.so is built instead of libphp-release.so 2025-06-24 12:10:01 +07:00
DubbleClick
74849a8d48 -fno-sanitize=undefined is enabled in zig by default, not in gcc and clang 2025-06-24 09:05:44 +07:00
DubbleClick
ee0de6933f deprecated linker option 2025-06-23 19:21:51 +07:00
DubbleClick
bd863dba34 zig is clang 2025-06-23 15:26:39 +07:00
DubbleClick
f9af24e246 dont fail on -lomp 2025-06-23 13:23:13 +07:00
DubbleClick
864c55feaf oops 2025-06-23 13:12:40 +07:00
DubbleClick
7628847a46 suboptimal solutions, but a bit closer to building 2025-06-23 12:57:00 +07:00
DubbleClick
955b586908 fix lz4 2025-06-22 19:51:55 +07:00
DubbleClick
32a1fd45df don't disable warnings 2025-06-22 17:21:28 +07:00
DubbleClick
15fbde29d4 remove duplicate 2025-06-22 17:02:16 +07:00
DubbleClick
2cce02bfa9 liblz4 replacement 2025-06-22 17:01:08 +07:00
DubbleClick
7e35de8a0e CXX for watcher-c 2025-06-22 16:19:01 +07:00
DubbleClick
9a98fd9cff patch things for zig compatibility 2025-06-22 15:52:01 +07:00
crazywhalecc
f6d25153c6 Allow deleting pre-built or source only for del-download 2025-06-22 16:04:50 +08:00
crazywhalecc
1409d1b47b Check lib-suggest before packing libs 2025-06-22 13:52:53 +08:00
DubbleClick
853294e168 remove disabling of asm arithmetic 2025-06-21 15:47:38 +07:00
Marc
1a4296386a Merge pull request #798 from crazywhalecc/fix/curl-h3
bring back http3 support for curl
2025-06-21 11:58:39 +07:00
DubbleClick
c464f78340 dont build exe 2025-06-21 10:58:54 +07:00
DubbleClick
8992c96014 remove test 2025-06-21 10:55:06 +07:00
DubbleClick
62a13f2da6 bring back http3 support for curl 2025-06-21 10:16:35 +07:00
Marc
f9005757bd Merge pull request #794 from crazywhalecc/perl-ipc-cmd
revert perl-IPC-Cmd
2025-06-20 18:50:35 +07:00
DubbleClick
cd6aca832d add back perl-IPC-Cmd for spc-gnu-docker (not included in perl package on aarch64, apparently) 2025-06-20 18:43:38 +07:00
crazywhalecc
1b4eb039ae Change the patch position for -release module suffix 2025-06-20 18:46:36 +08:00
Marc
6c47065686 Merge pull request #782 from crazywhalecc/fix/aarch64-uv-pthread
fix uv missing pthread_atfork in aarch64 centos 7
2025-06-20 17:22:52 +07:00
DubbleClick
9bfcea6feb tests 2025-06-20 17:13:01 +07:00
DubbleClick
58d979712e suggestion 2025-06-20 17:11:52 +07:00
Jerry Ma
a0f99858e3 Fix alpine-docker build in different arch issue (#787)
* Fix alpine-docker build in different arch issue

* Fix spc-gnu-docker for multi-arch build issue
2025-06-20 17:43:25 +08:00
DubbleClick
2abbb75f98 phpstan doesn't like GNU_ARCH there 2025-06-20 15:58:42 +07:00
DubbleClick
3f92df0865 patch before make for uv fix 2025-06-20 15:57:16 +07:00
DubbleClick
be0b98c467 patch before make for uv 2025-06-20 15:27:28 +07:00
DubbleClick
7d45415990 patch before make for uv 2025-06-20 15:25:07 +07:00
Marc
f3f581fe2d Merge pull request #784 from crazywhalecc/revert/embed-option
Revert build-embed option as boolean
2025-06-20 07:33:13 +07:00
crazywhalecc
f6837079d3 Revert build-embed option as boolean 2025-06-20 01:57:45 +08:00
Marc
5cd987ba3a since we explicitly delete module folder before building, we should reintroduce this check (#783)
otherwise shared extensions that other shared extensions depend on will be built multiple times
2025-06-20 01:27:33 +08:00
Marc
8293160a01 fix bug with only --build-embed (#781)
* passing --build-embed sets the result to NULL, not true (and not false, like for options that are not passed)

* prettify

* make sure embed can only contain null, static, shared or false
2025-06-20 01:27:02 +08:00
DubbleClick
625ee2703d uv needs to explicitly link -lpthread on aarch64, fails to pthread_atfork unresolved otherwise. It's a symbols that's in the static library, but not in the shared library 2025-06-19 22:06:11 +07:00
Marc
c3b520c3d4 Merge pull request #779 from crazywhalecc/docs
remove old extension file before building new php version
2025-06-19 18:45:22 +07:00
Jerry Ma
80687dfea3 Add macOS strip option -S, fix macOS micro strip option (#778)
* Add macOS strip option `-S`, fix macOS micro strip option

* Change docs and help messages
2025-06-19 19:31:25 +08:00
DubbleClick
7f9da6478f remove old extension file before building new php version 2025-06-19 18:13:00 +07:00
Marc
056971fcbc Merge pull request #776 from crazywhalecc/docs
protobuf and grpc don't conflict when they're built shared
2025-06-19 18:09:05 +07:00
DubbleClick
ba26359dde protobuf and grpc don't conflict when they're built shared 2025-06-19 15:21:25 +07:00
Jerry Ma
a2f0640b1b Merge pull request #767 from crazywhalecc/docs
patchelf and rename -release tagged extensions from php configure build
2025-06-19 15:57:10 +08:00
DubbleClick
16a4245ad7 common static extension tests 2025-06-19 12:40:42 +07:00
DubbleClick
608a5559ac fix incorrect array offset 2025-06-19 12:38:05 +07:00
DubbleClick
dfac385d21 suggestions 2025-06-19 12:23:33 +07:00
DubbleClick
40d602c82e xcaddy fails with this, because the module still calls itself dunglas/frankenphp 2025-06-19 12:08:53 +07:00
DubbleClick
fbd6360bda rename go-mod-frankenphp to go-xcaddy 2025-06-19 12:07:22 +07:00
crazywhalecc
a0047e3ad7 Merge remote-tracking branch 'origin/docs' into docs 2025-06-19 13:01:41 +08:00
crazywhalecc
437d6810b7 Bump version, update docs, change owner dunglas to php 2025-06-19 13:01:26 +08:00
DubbleClick
82ec7733ba musl: all-static! 2025-06-19 11:59:48 +07:00
crazywhalecc
1357990c4c Add github token hook for curlExec 2025-06-19 12:51:00 +08:00
DubbleClick
61a9264802 libraries must link against -lphp dynamic! 2025-06-19 11:20:57 +07:00
DubbleClick
4a70f260f3 test alpine directly too (spc-alpine-docker) 2025-06-19 11:12:58 +07:00
DubbleClick
bcea2007bd base arch instead of hardcoded x86_64 2025-06-19 11:04:10 +07:00
DubbleClick
fcf2c967ab fix setting of variables 2025-06-19 11:01:30 +07:00
DubbleClick
2f8e225abd remove copy of property that meant downloader would only lock one source at a time 2025-06-19 11:00:07 +07:00
DubbleClick
5f3f999222 run go mod frankenphp automatically when running craft 2025-06-19 10:36:31 +07:00
DubbleClick
2bc9fef758 cs fix 2025-06-19 10:09:42 +07:00
DubbleClick
aec03b2f24 move enable zts check 2025-06-19 10:08:51 +07:00
DubbleClick
ba6ed137c6 remove old file deletions 2025-06-19 10:03:35 +07:00
DubbleClick
32dc5d3cdb leftover double path 2025-06-19 10:02:22 +07:00
DubbleClick
597db25178 frankenphp requires ZTS 2025-06-19 10:00:56 +07:00
DubbleClick
c2d6b9ad2c refactor lock file constant out 2025-06-19 09:50:38 +07:00
DubbleClick
4977286936 fix test 2025-06-19 09:43:13 +07:00
DubbleClick
cc09184183 fix test 2025-06-19 09:34:44 +07:00
DubbleClick
a9713c3bfa polish merge 2025-06-19 09:32:55 +07:00
Marc
3af40a66dd Merge pull request #772 from crazywhalecc/sapi/frankenphp
Sapi/frankenphp
2025-06-19 09:30:16 +07:00
DubbleClick
6e70f16e1b Merge remote-tracking branch 'origin/docs' into sapi/frankenphp 2025-06-19 09:22:25 +07:00
DubbleClick
16fccf8184 Merge remote-tracking branch 'origin/sapi/frankenphp' into sapi/frankenphp 2025-06-19 09:14:49 +07:00
DubbleClick
804468f7b9 refactor common exec code out 2025-06-19 09:14:39 +07:00
crazywhalecc
7dc3b7c8ac Merge remote-tracking branch 'origin/main' into sapi/frankenphp 2025-06-19 10:11:26 +08:00
DubbleClick
b42409efd1 LD_LIBRARY_PATH for frankenphp sanity check 2025-06-19 09:08:42 +07:00
DubbleClick
cb010d81ac there's no documented functionality to download without building - xcaddy is meant to do both in one step 2025-06-19 09:03:40 +07:00
DubbleClick
15979d4636 fix double path 2025-06-19 08:59:56 +07:00
Marc
1a164fa057 Merge pull request #775 from crazywhalecc/sapi/frankenphp-prerequisites
Sapi/frankenphp prerequisites
2025-06-19 08:54:42 +07:00
crazywhalecc
a76f49f927 Remove libxml2 requirement for linux 2025-06-18 21:56:36 +08:00
crazywhalecc
becee5b426 Use version instead of -v 2025-06-18 21:27:07 +08:00
crazywhalecc
4ecaffd908 Fix test-extensions.php 2025-06-18 21:08:05 +08:00
crazywhalecc
74b1dda884 Fix test-extensions.php 2025-06-18 21:06:08 +08:00
crazywhalecc
d6858e18df phpstan fix 2025-06-18 20:57:14 +08:00
crazywhalecc
92284e92c9 Refactor go and frankenphp downloads and builds 2025-06-18 20:56:07 +08:00
crazywhalecc
f709f3bb18 Add custom package downloader and extractor 2025-06-18 20:55:24 +08:00
crazywhalecc
8e2dffc3b5 Add frankenphp sapi embed build at build command, not constant 2025-06-18 20:54:54 +08:00
crazywhalecc
ae569316ff Remove go download from doctor 2025-06-18 20:54:01 +08:00
DubbleClick
eee2ff6d61 don't embed minor version when loading libphp.so 2025-06-18 15:55:14 +07:00
DubbleClick
65b828c424 embed version information 2025-06-18 15:50:55 +07:00
DubbleClick
f10ba86218 add extension test for frankenphp 2025-06-18 14:18:01 +07:00
Jerry Ma
24e19deb58 Merge pull request #768 from crazywhalecc/ci/commit-tests
Add commit tests
2025-06-18 14:16:34 +08:00
crazywhalecc
f7a3f80689 Add test extensions as trigger 2025-06-18 14:06:59 +08:00
crazywhalecc
b4168d09b5 Add test extensions as trigger 2025-06-18 14:06:36 +08:00
Jerry Ma
ba0ea5b40a Refactor lock component to a single class (#773) 2025-06-18 14:05:43 +08:00
Marc
04cefda66c Merge pull request #774 from crazywhalecc/fix/arm64-musl
ah, the infamous arm64 bug with -fpic vs -fPIC
2025-06-18 12:46:57 +07:00
DubbleClick
8c6a708764 ah, the infamous arm64 bug with -fpic vs -fPIC
it's a bit slower, but oh well
2025-06-18 12:46:05 +07:00
DubbleClick
a1e76d9d02 remove watcher suggestion 2025-06-18 12:41:27 +07:00
DubbleClick
82ee6f0dee allow specifying if we want to build embed shared or static 2025-06-18 12:35:48 +07:00
DubbleClick
d58534b07d add support for frankenphp directory from file system, instead of pulling latest xcaddy module 2025-06-18 12:19:33 +07:00
DubbleClick
f37c863092 only needed on linux 2025-06-18 12:04:01 +07:00
DubbleClick
e71f76288b support building static frankenphp 2025-06-18 12:02:37 +07:00
DubbleClick
d094824d76 --with github.com/dunglas/caddy-cbrotli requires brotli 2025-06-18 11:54:03 +07:00
DubbleClick
d635b10e24 specify system gcc to build xcaddy in spc-gnu-docker 2025-06-18 11:47:05 +07:00
DubbleClick
dca43d6d8d nicer escaping 2025-06-18 11:39:22 +07:00
DubbleClick
abf3bfb98e suggest watcher 2025-06-18 11:36:58 +07:00
DubbleClick
c46f8513dd watcher... 2025-06-18 11:34:05 +07:00
DubbleClick
92338d478e don't bake the rpath in, otherwise we might run into issues when loading frankenphp after compiling a different version 2025-06-18 11:30:04 +07:00
DubbleClick
c1e68323c7 cs fix 2025-06-18 11:21:50 +07:00
DubbleClick
f64eb0dea5 build for bsd and macos too 2025-06-18 11:20:05 +07:00
DubbleClick
c1870af1b1 add frankenphp sapi 2025-06-18 11:15:16 +07:00
crazywhalecc
71783088c0 Use new trigger test message 2025-06-18 11:55:13 +08:00
crazywhalecc
7057a135cf Trigger extension test 2025-06-18 11:54:10 +08:00
crazywhalecc
5cb107b844 Test test 2025-06-18 11:53:17 +08:00
crazywhalecc
57b22782d3 Define env in phpunit.xml 2025-06-18 10:50:53 +07:00
crazywhalecc
cb0a90d1d9 Add source hash comparator & refactor download lock 2025-06-18 10:50:53 +07:00
DubbleClick
1c439a01a1 Merge remote-tracking branch 'origin/main' into docs 2025-06-18 10:49:43 +07:00
crazywhalecc
2bfc8e92ef Test test 2025-06-18 11:49:42 +08:00
crazywhalecc
68548cf248 Wrap it to test test test 2025-06-18 11:42:32 +08:00
crazywhalecc
3a64feefd0 Change test strategy for commit tests 2025-06-18 11:34:51 +08:00
DubbleClick
da75d2d707 cs fix 2025-06-17 18:04:27 +07:00
DubbleClick
3a85d96fa4 yet another damn centos 7 patch 2025-06-17 18:03:27 +07:00
DubbleClick
883cc4b6fd patch on 2.17... 2025-06-17 15:53:14 +07:00
DubbleClick
aa61a9e77b extra info on ext load failure 2025-06-17 14:01:53 +07:00
DubbleClick
9de5c62136 extract elsewhere temporarily 2025-06-17 12:34:56 +07:00
DubbleClick
7b3ea7e12e fix installing patchelf 2025-06-17 12:30:11 +07:00
DubbleClick
bafa67c8de add patchelf to gnu docker 2025-06-17 12:19:59 +07:00
crazywhalecc
0d3a80e582 Define env in phpunit.xml 2025-06-16 12:48:37 +08:00
crazywhalecc
5a401a5f92 Add source hash comparator & refactor download lock 2025-06-16 12:48:37 +08:00
crazywhalecc
0e88cdb258 Add shared extension parser
{craft}
extensions: bcmath
shared-extensions: xdebug,swoole
sapi: cli
{/craft}
[spc_prefix:bin/spc-gnu-docker]
2025-06-14 13:49:29 +08:00
crazywhalecc
e5cd3adf97 Next pr, I won't run 2025-06-14 02:36:47 +08:00
crazywhalecc
6253b7a912 Next pr, I won't run 2025-06-14 02:35:37 +08:00
crazywhalecc
fe455bf901 Fix shared-extensions as optional
{craft}
extensions: curl,ast
sapi: cli,micro
{/craft}
2025-06-14 02:30:00 +08:00
crazywhalecc
3a0d21eb44 Support multi-line
{craft}
extensions: curl,ast
sapi: cli,micro
{/craft}
2025-06-14 02:27:48 +08:00
crazywhalecc
45ec0cef24 Add checkout
{craft}
extensions: curl,ast
sapi: cli,micro
{/craft}
2025-06-14 02:20:52 +08:00
crazywhalecc
1468bb99f0 Add commit tests
{craft}
extensions: curl,ast
sapi: cli,micro
{/craft}
2025-06-14 02:06:12 +08:00
crazywhalecc
3efabee153 Remove redundant sanity check call 2025-06-14 01:13:33 +08:00
DubbleClick
962de5b25f add edant/watcher, to make spc-packages easier 2025-06-13 22:51:35 +07:00
DubbleClick
b265d6dd56 don't set unknown linker flags on macos 2025-06-13 16:25:31 +07:00
DubbleClick
302cf8345d properly handle different php versions, clean up only required files 2025-06-13 13:01:02 +07:00
DubbleClick
d249391816 don't add configure command to phpinfo when -release is set 2025-06-13 00:08:09 +07:00
DubbleClick
0a24a6af1f move check when to build to extension.php instead of builder 2025-06-12 20:51:17 +07:00
DubbleClick
52f40b7f9f the release option also affects shared extensions, which is unwanted, patchelf their soname back and rename them 2025-06-12 20:20:33 +07:00
Marc
8fbe6ee8ff Merge pull request #766 from crazywhalecc/docs
rebuild shared extensions even if they already exist
2025-06-12 19:20:05 +07:00
DubbleClick
5a3a8db772 rebuild shared extensions even if they already exist 2025-06-12 19:17:44 +07:00
Marc
56cd6711ce Merge pull request #764 from crazywhalecc/docs
remove incorrect space after --enable-yac
2025-06-12 14:21:02 +07:00
DubbleClick
29339b962c remove incorrect space after --enable-yac 2025-06-12 14:20:04 +07:00
Jerry Ma
d9cd4d7e36 Update version to 2.6.0 2025-06-12 13:16:45 +08:00
Marc
56080f40ef Merge pull request #763 from crazywhalecc/docs
update documentation for glibc
2025-06-12 12:12:26 +07:00
Marc
bb0a3589c1 Merge pull request #760 from lyrixx/better-exception
Better exception
2025-06-12 12:10:20 +07:00
DubbleClick
db109e3586 update documentation for glibc 2025-06-12 12:07:48 +07:00
Marc
289f4b300a Merge pull request #726 from crazywhalecc/fix/icurel
Fix PIC errors when building libphp.so | extensive extension building rework
2025-06-12 11:48:33 +07:00
DubbleClick
0ee9a0cfa4 oops, don't pass -fpic to CPPflags, I misread it as CXXflags 2025-06-12 11:45:47 +07:00
DubbleClick
d9f7aa760e update default env (shouldn't we pass -fpic to default c flags on macos?) 2025-06-12 11:40:32 +07:00
DubbleClick
01ab0d3530 update default flags 2025-06-12 11:01:05 +07:00
Jerry Ma
8bd7794a2e Add -v compatibility for command 2025-06-12 11:57:42 +08:00
DubbleClick
fcfbb59637 fix phpstan 2025-06-12 10:48:15 +07:00
DubbleClick
089b94d753 add fastlz, libmemcached for linux 2025-06-12 10:46:35 +07:00
crazywhalecc
bfba598ef4 Fix glfw source path 2025-06-12 10:58:58 +08:00
DubbleClick
e2efaab2b2 fix attempted ar deletions when building shared libphp 2025-06-12 08:18:32 +07:00
crazywhalecc
28e5e584b4 Revert ext-matrix-tests and test-extensions 2025-06-12 01:20:02 +08:00
crazywhalecc
e0734fe848 Add frameworks for extension 2025-06-12 01:16:57 +08:00
crazywhalecc
2ea8a7e662 Fix macOS embed re-archive bug 2025-06-12 01:16:30 +08:00
crazywhalecc
c0ea47ce75 I really got redundant test error 2025-06-12 00:41:33 +08:00
DubbleClick
84fb354bc0 this is not needed anymore 2025-06-11 22:46:22 +07:00
DubbleClick
9f35c954ac cs fix 2025-06-11 22:45:08 +07:00
DubbleClick
78b3778442 err 2025-06-11 22:43:51 +07:00
DubbleClick
0e092284eb err 2025-06-11 22:43:41 +07:00
DubbleClick
4be1e75128 dirty as fuck, I don't understand why AMQP_SHARED_LIBADD is not available in ./configure 2025-06-11 22:41:55 +07:00
DubbleClick
62a581393d compatibility with RHEL 10? 2025-06-11 21:55:08 +07:00
crazywhalecc
cec5274ea3 Re-test 2025-06-11 22:42:26 +08:00
crazywhalecc
80f2912026 Fix rdkafka with zstd build failed bug, reset test-extensions 2025-06-11 22:40:43 +08:00
crazywhalecc
70b91867cb Lets' fuzz it 2025-06-11 21:37:00 +08:00
crazywhalecc
a1ccddb53c Test macOS 15 for all php version 2025-06-11 20:57:43 +08:00
Grégoire Pineau
5a7db86471 Better exception 2025-06-11 14:20:24 +02:00
DubbleClick
518ed3a7fd don't add -lomp on macos (not required) 2025-06-11 15:38:43 +07:00
DubbleClick
d322be1666 err, add it back in 2025-06-11 15:02:07 +07:00
DubbleClick
a503aaa8a0 -lomp on macos 2025-06-11 15:01:16 +07:00
DubbleClick
a7771e95f2 enable musl too 2025-06-11 13:49:38 +07:00
DubbleClick
311de9381c fix gomp error 2025-06-11 13:47:32 +07:00
DubbleClick
c3aa7356ec update tests to all static 2025-06-11 11:43:00 +07:00
DubbleClick
63656cf383 cs fixer, of course 2025-06-10 19:58:25 +07:00
DubbleClick
6d3e2d9316 revert extension tests 2025-06-10 19:57:31 +07:00
DubbleClick
dcdd167db3 Merge remote-tracking branch 'origin/fix/icurel' into fix/icurel
# Conflicts:
#	src/SPC/builder/unix/library/gettext.php
#	src/SPC/builder/unix/library/libiconv.php
#	src/SPC/builder/unix/library/libxslt.php
2025-06-10 19:48:22 +07:00
DubbleClick
9ed62b02b6 make patchLaDependencyPrefix argument optional, remove cleanLaFiles 2025-06-10 19:46:55 +07:00
crazywhalecc
6b330fa869 Remove redundant env 2025-06-10 19:13:35 +08:00
crazywhalecc
5cc753dec4 cs fix 2025-06-10 19:12:40 +08:00
crazywhalecc
f7a0f50f87 Sort config 2025-06-10 19:10:24 +08:00
crazywhalecc
8466970a1f Add tests 2025-06-10 19:07:16 +08:00
crazywhalecc
48cb87ada2 Add intl support for windows 2025-06-10 19:06:07 +08:00
crazywhalecc
145fe7ce13 Remove curl libbrotli patches 2025-06-10 17:17:46 +08:00
crazywhalecc
b320eb853a Rename ignoreConfigureArgs to removeConfigureArgs 2025-06-10 17:17:46 +08:00
crazywhalecc
474fe63ad3 Add optional lib log 2025-06-10 17:17:46 +08:00
crazywhalecc
da45aa7f15 Fix ngtcp2 and libheif build missing lib bug 2025-06-10 17:17:46 +08:00
crazywhalecc
11f21304f9 Fix libxslt lib compile bug 2025-06-10 17:17:46 +08:00
crazywhalecc
6cb2cdd5a2 Add ignoreConfigureArgs for UnixAutoconfExecutor 2025-06-10 17:17:46 +08:00
crazywhalecc
9e8119e69c Fix ldap build 2025-06-10 17:17:46 +08:00
crazywhalecc
25c2bafa88 Fix brotlienc pkgconfig patching 2025-06-10 17:17:46 +08:00
crazywhalecc
ae56bed032 Fix ncurses build 2025-06-10 17:17:46 +08:00
crazywhalecc
4c8f9e154d Remove attr and libacl tests 2025-06-10 17:17:46 +08:00
crazywhalecc
0ed6f2924e Add tests for autoconf libs 2025-06-10 17:17:46 +08:00
crazywhalecc
8896d477aa Add tests for autoconf libs 2025-06-10 17:17:46 +08:00
crazywhalecc
1b08a250f6 Add --enable-pic for default autoconf args 2025-06-10 17:17:46 +08:00
crazywhalecc
8b09e1a446 Fix zlib autoconf builder 2025-06-10 17:17:46 +08:00
crazywhalecc
720251458f Add autoconf executor 2025-06-10 17:17:46 +08:00
crazywhalecc
a48680c26f Use tar gzip for windows 2025-06-09 19:33:10 +08:00
DubbleClick
684b5d4534 remove alpine tests for now https://github.com/php/php-src/pull/18779 2025-06-09 16:16:54 +07:00
DubbleClick
aedcc86fc5 fix cmake minimum version for libtidy 2025-06-09 15:52:17 +07:00
DubbleClick
978975d396 import class 2025-06-09 14:54:58 +07:00
DubbleClick
c9e9119bff remove gd from static extension test 2025-06-09 14:48:42 +07:00
DubbleClick
20f222d19e post merge fixes 2025-06-09 14:48:05 +07:00
DubbleClick
187d51e501 -DPOSITION_INDEPENDENT_CODE=ON for cmake 2025-06-09 14:41:14 +07:00
DubbleClick
fa744bb802 merge cmake changes from master into icurel 2025-06-09 14:38:45 +07:00
Jerry Ma
bed5b9d4ef Merge pull request #751 from crazywhalecc/shell-improvement
Extract default build env to unix shell
2025-06-09 13:37:12 +08:00
crazywhalecc
13540c8008 Remove shared tidy 2025-06-09 13:08:28 +08:00
crazywhalecc
48df491c31 Fix brotli build on macOS 2025-06-09 13:00:43 +08:00
crazywhalecc
3fbf8fcfb8 Merge branch 'main' into shell-improvement 2025-06-09 12:51:00 +08:00
Jerry Ma
104038bc7e Merge pull request #752 from crazywhalecc/cmake-test
Trigger tests
2025-06-09 12:50:32 +08:00
crazywhalecc
bb37c0058e Fix CMake related options 2025-06-09 12:49:33 +08:00
crazywhalecc
f4e1d7d4c1 Trigger tests 2025-06-09 12:37:50 +08:00
crazywhalecc
e6c9a82cd3 Fix gitignore 2025-06-09 12:14:25 +08:00
crazywhalecc
0ca71b62db Fix gitignore 2025-06-09 12:13:14 +08:00
crazywhalecc
936c4d8696 Change env string inject order 2025-06-09 12:12:22 +08:00
crazywhalecc
1c1f7b19dd Add XXX_CXXFLAGS for common build 2025-06-09 11:13:54 +08:00
crazywhalecc
0558d67240 Rename initBuildEnv to initializeEnv 2025-06-09 11:12:34 +08:00
Jerry Ma
3bb9a7b1f8 Feat: UnixCMakeExecutor (#750)
* Add cmake executor and default library path var wrapper

* Add cmake tool functions

* Use cmake executor instead of raw command

* Fix UnixCMakeExecutor.php missing return

* Fix UnixCMakeExecutor.php

* Refactor remaining cmake libs

* Add reset function

* Remove unused cmake things

* Remove unused cmake things

* Whoops

* Update src/SPC/builder/unix/library/libzip.php

Co-authored-by: Marc <m@pyc.ac>

* Update src/SPC/builder/unix/library/libzip.php

Co-authored-by: Marc <m@pyc.ac>

* For tomorrow windows executor, move it

* Rename setCMakeBuildDir to setBuildDir

---------

Co-authored-by: Marc <m@pyc.ac>
2025-06-09 11:09:41 +08:00
crazywhalecc
123cc92756 Extract default build env to unix shell 2025-06-09 10:24:06 +08:00
crazywhalecc
9babe7f1d2 Rename setCMakeBuildDir to setBuildDir 2025-06-09 09:26:39 +08:00
crazywhalecc
f46b714990 For tomorrow windows executor, move it 2025-06-09 09:24:31 +08:00
Jerry Ma
3497b2a760 Update src/SPC/builder/unix/library/libzip.php
Co-authored-by: Marc <m@pyc.ac>
2025-06-09 09:17:11 +08:00
Jerry Ma
acd10bd978 Update src/SPC/builder/unix/library/libzip.php
Co-authored-by: Marc <m@pyc.ac>
2025-06-09 09:17:04 +08:00
crazywhalecc
802950d941 Whoops 2025-06-09 01:52:23 +08:00
crazywhalecc
f158fba48d Remove unused cmake things 2025-06-09 01:48:48 +08:00
crazywhalecc
059d134990 Remove unused cmake things 2025-06-09 01:34:32 +08:00
crazywhalecc
f7871c0036 Add reset function 2025-06-09 01:33:21 +08:00
crazywhalecc
42943b315c Refactor remaining cmake libs 2025-06-09 01:33:06 +08:00
crazywhalecc
37b9ccfaa8 Fix UnixCMakeExecutor.php 2025-06-09 01:15:48 +08:00
crazywhalecc
1cf2a3dd3f Fix UnixCMakeExecutor.php missing return 2025-06-09 01:08:24 +08:00
crazywhalecc
1718806042 Use cmake executor instead of raw command 2025-06-09 01:07:30 +08:00
crazywhalecc
7d26aa533a Add cmake tool functions 2025-06-09 00:34:25 +08:00
crazywhalecc
521af84797 Add cmake executor and default library path var wrapper 2025-06-09 00:16:18 +08:00
DubbleClick
53eb6dcc80 cs fix hook isn't working on windows 2025-06-08 14:49:06 +07:00
DubbleClick
6ed440d861 refactor out method to get static and shared libraries 2025-06-08 14:45:09 +07:00
DubbleClick
a99c4a3fee remove getLibFilesString from Extension buildUnixShared 2025-06-08 08:13:03 +07:00
DubbleClick
0ebd44bc4f bring back zstd cmake flags 2025-06-07 23:19:32 +07:00
DubbleClick
2f53915064 fix ldap for postgresql 2025-06-07 23:00:26 +07:00
DubbleClick
08d3849c43 cs fix 2025-06-07 22:00:01 +07:00
DubbleClick
bb1f086674 pq forgets to link against -llber, only links against -lldap 2025-06-07 21:57:04 +07:00
DubbleClick
f4771b4f21 test macos too 2025-06-07 21:33:02 +07:00
DubbleClick
2093b4ec85 cs fix 2025-06-07 21:19:17 +07:00
DubbleClick
e5f483de1d libtidy uses strange cmake options 2025-06-07 21:16:53 +07:00
DubbleClick
23be5484e3 thread safety for pgsql (in version 17, remove this entirely) 2025-06-07 21:16:15 +07:00
DubbleClick
0b8543e6dd thread safety for pgsql? 2025-06-07 20:50:54 +07:00
DubbleClick
a3025479e7 fix libyaml install dir 2025-06-07 20:50:46 +07:00
DubbleClick
a6ea49981d ngtcp2 patch la files 2025-06-07 20:29:19 +07:00
DubbleClick
2a39fb0bd5 Merge remote-tracking branch 'origin/main' into fix/icurel 2025-06-07 20:10:04 +07:00
DubbleClick
2dde53760a makeCmakeArgs 2025-06-07 20:09:50 +07:00
Marc
a7e48a8d3b Merge pull request #748 from crazywhalecc/feat/h3
simplify makeAutoConfArgs, fix macOS differences
2025-06-07 10:51:03 +07:00
DubbleClick
4fae158a3c cs fix 2025-06-07 10:33:41 +07:00
DubbleClick
7d87856f4a remove static libraries from libngtcp_crypto_ossl.a 2025-06-07 10:23:10 +07:00
DubbleClick
cfa525351a cs fix 2025-06-07 10:11:57 +07:00
DubbleClick
f9de43c7d4 =yes 2025-06-07 10:11:23 +07:00
DubbleClick
e00227f0c6 remove separate method from macosbuilder, move method from LinuxBuilder into UnixBuilderBase 2025-06-07 09:45:19 +07:00
DubbleClick
e31942bf1e uncommented buildphp, haha 2025-06-07 08:21:56 +07:00
DubbleClick
111de20a57 fix cs 2025-06-07 00:00:17 +07:00
DubbleClick
635fbae3c9 Merge remote-tracking branch 'origin/main' into fix/icurel 2025-06-07 00:00:00 +07:00
DubbleClick
f29ee95176 remove buildUnixShared method from xhprof 2025-06-06 23:58:33 +07:00
DubbleClick
0d91ad7d94 remove buildUnixShared method from sqlsrv 2025-06-06 23:57:48 +07:00
DubbleClick
715650c4db add "which" to spc doctor 2025-06-06 23:51:58 +07:00
DubbleClick
a68212672b apply suggestions 2025-06-06 23:49:58 +07:00
Marc
fce115d39c Merge pull request #747 from crazywhalecc/feat/h3
fix ngtcp2 with openssl on glibc <= 2.17, macos still pending
2025-06-06 17:08:14 +07:00
DubbleClick
301f2d8a97 nghttp2 has brotlienc and brotlidec too 2025-06-06 17:02:35 +07:00
DubbleClick
500c19d900 phpstan 2025-06-06 16:59:36 +07:00
DubbleClick
617b0de31f add -lpthread and -ldl in openssl::getStaticLibFiles 2025-06-06 16:56:08 +07:00
DubbleClick
92ad792eff oops 2025-06-06 16:24:52 +07:00
DubbleClick
560f684f7f remove more unused options 2025-06-06 16:20:34 +07:00
DubbleClick
a0c0555089 add -lpthread -dl 2025-06-06 16:00:24 +07:00
DubbleClick
9fa1fb7b44 fix cs 2025-06-06 14:58:18 +07:00
DubbleClick
f5fa49338d macos is stupid now? 2025-06-06 14:49:09 +07:00
DubbleClick
df7cfa0d6a different extension combination fails? 2025-06-06 14:33:39 +07:00
DubbleClick
a0579efbc2 test 2025-06-06 14:32:28 +07:00
DubbleClick
b6a1182876 patch la files 2025-06-06 14:26:06 +07:00
DubbleClick
4582e1f508 cs fix 2025-06-06 13:57:45 +07:00
DubbleClick
621e396373 Merge branch 'fix/icurel' of https://github.com/crazywhalecc/static-php-cli into fix/icurel 2025-06-06 13:55:11 +07:00
DubbleClick
300723419b Merge remote-tracking branch 'origin/main' into fix/icurel 2025-06-06 13:55:00 +07:00
Marc
f75ab9f428 Merge pull request #743 from crazywhalecc/feat/h3
Feature: add http/3 support to curl.
2025-06-06 13:53:25 +07:00
Marc
dbc7ff5de7 Merge pull request #746 from crazywhalecc/fix/embed-soname
-release (soname) compilation support for linux shared embed
2025-06-06 13:44:34 +07:00
Marc
856db3df08 Merge pull request #745 from crazywhalecc/feat/lz4
add lz4 extension
2025-06-06 13:28:54 +07:00
DubbleClick
1479bef00d brotli was matching /dev/null, which should not be used 2025-06-06 13:21:20 +07:00
DubbleClick
3761a9c8ba brotli was matching /dev/null, which should not be used 2025-06-06 13:18:49 +07:00
DubbleClick
7c4c8c6275 cache libc version 2025-06-06 13:10:28 +07:00
DubbleClick
3b9670c202 fpic for liblzma 2025-06-06 09:57:20 +07:00
DubbleClick
861010af0e trim envs 2025-06-06 09:35:05 +07:00
DubbleClick
57b527c886 gzencode, of course 2025-06-05 21:29:20 +07:00
DubbleClick
31652e8b04 I HATE WINDOWS 2025-06-05 20:26:41 +07:00
DubbleClick
8b94a7174f cs fix 2025-06-05 20:14:02 +07:00
DubbleClick
01a79fcc6e unify tests for all compression extensions 2025-06-05 20:07:55 +07:00
DubbleClick
17b4c18830 accidental space 2025-06-05 19:59:45 +07:00
DubbleClick
86541b1aa8 only apply ffi patch at version >= 8.3.16 2025-06-05 19:58:38 +07:00
DubbleClick
e022a45048 only apply ffi patch at version >= 8.3.16 2025-06-05 19:57:59 +07:00
DubbleClick
94e31f1953 doms 2025-06-05 17:32:54 +07:00
DubbleClick
ad8581db97 Merge remote-tracking branch 'origin/main' into fix/icurel 2025-06-05 16:48:47 +07:00
DubbleClick
e2191113b0 tests for brotli and xz 2025-06-05 16:42:52 +07:00
DubbleClick
161a553948 -release (soname) compilation support for linux shared embed 2025-06-05 13:54:17 +07:00
DubbleClick
80f63e66c3 check static compilation 2025-06-05 11:48:28 +07:00
DubbleClick
2f25409475 add lz4 test 2025-06-05 11:48:07 +07:00
DubbleClick
67320d3eb3 add to tests 2025-06-05 11:37:36 +07:00
DubbleClick
92aeb2d816 enable shared 2025-06-05 11:35:50 +07:00
DubbleClick
3420f6ca42 add lz4 extension 2025-06-05 11:33:51 +07:00
DubbleClick
8e5efb923f update docs 2025-06-05 10:27:18 +07:00
Marc
ab4e0bc406 Merge pull request #741 from crazywhalecc/fix/freetype-cmake
force minimum version 3.5 for cmake policies in freetype
2025-06-05 10:22:51 +07:00
DubbleClick
8993b3f4f0 add pkgconf prefix patch for ngtcp2 crypto library 2025-06-05 10:06:20 +07:00
DubbleClick
499c281931 cs fix 2025-06-05 09:50:14 +07:00
DubbleClick
bb7e0f6f89 add nghttp3 and ngtcp2 2025-06-05 09:44:03 +07:00
DubbleClick
8919a2fcca goddamn windows 2025-06-04 21:50:28 +07:00
DubbleClick
ba0796c9ea nghttp3 2025-06-04 21:42:44 +07:00
DubbleClick
1b7404f194 php cs fix 2025-06-04 21:22:05 +07:00
DubbleClick
5add534848 don't use two extra variables 2025-06-04 21:20:00 +07:00
DubbleClick
ef7ebdfd1f force minimum version 3.12 for cmake policies in freetype, only when cmake >= 4 2025-06-04 21:18:44 +07:00
Marc
42f356d322 Merge pull request #739 from crazywhalecc/fix/curlca
force curl to respect SSL_CERT_FILE
2025-06-04 19:09:57 +07:00
DubbleClick
dabf52511f force minimum version 3.5 for cmake policies in freetype 2025-06-04 17:18:09 +07:00
DubbleClick
df85f97646 force curl to respect SSL_CERT_FILE 2025-06-04 13:44:18 +07:00
DubbleClick
a9d37bb2a2 add source patch for ffi on centos 7 2025-06-04 08:58:46 +07:00
DubbleClick
6b689f1584 explicitly pass env to process handler, fails in docker otherwise (??????) 2025-06-02 15:12:44 +07:00
DubbleClick
4b0fa94b3c stan 2025-06-02 12:32:53 +07:00
DubbleClick
c53b06c3d2 shared-extensions instead of build-shared 2025-06-02 12:27:58 +07:00
DubbleClick
ed87a7cd67 don't force invalidate php-src if the download option is explicitly passed 2025-06-02 12:00:20 +07:00
DubbleClick
108bf34cca craft needs to download shared extensions too 2025-06-02 11:55:55 +07:00
DubbleClick
8b98792ccf zts of course 2025-06-01 13:59:18 +07:00
DubbleClick
7c009b6dce add rdkafka 2025-06-01 13:53:56 +07:00
DubbleClick
5ae5a3d75d cs fix 2025-06-01 13:53:33 +07:00
DubbleClick
396ddd3e6f cs fix 2025-06-01 13:52:17 +07:00
DubbleClick
da7a125faf librdkafka needs "which" to be installed 2025-06-01 13:51:05 +07:00
DubbleClick
febf9b1815 full test suite for shared extensions 2025-06-01 13:27:36 +07:00
DubbleClick
55b4ba5832 fix file_exists check in printing shared extension folder 2025-06-01 13:23:44 +07:00
Marc
3bc5ac28be space 2025-05-31 22:33:30 +07:00
Marc
93eb6378ba Merge branch 'main' into fix/icurel 2025-05-31 22:32:08 +07:00
Marc
61837f0d68 more os tests 2025-05-31 22:26:56 +07:00
henderkes
c44b8b1029 test xz and brotli as well 2025-05-31 22:20:03 +07:00
henderkes
8312ce4d4c add ext-xz and ext-brotli 2025-05-31 22:17:06 +07:00
DubbleClick
3052b1cca5 change extension_dir, the env variable only has an effect during compilation 2025-05-31 21:01:22 +07:00
DubbleClick
ad3860981a -DPOSITION_INDEPENDENT_CODE=ON 2025-05-31 14:41:35 +07:00
DubbleClick
2dbcbc6963 --with-pic and --enable-pic for other libraries that support them 2025-05-31 14:35:59 +07:00
DubbleClick
8767181a80 --with-pic for ldap 2025-05-31 14:21:55 +07:00
DubbleClick
4c64707138 -ldl and --with-pic for imagemagick 2025-05-31 14:19:04 +07:00
DubbleClick
764fdd4d08 --enable-pic for gettext 2025-05-31 14:09:35 +07:00
DubbleClick
4c124770ed --with-pic for libffi 2025-05-31 14:06:00 +07:00
DubbleClick
78b2a89b0a --with-pic for libpng 2025-05-31 14:03:17 +07:00
DubbleClick
6147721314 dont disable openmp macro 2025-05-30 22:26:43 +07:00
DubbleClick
2a5915f4b6 patched this in ext-spx before, do it here instead 2025-05-30 21:21:50 +07:00
DubbleClick
5382362168 only disable openmp for rh devtoolset-10 2025-05-30 20:41:17 +07:00
DubbleClick
3867b9933d update doc for spx extension 2025-05-30 16:18:34 +07:00
crazywhalecc
4299abf68b Update vitepress version, fix selecting all options 2025-05-30 15:38:06 +08:00
DubbleClick
b68701f51b updated the static-php spx 2025-05-27 12:18:31 +07:00
David Grüner
c551efb75c Fix CraftCommand ignoring build-options during build (closes #732) (#733)
Unified option to parameter conversion
2025-05-26 20:14:23 +08:00
DubbleClick
92acb95a58 linter 2025-05-25 18:39:11 +07:00
DubbleClick
e2ea10d2eb set extension dir before 2025-05-25 18:29:34 +07:00
DubbleClick
d833d8946c fixes on arch64 2025-05-25 18:03:07 +07:00
DubbleClick
3662e079ac fix spc doctor command, gettext is installed by default, but doesn't provide all required autopoint stuff - check for gettextize instead, which is only installed with the gettext-devel package 2025-05-25 17:26:48 +07:00
DubbleClick
c972a94876 another way where static extensions would be excluded if also compiled shared 2025-05-25 15:52:11 +07:00
DubbleClick
234df8d11f update spx, works static and shared 2025-05-25 11:48:52 +07:00
DubbleClick
14ca782672 rename method 2025-05-25 11:07:44 +07:00
DubbleClick
9665473669 revert env 2025-05-25 11:02:54 +07:00
DubbleClick
a8987d48ed the what now? 2025-05-25 11:00:38 +07:00
DubbleClick
f83715c370 add function description 2025-05-25 10:52:46 +07:00
DubbleClick
a9d5dcf4a2 fixer 2025-05-25 10:47:32 +07:00
DubbleClick
e568041143 \$SPC_CMD_PREFIX_PHP_MAKE -> $SPC_CMD_PREFIX_PHP_MAKE 2025-05-25 10:44:38 +07:00
DubbleClick
4ce7374ac9 move zend extension check into config 2025-05-25 09:37:15 +07:00
DubbleClick
ed35b65390 build all static exts no matter if we're also building shared versions 2025-05-23 12:09:57 +07:00
DubbleClick
15dc672bcf remove shared-ext-depends 2025-05-23 10:01:24 +07:00
DubbleClick
51891478e4 shared ssh2 wants openssl if mysqli or mysqlnd aren't built in 2025-05-22 16:51:03 +07:00
DubbleClick
c2d5afc4e9 mysqli and mysqlnd can also be built shared 2025-05-22 16:48:22 +07:00
DubbleClick
835fc1e360 oops 2025-05-22 16:08:09 +07:00
DubbleClick
2a70b998e3 change to count of Static Extensions 2025-05-22 16:07:52 +07:00
DubbleClick
5eecd14ce0 linter 2025-05-22 16:04:29 +07:00
DubbleClick
0afe0e5f46 last problems (?) 2025-05-22 15:46:42 +07:00
DubbleClick
396d4b341f broli, hahahaha 2025-05-22 13:01:36 +07:00
DubbleClick
bc002d500e linter again 2025-05-22 12:45:06 +07:00
DubbleClick
6a86b28977 fix case of nonexistent pc 2025-05-22 12:44:48 +07:00
DubbleClick
b91c83b6cd linter 2025-05-22 12:29:19 +07:00
DubbleClick
4b8412dfdb shared for imagick 2025-05-22 12:28:00 +07:00
DubbleClick
3713ae8c93 extra dependencies for extensions 2025-05-22 12:27:41 +07:00
DubbleClick
310be957b6 new build-with-php key for extensions 2025-05-22 12:27:27 +07:00
DubbleClick
c29ca9722f add -lbrotlienc to curl 2025-05-22 12:26:25 +07:00
DubbleClick
64b6f98ce7 the flag doesn't fix it, the problem is something else 2025-05-21 20:43:10 +07:00
DubbleClick
4a44282556 shoehorn the lot in, I don't know how to fix this otherwise 2025-05-21 20:12:12 +07:00
DubbleClick
e3d7969b96 select all quick button 2025-05-21 20:03:21 +07:00
DubbleClick
b68d71b7b7 testPHP in windowsbuilder 2025-05-21 19:22:15 +07:00
DubbleClick
b376d1682f remove runSharedExtensionCheckUnix 2025-05-21 18:35:48 +07:00
DubbleClick
af51469b62 session, not sockets... 2025-05-21 18:04:38 +07:00
DubbleClick
fc7df585bd msgpack requires session 2025-05-21 18:01:41 +07:00
DubbleClick
3ff31d20cf fix undefined references to brotlicommon functions in gd.so 2025-05-21 17:59:46 +07:00
DubbleClick
11c116480f fix spx 2025-05-21 17:57:53 +07:00
Marc
fd5bc54cd0 Merge pull request #721 from crazywhalecc/feat/spx
update ext-spx (support zts builds)
2025-05-21 14:55:44 +07:00
Marc
95380168ef Merge branch 'fix/icurel' into feat/spx 2025-05-21 14:55:17 +07:00
DubbleClick
d349627fa1 linter 2025-05-21 14:29:49 +07:00
DubbleClick
3f8d297fb1 linter 2025-05-21 14:15:58 +07:00
Jerry Ma
aae6c2c98b Fix GHA token missing bug (#731)
* Update test-extensions.php

* Enable UPX test

* Add debug messages

* Test

* Revert

* Update tests.yml

* Update tests.yml

* Explict define GITHUB_TOKEN

* What's this???

* Check GITHUB_TOKEN in workflow

* Test token variable in step

* Test token variable inside php

* Test token in command

* Get env in commands

* Revert workflow env, add passthrough GITHUB_TOKEN into docker

* See build commands

* See build commands

* Typo fix

* Remove debug symbol for normal mode
2025-05-21 15:11:42 +08:00
DubbleClick
7698ceb108 fixes for more configure args 2025-05-21 14:10:56 +07:00
DubbleClick
495e868a71 rework configure args 2025-05-21 13:19:51 +07:00
DubbleClick
95a2f4600b rework building of shared extensions so that builtin extensions are built at php-src/configure -> make time 2025-05-21 12:01:00 +07:00
DubbleClick
c43423a7d0 replace root cause of the automatic enable 2025-05-21 11:19:28 +07:00
DubbleClick
fa285ecc82 more patching, xml still not working though 2025-05-20 23:16:36 +07:00
DubbleClick
f47daac3cc cs fix, xml building fails now, unsure why, doesn't seem to import expat_compat.h for some reason 2025-05-20 23:04:58 +07:00
DubbleClick
03ca3f4f59 why do we have prefix= calls instead of prefix=BUILD_ROOT_DIR? 2025-05-20 22:19:09 +07:00
DubbleClick
a9f81dd38e remove -fpic and -fpie (-fPIC and -fPIE are still there) 2025-05-20 20:03:02 +07:00
DubbleClick
93c6928624 fix readline 2025-05-20 20:00:37 +07:00
Marc
1e50dac5a6 Update BuildPHPCommand.php
fix printed path
2025-05-20 10:50:41 +07:00
henderkes
545a653c0d better phar handling 2025-05-20 09:20:20 +07:00
henderkes
20b6870f90 rewrite extension_dir 2025-05-20 09:14:13 +07:00
Jerry Ma
ca6f19f77d Add build from config support (craft command) (#713)
* Add build from config support (craft command)

* fix 60s timeout

* Fix missing optional warning

* Fix Windows missing SIGINT bug

---------

Co-authored-by: DubbleClick <m@pyc.ac>
2025-05-20 10:07:19 +08:00
henderkes
14a0e1a6cc fix macos 2025-05-20 08:24:39 +07:00
henderkes
38dfcdabd0 fix rdkafka 2025-05-20 08:06:49 +07:00
henderkes
683371adaa fix phar 2025-05-20 07:48:49 +07:00
henderkes
7ba1948101 fix pdo_sqlsrv 2025-05-20 07:48:49 +07:00
henderkes
5bd53ed714 skip php rebuild if we're only building shared libphp.so 2025-05-20 07:48:49 +07:00
henderkes
bff99fa537 fix imagick shared build 2025-05-20 07:48:48 +07:00
Marc
54ff71798c patch intl standard to c++17 2025-05-18 21:48:43 +07:00
Marc
81474336c1 Update dom.php 2025-05-18 18:29:43 +07:00
henderkes
6b50700d8c remove dom extra cake 2025-05-18 18:24:09 +07:00
henderkes
f708907d99 zstd pic 2025-05-18 17:59:12 +07:00
Marc
117923791a Update test-extensions.php 2025-05-18 17:46:55 +07:00
henderkes
ea7c145c62 libxml2 pic... 2025-05-18 15:52:15 +07:00
henderkes
bdd764218b install headers and modules from shared extensions 2025-05-18 12:53:49 +07:00
henderkes
1fbd2c1adc -fPIC for postgresql CFLAGS, but it's still erroring out 2025-05-18 12:46:55 +07:00
henderkes
2ff300970a -fPIC for unixodbc 2025-05-18 12:19:26 +07:00
henderkes
f88c10d4aa restore buildphp command 2025-05-18 08:57:07 +07:00
henderkes
eab8c27e4a shared dom ext requires xml 2025-05-17 22:43:34 +07:00
henderkes
c1e91e1ccb sockets doesn't install header?! 2025-05-17 22:40:30 +07:00
henderkes
05e9129a66 refactor dom out to its own extension, fails shared build 2025-05-17 19:01:32 +07:00
henderkes
76a9be2167 fix shared bz2 build 2025-05-17 19:00:57 +07:00
Marc
872673655e oopsie in opcache 2025-05-16 00:26:23 +07:00
Marc
1ae27c7b5a oopsie 2025-05-16 00:24:18 +07:00
henderkes
b402b735d6 fix copy command with BUILD_MODULES_CONSTANT 2025-05-15 23:30:07 +07:00
henderkes
22001792cd remove static target for swoole 2025-05-15 21:51:18 +07:00
henderkes
9557c9ef21 remove static target for zip 2025-05-15 21:50:35 +07:00
henderkes
6fe8b591ce ld library path for shared extension building 2025-05-15 19:52:30 +07:00
henderkes
23ae3f60f3 remove unused option 2025-05-15 15:35:13 +07:00
henderkes
03b634b961 fix libsodium with -fPIC too 2025-05-15 15:29:12 +07:00
henderkes
2897fdda04 fix icu for relocatable objects (required by libphp.so building) 2025-05-15 14:47:54 +07:00
henderkes
f5fffafd43 format setEnv§ 2025-05-15 14:46:44 +07:00
Marc
e884f97621 Merge pull request #723 from crazywhalecc/fix/xslt
fix libxslt build when trying to create a PIE executable using it
2025-05-07 10:50:04 +07:00
DubbleClick
e4028da886 typo 2025-05-06 16:56:06 +07:00
DubbleClick
a65bc95091 test arm64 too 2025-05-06 16:54:20 +07:00
DubbleClick
14563417a7 don't test on windows x) 2025-05-06 16:53:52 +07:00
DubbleClick
a3ee3e5a24 add to tests 2025-05-06 16:41:35 +07:00
DubbleClick
16a36b8315 damn comma 2025-05-06 16:39:02 +07:00
DubbleClick
861c49c9bc make sure -fpic -fpie from CFLAGS bleeds through to libxslt compilation 2025-05-06 16:35:41 +07:00
DubbleClick
b3dacf9c5a lowercase 2025-05-06 16:22:37 +07:00
DubbleClick
2c13eb257b static compilation is not quite working yet 2025-04-30 21:46:27 +07:00
crazywhalecc
348decf72f Fix Windows missing SIGINT bug 2025-04-29 14:52:24 +08:00
crazywhalecc
92483cf188 Fix missing optional warning 2025-04-29 14:51:49 +08:00
DubbleClick
8143b1d768 fix 60s timeout 2025-04-29 13:11:26 +07:00
Jerry Ma
e7d6f37e98 Fix windows xlswriter duplicate md5 symbol bug (#719)
* Add missing SOURCE_PATH before making cmake toolchain

* Fix windows xlswriter duplicate md5 symbol bug

* Add detection for patchFile to prevent duplicate patches

* Add tests
2025-04-28 14:35:08 +08:00
DubbleClick
d275a44895 Merge remote-tracking branch 'origin/main' into feat/craft 2025-04-28 10:58:11 +07:00
Marc
f755d66342 fix attr and acl build without autogen.sh (if we don't download from git) (#718) 2025-04-28 11:14:46 +08:00
Jerry Ma
22a438ed5e Add xlswriter extension windows support (#712)
* Add xlswriter extension windows support

* cs fix
2025-04-24 14:21:37 +08:00
Jerry Ma
a014294d58 Fix ghrel download link, use API directly (#711)
* Fix ghrel download link, use API directly

* Add missing GH token for downloading API
2025-04-24 14:21:22 +08:00
Jerry Ma
39953b5223 Fix pack lib command with wrong compression (#710)
* Fix pack lib command with wrong compression

* Update src/SPC/command/dev/PackLibCommand.php

Co-authored-by: Marc <m@pyc.ac>

---------

Co-authored-by: Marc <m@pyc.ac>
2025-04-24 14:21:07 +08:00
crazywhalecc
bd341db54a Add build from config support (craft command) 2025-04-24 14:18:39 +08:00
Jerry Ma
455ed7d503 Add alt download for Downloader (#706)
* Add alt download for Downloader

* Test broken url

* Break another source

* Good!

* Rename alt_sources variable

* Use SPC_DOWNLOAD_RETRIES instead of SPC_RETRY_TIME

* Apply new curlExec args
2025-04-22 20:25:44 +08:00
Marc
637ae89583 Merge pull request #707 from crazywhalecc/retries
rename SPC_RETRY_TIME to SPC_DOWNLOAD_RETRIES to clear up what it's doing sleep 5 seconds between retries
2025-04-22 15:45:02 +07:00
DubbleClick
7fd858b472 Revert "unwrap cast to unify curlDown with curlExec"
This reverts commit 74d8377400.
2025-04-22 14:44:57 +07:00
DubbleClick
74d8377400 unwrap cast to unify curlDown with curlExec 2025-04-22 14:36:58 +07:00
DubbleClick
a29992b907 rename retry to retries 2025-04-22 14:34:43 +07:00
Jerry Ma
57097d1275 Fix postgresql macOS 15.4 build bug (#705) 2025-04-22 15:09:31 +08:00
tricker
b21c62c11d Allow CI build to be called by other worklows (#698)
* add workflow_call

* change type choice string

* remove options for type string

* when vendor-mode run composer install

* move vendor-mode composer install

* debug

* move out vendor-mode inputs
2025-04-22 15:09:17 +08:00
DubbleClick
0b3421e3cd rename SPC_RETRY_TIME to SPC_DOWNLOAD_RETRIES to clear up what it's doing
sleep 5 seconds between retries
2025-04-22 12:24:08 +07:00
Jerry Ma
a7adec1341 Add extension ev support (#703)
* Add extension ev support

* Sort config

* Correct ev build arg for windows

* Use static-php mirror of nasm

* Fix windows ev patch

* Oops
2025-04-19 20:39:48 +08:00
crazywhalecc
a236ee3ac3 Prepare for 2.5.2 2025-04-19 16:22:26 +08:00
DubbleClick
d7b9e5a7d4 better matching pattern just in case we forget x) 2025-04-19 16:17:12 +08:00
DubbleClick
3d1738b14b add mirror sources to savannah downloads 2025-04-19 16:14:09 +08:00
Jerry Ma
f0e634a4fa Merge pull request #673 from crazywhalecc/feat/xdebug-dynamic
add xdebug dynamic extension
2025-04-19 16:01:07 +08:00
crazywhalecc
0f5f60e477 Fix gnu static extension build test 2025-04-19 15:18:48 +08:00
crazywhalecc
9fe09f57f6 Add Chinese docs and additional option docs 2025-04-19 15:04:29 +08:00
crazywhalecc
cf24b88bc8 Add final full test 2025-04-19 14:43:51 +08:00
DubbleClick
d34fa0ba4e check for SPC_LIBC 2025-04-18 16:03:49 +07:00
DubbleClick
f40170ee6f update extension tests to support shared extensions 2025-04-18 15:43:54 +07:00
crazywhalecc
2da750d5f9 Fix phpunit, add skip extraction arg for SPCConfigUtil new builder 2025-04-18 14:50:58 +08:00
crazywhalecc
720e700701 Merge branch 'main' into feat/xdebug-dynamic 2025-04-18 14:43:34 +08:00
crazywhalecc
b452f7f32a Add default shared target 2025-04-18 14:38:42 +08:00
crazywhalecc
7bfb8d6f53 Use SPCConfigUtil to generate shared extension env 2025-04-18 14:38:22 +08:00
crazywhalecc
b06db1f920 Add more PHPUnit tests 2025-04-18 14:03:54 +08:00
crazywhalecc
61eafa48ff Add static extension filter 2025-04-18 12:18:20 +08:00
crazywhalecc
8b07b15f6c Merge branch 'main' into feat/xdebug-dynamic 2025-04-18 09:45:19 +08:00
Marc
5e67133495 Merge pull request #693 from crazywhalecc/fix/libheif-with-heic
explicitly state libheif -> --with-heic
2025-04-14 16:25:46 +07:00
Marc
30b740b7f0 Merge pull request #696 from crazywhalecc/remove-extension_dir
don't set EXTENSION_DIR by default
2025-04-14 14:35:09 +07:00
DubbleClick
7501ae4b4d don't set EXTENSION_DIR by default 2025-04-14 11:01:39 +07:00
DubbleClick
4391c30299 explicitly state libheif -> --with-heic 2025-04-12 09:49:00 +07:00
Marc
536641eadd Merge pull request #692
mimalloc v2.2.3 is bugged on musl
2025-04-12 09:32:02 +07:00
DubbleClick
21594cd4c0 mimalloc v2.2.3 is bugged on musl 2025-04-12 09:30:37 +07:00
Jerry Ma
d4b263bc9f Merge pull request #689 from crazywhalecc/fix/extract-source-only
Add extract source only mode for SourceManager
2025-03-31 21:56:51 +08:00
crazywhalecc
4e4eaed123 Add extract source only mode for SourceManager 2025-03-31 16:37:24 +08:00
Jerry Ma
610843398e Merge pull request #681 from crazywhalecc/fix/remove-libgomp
Remove openmp support for imagemagick
2025-03-31 16:17:05 +08:00
Jerry Ma
615e680b9b Update extension-notes.md 2025-03-31 16:15:12 +08:00
DubbleClick
4e67c63808 add note to sharedExtensionCheck 2025-03-31 00:10:27 +07:00
DubbleClick
f556f375ee add zlib... 2025-03-31 00:04:55 +07:00
DubbleClick
f21f833aed add phar?! 2025-03-30 23:58:33 +07:00
DubbleClick
0c6dd7a577 warning for building an extension as both static and shared 2025-03-30 23:50:49 +07:00
Marc
fc4872c5d6 Merge branch 'main' into feat/xdebug-dynamic 2025-03-30 23:39:30 +07:00
DubbleClick
3fe50e9ca3 let tests succeed 2025-03-30 23:37:22 +07:00
DubbleClick
a5e4d6a5ec xdebug and ffi compilable shared, updated notes 2025-03-30 23:36:23 +07:00
Marc
0524129b64 add notes to imagick 2025-03-30 23:34:52 +07:00
Marc
7ce13751a0 Merge pull request #677 from crazywhalecc/dynamic-ext-refactor
Dynamic extension build support for macOS and glibc Linux
2025-03-30 23:23:43 +07:00
Marc
e149ee0d70 Merge branch 'main' into fix/remove-libgomp 2025-03-30 23:05:17 +07:00
Jerry Ma
2f3c71e55a Downloader enhancement (#685)
* Quiet console output for non --debug mode

* Adjust console output and PHPDoc

* Allow locking different arch pre-built content

* Add install-pkg and pre-built test

* Fix typo

* Add debug console output for Downloader

* Add libc version for pre-built content name

* Separate musl-dist and non-musl-dist

* Add additional log output for pre-built finder

* Return default version for musl and musl-wrapper

* Test arm runner

* Re-enable musl version detect

* Add upx cmd for tests

* Remove comment

* Add SPC_DOCKER_DEBUG for gnu docker, remove classmap for alpine docker

* Add glibc build for CI

* Fix PHP warning in test-extensions.php

* Remove redundant suffix, add libc version suffix

* Fix redundant pre-built name calling

* Fix redundant pre-built name calling

* Fix CI wrong runner name

* Fix end of line space

* Full spell for SPC_DOWNLOAD
2025-03-31 00:01:11 +08:00
crazywhalecc
5c04638cb4 Full spell for SPC_DOWNLOAD 2025-03-30 23:27:43 +08:00
crazywhalecc
6dd6d807b6 Fix end of line space 2025-03-30 23:27:23 +08:00
crazywhalecc
237d39f09c Fix CI wrong runner name 2025-03-30 23:27:05 +08:00
DubbleClick
7a2f77193f add imagick extension note 2025-03-30 22:22:22 +07:00
DubbleClick
d21980170e bring back openmp for musl, add TODO to add it back in on glibc 2025-03-30 22:07:56 +07:00
crazywhalecc
7dec34bdfe Fix redundant pre-built name calling 2025-03-30 22:05:50 +08:00
crazywhalecc
62d619b6cd Fix redundant pre-built name calling 2025-03-30 22:05:20 +08:00
crazywhalecc
67afffeb96 Remove redundant suffix, add libc version suffix 2025-03-30 21:59:58 +08:00
crazywhalecc
c58ea0c3bd Fix PHP warning in test-extensions.php 2025-03-30 21:24:46 +08:00
crazywhalecc
acb8cea437 Add glibc build for CI 2025-03-30 21:14:27 +08:00
crazywhalecc
11f0957963 Add SPC_DOCKER_DEBUG for gnu docker, remove classmap for alpine docker 2025-03-30 21:03:40 +08:00
crazywhalecc
2d7c052fd9 Remove comment 2025-03-30 21:03:19 +08:00
crazywhalecc
23bd216cc7 Add upx cmd for tests 2025-03-30 21:03:11 +08:00
crazywhalecc
50cfc5899b Re-enable musl version detect 2025-03-30 20:54:32 +08:00
crazywhalecc
01d3cb4b11 Test arm runner 2025-03-30 20:53:41 +08:00
crazywhalecc
a940200164 Return default version for musl and musl-wrapper 2025-03-30 20:34:57 +08:00
crazywhalecc
4e5c0f0a48 Add additional log output for pre-built finder 2025-03-30 20:21:56 +08:00
crazywhalecc
8e5657eff0 Separate musl-dist and non-musl-dist 2025-03-30 20:20:04 +08:00
crazywhalecc
631a1b5864 Add libc version for pre-built content name 2025-03-30 20:16:41 +08:00
crazywhalecc
67d2ad5511 Add debug console output for Downloader 2025-03-30 19:21:29 +08:00
crazywhalecc
ab4d7fae7d Fix typo 2025-03-30 19:16:01 +08:00
crazywhalecc
0e4a3f5e2b Add install-pkg and pre-built test 2025-03-30 19:09:32 +08:00
crazywhalecc
87c0535624 Allow locking different arch pre-built content 2025-03-30 16:53:14 +08:00
crazywhalecc
5648681ecc Adjust console output and PHPDoc 2025-03-30 15:17:09 +08:00
crazywhalecc
2c0bb1f7ba Quiet console output for non --debug mode 2025-03-30 14:31:29 +08:00
crazywhalecc
16d82212dd Add full tests for imagick extension 2025-03-30 14:03:06 +08:00
crazywhalecc
6ea1d06460 Add bzip2 support for imagick 2025-03-30 14:02:44 +08:00
crazywhalecc
936413a6d9 Define HAVE_OMP_PAUSE_RESOURCE_ALL to 0, add additional file system func 2025-03-30 14:01:31 +08:00
crazywhalecc
88ce2eafab Fix path bug 2025-03-29 23:29:45 +08:00
crazywhalecc
3915c8410b Destroy imagick config for disabling openmp 2025-03-29 23:15:55 +08:00
crazywhalecc
4115e42dc6 Remove openmp support for imagemagick 2025-03-29 22:51:12 +08:00
DubbleClick
48f257f85a unixconfigurearg needs to know if currently building shared or static 2025-03-27 11:12:19 +07:00
DubbleClick
acdec64144 build static and shared at the same time 2025-03-27 09:36:46 +07:00
crazywhalecc
0beb97648a Fix phpstan 2025-03-26 12:41:13 +08:00
crazywhalecc
5564559192 Change --with-shared to --build-shared 2025-03-26 12:39:55 +08:00
crazywhalecc
8cb93bc1fe Add more exception and log 2025-03-26 12:39:15 +08:00
crazywhalecc
ae23b721b3 Fix shared extension does not build bug 2025-03-26 12:38:59 +08:00
crazywhalecc
df06a4bb2c Fix shared extension does not build bug 2025-03-26 12:38:53 +08:00
crazywhalecc
f37110605e Remove dev build target 2025-03-25 16:13:41 +08:00
crazywhalecc
8459754692 Change to --enable-shared --disable-static 2025-03-25 13:29:55 +08:00
crazywhalecc
fc08e5cf23 Remove brotli support for shared build 2025-03-25 00:17:15 +08:00
crazywhalecc
6dec44bdc3 sort-config 2025-03-25 00:17:01 +08:00
crazywhalecc
8cd69b2b70 Support zero extension build result 2025-03-25 00:05:46 +08:00
crazywhalecc
625a03e799 phpstan fix 2025-03-24 23:51:24 +08:00
crazywhalecc
aa4d4db11f Refactor, supports shared extension build now ! 2025-03-24 23:50:12 +08:00
crazywhalecc
76c353e790 Add SPC_DOCKER_DEBUG=yes option for docker build 2025-03-24 22:39:45 +08:00
crazywhalecc
8909b62dc4 Some prerequisites for refactor 2025-03-24 19:25:38 +08:00
crazywhalecc
371a588396 Merge branch 'main' into feat/xdebug-dynamic 2025-03-24 19:11:09 +08:00
tricker
ee54b6d347 Add pgsql extension for Windows <#664> (#665)
* Add pgsql extension for Windows <#664>

* Add pgsql to windows test

* Added pdo_pgsql for windows, added missing header files

* Adjust some configure args and deps

---------

Co-authored-by: crazywhalecc <jesse2061@outlook.com>
2025-03-24 12:47:00 +08:00
tricker
3ba215c35c enable PDO_ODBC and ODBC extension statically (#661)
* enable PDO_ODBC and ODBC extension statically

* fix sorting of ext.json

* add odbc and pdo_odbc extension to tests

* Add full tests, remove pdo_odbc from bulk

* Remove windows support for docs

* Add ODBC and PDO_ODBC extension

* Revert curl static lib

* Add full tests

* Add iconv for macOS

* Add tests

* Fix linux pdo_odbc patch

* Sort config

---------

Co-authored-by: crazywhalecc <jesse2061@outlook.com>
2025-03-23 23:26:36 +08:00
Jerry Ma
161a3924d2 Fix windows micro logo changer bug (illegal realpath) (#675) 2025-03-23 22:55:25 +08:00
Jerry Ma
7b6fae6d92 Fix windows ssl bug for curl (#674) 2025-03-23 22:33:26 +08:00
Marc
71b52e58b2 Merge branch 'main' into feat/xdebug-dynamic 2025-03-23 10:13:56 +01:00
Marc
d0a66ab16b Merge pull request #663 from crazywhalecc/feat/mimalloc
Add mimalloc support for macOS and Linux
2025-03-23 10:12:08 +01:00
DubbleClick
9d75265e25 fix crash on windoof 2025-03-23 16:11:03 +07:00
DubbleClick
744e066d5f Merge remote-tracking branch 'origin/main' into feat/mimalloc 2025-03-23 15:38:31 +07:00
DubbleClick
1791b443bc add xdebug dynamic extension 2025-03-23 15:35:25 +07:00
Marc
e850df505c Merge pull request #671 from crazywhalecc/fix/phpize
fix phpize using wrong paths
2025-03-23 07:14:23 +01:00
DubbleClick
918223e7da fix phpize using wrong paths 2025-03-23 12:40:50 +07:00
Marc Henderkes
1552d992df fix typo in gettext 2025-03-21 07:41:19 +01:00
Marc
f0a895691b Merge pull request #670 from crazywhalecc/fix/gettext-typo
fix typo in gettext
2025-03-21 07:38:48 +01:00
Marc Henderkes
1f7c805da4 fix typo in gettext 2025-03-21 07:38:14 +01:00
crazywhalecc
1ad33556e9 Add full tests 2025-03-20 16:11:45 +08:00
crazywhalecc
6b5e83b98e Sync Chinese docs 2025-03-20 16:06:33 +08:00
Marc Henderkes
6fb9c2df3b test macos 2025-03-20 08:46:54 +01:00
Marc Henderkes
1b29803ed2 docs 2025-03-20 08:00:35 +01:00
Marc Henderkes
3477857584 mimalloc on mac (untested) 2025-03-20 07:41:13 +01:00
Marc Henderkes
0ce2c894e9 juggle mimalloc.o to the beginning 2025-03-20 07:27:38 +01:00
Marc Henderkes
92470a35da replace allocator with mimalloc (works for cli/fpm, embed needs to be tested) 2025-03-20 06:22:11 +01:00
Marc Henderkes
6447fec028 mimalloc WIP 2025-03-20 04:36:46 +01:00
Jerry Ma
0bc143cac3 Fix windows curl build >= 8.3 (#660)
* Test windows curl

* Test windows curl

* Fix windows curl build for PHP 8.3 and 8.4
2025-03-20 09:22:10 +08:00
Marc
8a4ba7a876 fix libffi compiling without -fPIC because of missing env (#657)
Co-authored-by: Marc Henderkes <m.henderkes@pc-college.de>
2025-03-19 14:49:25 +08:00
Jerry Ma
146a4d334b Build freetype using CMake instead (#658) 2025-03-19 14:49:12 +08:00
Marc
d86b7c4cec fix freetype lib build (#654)
Co-authored-by: Marc Henderkes <m.henderkes@pc-college.de>
2025-03-19 09:21:23 +08:00
Jerry Ma
b1931059a5 Add missing ext source when downloading pre-built grpc (#652)
* Add missing ext source when downloading pre-built grpc

* Add tests
2025-03-15 01:30:00 +08:00
Jerry Ma
a2476690c2 Add sodium extension support for Windows (#651)
* Add sodium extension support for Windows

* cs-fix
2025-03-15 01:29:44 +08:00
Jerry Ma
99be7b078b Add conflict message when building protobuf and grpc (#653) 2025-03-14 23:39:31 +08:00
Jerry Ma
8925e97e62 Fix windows setup-runtime php download link (#650) 2025-03-14 23:37:15 +08:00
Jerry Ma
4558204962 Fix libavif build on VS2019 syntax error (#649)
* Test old source of libavif

* Test old source of libavif

* Fix libavif 1.2.0 bug
2025-03-14 23:37:01 +08:00
Jerry Ma
b4f3657323 Remove SPC_NO_MUSL_PATH, remove --libc, use SPC_LIBC instead (#642)
* Remove SPC_NO_MUSL_PATH, remove --libc, use SPC_LIBC instead

* Fix tests

* Internally use GNU_ARCH for unified

* Update EXTENSION_DIR comments for env.ini

* Remove redundant -fPIC cflags in curl
2025-03-14 18:22:50 +08:00
Marc
91a3a01c39 fix libxslt license file path (#646)
Co-authored-by: Marc Henderkes <m.henderkes@pc-college.de>
2025-03-14 15:49:38 +08:00
Jerry Ma
4cc985a39b Fix gettext on locale bug (#634)
* Fix gettext locale sanity check failure bug

* Fix phpstan

* Add tests

* Add additional attr build configure args

* Remove windows test

* Fix attr configure arg

* Fix attr configure bug on gnu docker and alpine docker

* Add gettext-devel for doctor

* weird change for gnu docker container (#643)

Co-authored-by: Marc Henderkes <m.henderkes@pc-college.de>

---------

Co-authored-by: Marc <m@pyc.ac>
Co-authored-by: Marc Henderkes <m.henderkes@pc-college.de>
2025-03-14 15:25:51 +08:00
Jerry Ma
39a66daf04 Fix imagick patch newer than 30800 (#641) 2025-03-14 10:57:33 +08:00
Marc
2681a88488 don't require libacl and attr - use --with-libs='libacl' if you build… (#635)
* don't require libacl and attr - use --with-libs='libacl' if you build fpm with acl support

* don't filter out libacl and libattr

* suggest attr instead of requiring it

* disable nls if libiconv is not built

* suggest libiconv when using attr/libacl

* wrong directive...

* gettext (libintl) for acl/attr

* remove suggestions and build acl and attr without nls

---------

Co-authored-by: Marc Henderkes <m.henderkes@pc-college.de>
2025-03-13 18:23:36 +08:00
Jerry Ma
e1162606f5 Update automake on gnu docker to fix attr build bug (#636) 2025-03-13 14:57:37 +08:00
Jerry Ma
c6d4934dd6 Fix gmssl and openssl duplicate symbol (#632)
* Fix gmssl and openssl duplicate symbol

* Add tests
2025-03-13 14:18:27 +08:00
Marc
21265cd561 fix embed sapi being unusable to build extensions (#628)
Co-authored-by: Marc Henderkes <m.henderkes@pc-college.de>
2025-03-13 13:44:02 +08:00
Jerry Ma
a6b843f4dd Update docs for FFI and dynamic loading extensions (#629) 2025-03-13 11:56:40 +08:00
Jerry Ma
d643051759 Update musl-wrapper version to 1.2.5 and apply CVE patch (#627) 2025-03-13 11:11:58 +08:00
Jerry Ma
58eafe5100 Merge pull request #622 from DubbleClick/libacl
bring back pr for libacl
2025-03-12 23:02:04 +08:00
Marc
74edcb7d6f Update LibraryBase.php
newline
2025-03-12 20:07:04 +07:00
Marc
e7bac8f78d Update LibraryBase.php
rectify typo
2025-03-12 20:05:05 +07:00
Marc Henderkes
5caf5b7694 check for libacl in fewer places 2025-03-12 09:19:01 +01:00
Marc Henderkes
76ac57edf4 download attr and libacl on linux 2025-03-12 09:07:26 +01:00
Marc Henderkes
d15b387bea don't require libacl and attr for non fpm compilation 2025-03-12 08:59:47 +01:00
Marc Henderkes
b534cdce11 remove line 2025-03-11 08:53:31 +01:00
Marc Henderkes
f246125677 requested changes 2025-03-11 07:44:31 +01:00
Marc Henderkes
2c644d5c18 cs fix 2025-03-11 07:15:07 +01:00
crazywhalecc
ec3c0dc934 Add SPC_CMD_VAR_PHP_EMBED_TYPE for embed building in glibc mode 2025-03-11 07:08:44 +01:00
crazywhalecc
09c0e43501 Add gnu based static binary support 2025-03-11 07:08:00 +01:00
Marc Henderkes
878e17ddb4 remove attr and libacl from macos 2025-03-11 06:59:43 +01:00
Marc Henderkes
c52ab62fa6 arch c flags 2025-03-11 06:59:42 +01:00
Marc Henderkes
40ea306008 try something with static 2025-03-11 06:59:42 +01:00
Marc Henderkes
be3d68cebe patch the makefile before make (remove -lacl from FPM_EXTRA_LIBS) 2025-03-11 06:59:41 +01:00
Marc Henderkes
4e32ff47df patch libacl WIP 2025-03-11 06:59:41 +01:00
Marc Henderkes
c6552f6800 add patch for attr on alpine 2025-03-11 06:59:40 +01:00
Marc Henderkes
511fd0e301 add required packages for autopoint to spc doctor 2025-03-11 06:59:39 +01:00
Marc Henderkes
77bbc7fcaa add libacl and attr to macos, not sure if they build 2025-03-11 06:59:39 +01:00
Marc Henderkes
53f82d286c split requirements into unix and windows 2025-03-11 06:59:38 +01:00
Marc Henderkes
bed40c3d05 add libacl to php requirements 2025-03-11 06:59:38 +01:00
Marc Henderkes
29a0f2facb revert to SystemUtils::makeEnvVarString 2025-03-11 06:59:37 +01:00
Marc Henderkes
4bc4c2ff05 revert EXTRA_LDFLAGS_PROGRAM patch, TODO: patchBeforeMake and remove -lacl from the libtool command 2025-03-11 06:59:36 +01:00
Marc Henderkes
460699c48c add (lib)attr and libacl as optional libraries
when libacl is built and --enable-fpm is used, also enable --with-fpm-acl
2025-03-11 06:59:33 +01:00
crazywhalecc
89e8c152dc Emegency fix env.ini 2025-03-11 13:33:03 +08:00
Jerry Ma
5caaa4d1d4 Merge pull request #592 from crazywhalecc/feat/gnu-static
[feat] Add gnu based static binary support
2025-03-11 11:49:55 +08:00
crazywhalecc
939fd88789 Merge branch 'main' into feat/gnu-static 2025-03-11 11:33:45 +08:00
Marc
067b02f6d7 update php default to 8.4 (#621)
* update php defaul to 8.4

* update config

* Update README.md

---------

Co-authored-by: Marc Henderkes <m.henderkes@pc-college.de>
2025-03-10 16:20:22 +08:00
crazywhalecc
2afd39fbf1 Fix test-extensions 2025-03-10 16:19:24 +08:00
crazywhalecc
1ce1c326b2 Add SPC_CMD_VAR_PHP_EMBED_TYPE for embed building in glibc mode 2025-03-10 16:15:47 +08:00
crazywhalecc
b6324fd71e Fix syntax on Dockerfile 2025-03-10 15:54:43 +08:00
crazywhalecc
7e462d6625 Update spc-gnu-docker with gcc10, add build-static-frankenphp 2025-03-10 00:39:59 +08:00
crazywhalecc
2a9cd436b6 Support -fPIC and -fPIE for most libs and PHP 2025-03-10 00:39:20 +08:00
crazywhalecc
4eeb48cdc2 Update gnu-docker and fix icu build on glibc 2025-03-09 20:30:22 +08:00
crazywhalecc
23bfad6f87 Merge branch 'main' into feat/gnu-static
# Conflicts:
#	src/SPC/builder/linux/LinuxBuilder.php
2025-03-09 17:44:13 +08:00
Jerry Ma
36dc18012a Update something-want-to-know.md 2025-03-08 17:12:29 +08:00
Jerry Ma
d30d1fc447 Add php and lib-base as special libraries to add dependencies to the root node (#618)
* Remove E_STRICT

* Add lib-base and php as special libs

* Remove debug code

* Fix phpunit with new config structure

* Fix phpunit test and fix license dumper bug for new type of lib

* Add missing lib type filter for windows builder
2025-03-08 14:29:44 +08:00
Jerry Ma
15c7e41501 Update pull_request_template.md 2025-03-08 10:23:10 +08:00
crazywhalecc
b6243d8478 Fix vitepress-deploy.yml in minimal PHP version 2025-03-08 10:04:59 +08:00
Jerry Ma
cf30418be9 Remove deprecated args for PHP 8.4 (#616)
* Remove deprecated args for PHP 8.4

* Add tests

* Use nts for testing

* Test

* memcache still uses `--with-zlib-dir`
2025-03-07 18:25:19 +08:00
Marc
a95d034e98 fix SPC_NO_MUSL_PATH not working in .env.ini (#612)
* fix SPC_NO_MUSL_PATH not working in .env.ini

* use filter var instead of assuming var was defined in .env.ini

* CS fix and composer update

* update composer.lock

* fix LIBRARY_PATH and LD_LIBRARY_PATH

* Revert composer lock and cs-fixer options

* filter validate boolean

---------

Co-authored-by: Marc Henderkes <m.henderkes@pc-college.de>
Co-authored-by: crazywhalecc <jesse2061@outlook.com>
2025-03-07 18:15:11 +08:00
Jerry Ma
29ea46bd17 Switch static-php-cli to support PHP 8.3 and 8.4 only (#615)
* Update spc self to PHP 8.4 only

* Update workflows

* Fix test-extensions, adjust docs order

* Fix cs-fix and phpunit

* Add PHP_CS_FIXER_IGNORE_ENV

* Add compatibility for PHP 8.3

* Change version description in README, adjust composer.json PHP version limit

* Switch PHP to 8.4 in spc-alpine-docker

* Add deprecation notice
2025-03-07 18:06:32 +08:00
Jerry Ma
8a17e2384e Update feature_request.md 2025-03-07 13:10:06 +08:00
Jerry Ma
60dbb18504 Update bug_report.md 2025-03-07 13:09:53 +08:00
Jerry Ma
5f53b34fae Update issue templates 2025-03-07 13:08:42 +08:00
Alexander Over
6b227d88ac Add command to dump required PHP extensions based on vendor/composer/… (#599)
* Add command to dump required PHP extensions based on vendor/composer/installed.json, composer.lock, composer.json (in this order)

* remove unused use

* missing translation

* Adjust dump-extensions

* Add docs for dump-extension command

---------

Co-authored-by: crazywhalecc <jesse2061@outlook.com>
2025-03-07 10:46:07 +08:00
Jerry Ma
34934368a2 Ignore any ini files when sanity check (#609) 2025-02-16 01:30:08 +08:00
Klaas Skelte van der Werf
15af034b34 Report why the sanity check for the cli target failed (#605) 2025-02-11 10:34:43 +08:00
Jerry Ma
1f281cd376 Fix gettext multithread segment fault bug (#603)
* Fix gettext included with multithreaded bug

* Change --enable-zts to BuildCommand
2025-02-10 20:28:00 +08:00
Jerry Ma
95d741496e Fix windows curl build (using cmake) (#600) 2025-02-06 22:59:02 +08:00
Alexander Over
21de1a2291 add opentelemetry extension support (#593)
* add opentelemetry extension support

* config sort

* cleanup build args

* Update docs

* Adjust custom extension overrides for opentelemetry

* Add tests

* Update README.md and remove windows limitation

* Fix windows static build for opentelemetry

---------

Co-authored-by: crazywhalecc <jesse2061@outlook.com>
2025-02-06 12:27:43 +08:00
crazywhalecc
d047176fc9 Update docs 2025-02-06 11:25:22 +08:00
crazywhalecc
7b1e2fb89e Update docs 2025-02-04 17:34:53 +08:00
crazywhalecc
cb73222e21 Fix embed sanity check on glibc mode 2025-02-04 17:34:47 +08:00
crazywhalecc
9c878ce613 Remove env.custom.ini 2025-02-04 17:24:28 +08:00
crazywhalecc
4beea4ad39 Add issue content 2025-02-04 17:23:47 +08:00
crazywhalecc
0aab10ba31 Add docs for gnu static build 2025-02-04 17:20:27 +08:00
crazywhalecc
daa6196afc cs-fix 2025-01-28 19:41:06 +08:00
crazywhalecc
75ee69b07d Add gnu based static binary support 2025-01-28 19:37:50 +08:00
Jerry Ma
f19e90afd7 Add extension dio support (#590)
* Add extension dio support

* cs-fix
2025-01-25 17:43:12 +08:00
Jerry Ma
36b4ef306e Fix libtiff dependencies, avoid using system libraries (#588)
* Remove tmate debugger

* Bump version to 2.4.4

* Fix libtiff dependencies may wrongly added

* Add matrix tests

* Add tmate debug

* Disable libdeflate for libtiff

* Remove ssh debugger
2025-01-25 16:15:53 +08:00
crazywhalecc
4bd3a2ae25 Add ssh debug 2025-01-25 12:20:54 +08:00
crazywhalecc
dd647c53ec Add doctor for build-unix CI 2025-01-25 11:35:47 +08:00
crazywhalecc
0c0d16bbb3 Try new build CI 2025-01-25 11:30:59 +08:00
crazywhalecc
c665a18b79 Try new build CI 2025-01-25 11:29:18 +08:00
crazywhalecc
16d448b97c Try new build CI 2025-01-25 11:09:13 +08:00
crazywhalecc
27ccc1189f Try new build CI 2025-01-25 10:59:44 +08:00
Jerry Ma
eecebbcd4d Fix x86_64 macOS CI invalid options 2025-01-25 09:48:15 +08:00
Jerry Ma
2ca5ad075b Add legacy CentOS distro support (#585) 2025-01-13 20:42:09 +08:00
Jean-François Lépine
20dad4cdb3 Merge pull request #583 from Halleck45/support_ast_extension
Support AST extension
2025-01-13 11:11:32 +08:00
crazywhalecc
a3e0ad6b9f Add PHP 8.4 support for cli-generator 2025-01-13 09:33:25 +08:00
Jerry Ma
4b16631d45 Fix openssl missing cert bug for Linux & macOS (#581)
* Fix openssl missing cert bug for linux

* Fix openssl missing cert bug for macOS
2024-12-24 22:06:31 +08:00
Jerry Ma
944f4af914 Update FUNDING.yml 2024-12-23 11:05:21 +08:00
Jerry Ma
4865c1c124 Update README.md 2024-12-23 11:04:46 +08:00
Jerry Ma
78aea56de4 Add aom patch for alpine linux (#579) 2024-12-20 12:18:34 +08:00
Jerry Ma
adbe2e80f3 Update ConsoleApplication.php 2024-12-19 12:28:49 +08:00
Jerry Ma
192c8cde87 Add libaom, libde265, libheif support, for imagick AVIF format support (#575)
* Add libaom, libde265, libheif support, for imagick AVIF format support

* Fix aom optimization

* Fix aom build command

* Fix libheif build command

* Fix libheif build

* cs fix
2024-12-19 12:23:39 +08:00
Adam
d4ec366c5f Update SQLite to 3.45 (#574)
* Force SQLite 3.45 build from source.

* Update SQLite to 3.45.

* Sort config.

* Minimize changes.
2024-12-15 20:03:48 +08:00
Jerry Ma
bad28fa263 Merge pull request #256 from crazywhalecc/ext/rdkafka
Add extension rdkafka support
2024-12-13 16:23:21 +08:00
crazywhalecc
985cd6781e Add macOS x86_64 test 2024-12-13 15:36:51 +08:00
crazywhalecc
44dcc830f4 Add rdkafka tests 2024-12-13 15:23:55 +08:00
crazywhalecc
10ef4c0d3b Adjust config 2024-12-13 15:22:54 +08:00
crazywhalecc
d0fbc5ab2d Merge branch 'main' into ext/rdkafka
# Conflicts:
#	src/globals/test-extensions.php
2024-12-13 15:12:05 +08:00
crazywhalecc
1bc7bc3421 Addd embed docs 2024-12-13 15:05:44 +08:00
crazywhalecc
8b9b70704a Fix test 2024-12-13 15:05:44 +08:00
crazywhalecc
804020210d Fix test 2024-12-13 15:05:44 +08:00
crazywhalecc
5c51305978 Add embed build tests 2024-12-13 15:05:44 +08:00
crazywhalecc
43cc9d0ba3 Add command, bump version 2024-12-13 15:05:44 +08:00
crazywhalecc
52869218e0 Fix grpc redundant static lib 2024-12-13 15:05:44 +08:00
crazywhalecc
82e11e52dd Fix gettext build 2024-12-13 15:05:44 +08:00
crazywhalecc
955c367a47 Fix pgsql embed builds 2024-12-13 15:05:44 +08:00
crazywhalecc
a613e9a84f Add spc-config command 2024-12-13 15:05:44 +08:00
crazywhalecc
c4b9660cd7 Add embed sanity check 2024-12-13 15:05:44 +08:00
crazywhalecc
f433866671 Add embed spc-config output instead of php-config 2024-12-13 15:05:44 +08:00
crazywhalecc
fdc4a907c7 Fix pgsql missing symbol 2024-12-09 21:57:35 +08:00
Jerry Ma
cf37e16e38 Update build-macos-x86_64.yml 2024-12-06 13:13:50 +08:00
Jerry Ma
2aa42123f6 Update build-macos-x86_64.yml 2024-12-06 13:07:52 +08:00
crazywhalecc
bc7dba6125 Fix parallel config.m4 2024-12-05 18:51:57 +08:00
crazywhalecc
3ce24da15c Fix patch point tests 2024-12-05 18:51:57 +08:00
crazywhalecc
3659e20b0d Fix patch point tests 2024-12-05 18:51:57 +08:00
crazywhalecc
a90a57ffab Add extension configure tests 2024-12-05 18:51:57 +08:00
crazywhalecc
45bdb6a66b Add extension configure tests 2024-12-05 18:51:57 +08:00
crazywhalecc
64258e3513 Fix pgsql linux builds with PHP 8.4 2024-12-05 18:30:19 +08:00
crazywhalecc
fe72b800c6 Add pgsql tests 2024-12-05 13:48:27 +08:00
crazywhalecc
39bc44322e cs-fix 2024-12-05 13:48:27 +08:00
crazywhalecc
1a0e6ee717 cs-fix, add tests 2024-12-05 13:48:27 +08:00
crazywhalecc
cc088b6382 Let grpc use openssl 2024-12-05 13:48:27 +08:00
crazywhalecc
b9f709c23d Change ext.json for pgsql 2024-12-05 13:48:27 +08:00
crazywhalecc
05b602d38c Fix pgsql with PHP 8.4 embed missing libs bug 2024-12-05 13:48:27 +08:00
Simon Hamp
a8a071de1a Add missing step 2024-12-01 16:11:05 +08:00
crazywhalecc
391555b1f5 Update docs 2024-11-23 11:55:29 +08:00
crazywhalecc
62b0bf8eca Remove PHP 8.1 libxml2 patch 2024-11-23 11:55:29 +08:00
crazywhalecc
1ab464431f Update workflows, add php 8.4 2024-11-23 11:55:29 +08:00
crazywhalecc
f04b54bc2a Update docs 2024-11-23 11:55:29 +08:00
crazywhalecc
e1652a4b36 Sort config 2024-11-23 11:55:29 +08:00
crazywhalecc
8c586fe7d9 Remove RC version for PHP 8.4 2024-11-23 11:55:29 +08:00
crazywhalecc
d2c929cb72 Update to RC4 2024-11-23 11:55:29 +08:00
crazywhalecc
b9584e48ac Fix FileSystem remove soft link directory 2024-11-23 11:55:29 +08:00
crazywhalecc
e269d1ba00 Fix gettext sanity check 2024-11-23 11:55:29 +08:00
crazywhalecc
87750c462f Do not cache PHP 2024-11-23 11:55:29 +08:00
crazywhalecc
219edb6b59 Add extension matrix tests 2024-11-23 11:55:29 +08:00
crazywhalecc
4f87e01bff Use similar optimize flags for compiling PHP (bump major ver) 2024-11-23 11:55:29 +08:00
crazywhalecc
5f69e957ac Add 8.1-8.3 test 2024-11-23 11:55:29 +08:00
crazywhalecc
756bdbf92f Fix imagick build for PHP 8.4 2024-11-23 11:55:29 +08:00
crazywhalecc
610fb66b0c Remove --with-zlib-dir that has been removed in 8.4 2024-11-23 11:55:29 +08:00
crazywhalecc
1186bac49c Update README 2024-11-23 11:55:29 +08:00
crazywhalecc
f6fe902c76 Fix sodium build, remove build patches 2024-11-23 11:55:29 +08:00
crazywhalecc
f984516a67 Change swoole source to git master instead of pecl (6.0 has not been released) 2024-11-23 11:55:29 +08:00
crazywhalecc
0d2f6456fb Change default download php version to 8.3 2024-11-23 11:55:29 +08:00
crazywhalecc
2fc61d8e5c Remove 8.1-8.3 tests 2024-11-23 11:55:29 +08:00
crazywhalecc
12b119e235 Fix display PHP version when using archive 2024-11-23 11:55:29 +08:00
crazywhalecc
6fa5f75963 Fix imap library build in macOS Sequoia 2024-11-23 11:55:29 +08:00
crazywhalecc
1fa5514c57 8.4 download imap separately, compatible with 8.1-8.3 2024-11-23 11:55:29 +08:00
crazywhalecc
73e3480bdf Add 8.4 support for switch-php-version command 2024-11-23 11:55:29 +08:00
crazywhalecc
ddafdf8987 Add PHP 8.4 support (testing) 2024-11-23 11:55:29 +08:00
crazywhalecc
2bfc5e1d74 Add grpc support for macOS and Linux 2024-11-10 10:42:04 +08:00
yinheli
3c4d47d072 feat: improve downloader retry (#558)
- Refactored to remove duplicate retry expressions by utilizing the getRetryTime() method.
- Fixed a typo in the log message.
2024-11-09 10:50:08 +08:00
Kévin Dunglas
0fb7784a20 feat: better default for the php.ini path (#553)
* update

* update

* fix

* Adjust docs

* Adjust docs

* Add config-file-scan-dir for WindowsBuilder

* Bump version

---------

Co-authored-by: crazywhalecc <jesse2061@outlook.com>
2024-10-18 20:46:00 +08:00
Jerry Ma
ef18264de3 Update FUNDING.yml 2024-10-17 22:03:43 +08:00
Jerry Ma
e752874f22 Update FUNDING.yml 2024-10-17 21:56:56 +08:00
Andrea Esu
ec584bf704 Add option to manually specify config file path (#511)
* Add Config File Path option

* Fix Manual

* quotation marks changes

* php-cs-fixer

* Remove windows config file path option

* Add macOS config file path option

* Add chinese docs

---------

Co-authored-by: andrea.esu <KjsnM@@1_-2!>
Co-authored-by: crazywhalecc <jesse2061@outlook.com>
2024-10-12 16:41:45 +08:00
crazywhalecc
ca8ec70c40 Update docs vue components 2024-10-05 15:34:10 +08:00
crazywhalecc
3c802119ed cs-fix and fix tests 2024-10-05 14:14:36 +08:00
crazywhalecc
58095a61c8 Update redis with latest release 2024-10-05 14:14:36 +08:00
crazywhalecc
774919e03c Add missing filelist 2024-10-05 14:14:36 +08:00
crazywhalecc
566f6980ca cs-fix 2024-10-05 14:14:36 +08:00
crazywhalecc
648c43cc7f Add allowed commands 2024-10-05 14:14:36 +08:00
crazywhalecc
357dfc53c9 Add full Downloader tests 2024-10-05 14:14:36 +08:00
crazywhalecc
948b55026c Fix getPHPVersionID test 2024-10-05 14:14:36 +08:00
crazywhalecc
d6bea6295e Add sanity check for pack:libs 2024-10-05 14:14:36 +08:00
crazywhalecc
83ab430b9a Adjust windows build CI 2024-10-05 14:14:36 +08:00
crazywhalecc
c09bf1e878 Adjust caches 2024-10-05 14:14:36 +08:00
crazywhalecc
ecb17cc4c9 Final tests 2024-10-05 14:14:36 +08:00
crazywhalecc
7d56822e91 Final tests 2024-10-05 14:14:36 +08:00
crazywhalecc
850e6afbd0 Eval 2024-10-05 14:14:36 +08:00
crazywhalecc
09c36844e6 Eval 2024-10-05 14:14:36 +08:00
crazywhalecc
bc2fe576a7 Fix tests CI quotes 2024-10-05 14:14:36 +08:00
crazywhalecc
7facbc7a08 Fix tests CI 2024-10-05 14:14:36 +08:00
crazywhalecc
85df4731d1 Fix tests CI 2024-10-05 14:14:36 +08:00
crazywhalecc
d93c8fcb45 Add full tests 2024-10-05 14:14:36 +08:00
crazywhalecc
67a31ef4fa Add full tests 2024-10-05 14:14:36 +08:00
crazywhalecc
5349ebe73f Fix linux concurrency build 2024-10-05 14:14:36 +08:00
crazywhalecc
f067a510b7 Fix composer phpunit version problem 2024-10-05 14:14:36 +08:00
crazywhalecc
54cf6fe692 Fix curl hook test 2024-10-05 14:14:36 +08:00
crazywhalecc
3bdeafa6b6 Fix curl hook test 2024-10-05 14:14:36 +08:00
crazywhalecc
3f55d0cec3 Update composer.lock 2024-10-05 14:14:36 +08:00
crazywhalecc
ee8d9eeee9 Update env-vars docs 2024-10-05 14:14:36 +08:00
crazywhalecc
732fa06abb Add new tests, remove redundant code 2024-10-05 14:14:36 +08:00
crazywhalecc
c800e3b93a Remove proveExts 2024-10-05 14:14:36 +08:00
crazywhalecc
0568d4b4c8 Ignore env that already set in shell scripts 2024-10-05 14:14:36 +08:00
crazywhalecc
7325368a4f Add ignore musl for phpunit test 2024-10-05 14:14:36 +08:00
crazywhalecc
dc9d6703bc Fix phpstan, add more phpunit test 2024-10-05 14:14:36 +08:00
crazywhalecc
c841ef5b9a Fix missing constant for PHP_SDK_PATH 2024-10-05 14:14:36 +08:00
crazywhalecc
1ce3c1bc47 Use CPU_COUNT instead of SPC_CONCURRENCY 2024-10-05 14:14:36 +08:00
crazywhalecc
25850ef8eb Fix LD_LIBRARY_PATH 2024-10-05 14:14:36 +08:00
crazywhalecc
8f80548739 Fix LD_LIBRARY_PATH 2024-10-05 14:14:36 +08:00
crazywhalecc
4d551f3994 Add SPC_NO_MUSL_PATH env var 2024-10-05 14:14:36 +08:00
crazywhalecc
cfda286532 Add pre-built test 2024-10-05 14:14:36 +08:00
crazywhalecc
24aac06051 Overwrite compile variables for musl wrapper build 2024-10-05 14:14:36 +08:00
crazywhalecc
6af0a85dce Add debug messages for doctor 2024-10-05 14:14:36 +08:00
crazywhalecc
4e88dba630 Separate env to env.ini file 2024-10-05 14:14:36 +08:00
Jerry Ma
2f320507ae Fix windows xz build libs (#550) 2024-10-04 22:09:06 +08:00
Jerry Ma
b62963489a Add optional workflow (#548)
* Add optional workflow

* Add optional workflow
2024-09-29 15:24:33 +08:00
Gabe
5383cf7c25 Fix typo in README.md (#546) 2024-09-27 19:00:54 +08:00
crazywhalecc
c840165fa8 Add tests for rdkafka 2024-09-23 16:52:01 +08:00
crazywhalecc
4e95d969e3 Merge branch 'refs/heads/main' into ext/rdkafka
# Conflicts:
#	config/source.json
2024-09-23 16:25:59 +08:00
daddeffe
330dd2bfc6 Added optional zlib and disabled two extension (#545)
asd
2024-09-23 16:19:40 +08:00
Jerry Ma
29efc2c5a5 Add extension gmssl support (#544)
* Add extension gmssl support

* cs-fix

* Add framework for gmssl
2024-09-20 12:32:31 +08:00
Jerry Ma
e35836943e Update FUNDING.yml 2024-09-19 21:27:24 +08:00
Jerry Ma
2beecee219 Add extension msgpack support (#543) 2024-09-17 22:34:57 +08:00
Jerry Ma
ad098d085e Update redis to 6.0.2, add alternative license file searcher (#539)
* Update redis to 6.0.2, add alternative license file searcher

* Update docs about source module
2024-09-09 17:41:29 +08:00
Jerry Ma
c55ccf242b Use static-php/phpmicro temporarily (#536) 2024-09-06 13:38:54 +08:00
Jerry Ma
b45081dd9c Add --custom-git (-G) option for download command (#534)
* Add --custom-git (-G) option for download command

* Update manual-build.md

* Update manual-build.md

* Update DownloadCommand.php
2024-09-05 00:00:58 +08:00
Jerry Ma
326d682e44 Make opcache patch independent (#533)
* Make opcache patch independent

* Restore tests.yml

* Workaround for older php
2024-09-05 00:00:36 +08:00
crazywhalecc
b354e017ba Add switch-php-version specific patch version support 2024-09-04 16:41:53 +08:00
crazywhalecc
3ce302d0e6 Use old version 2024-09-04 16:35:39 +08:00
crazywhalecc
a38f9e6344 Update docs 2024-09-04 16:35:39 +08:00
crazywhalecc
4e08295cea Add patch version support for downloading php-src 2024-09-04 16:35:39 +08:00
crazywhalecc
73654e5984 Add dependency map generator and related docs 2024-08-21 11:53:26 +08:00
crazywhalecc
077da6f6a4 Correct snappy ext-suggest to ext-suggests 2024-08-21 11:53:26 +08:00
crazywhalecc
0665af2537 Add SPC_MICRO_PATCHES env var 2024-08-20 12:23:12 +08:00
crazywhalecc
d5832c22e3 Change to deploy OSS 2024-08-18 15:50:08 +08:00
crazywhalecc
d231364c1a Add tests 2024-08-18 15:50:08 +08:00
crazywhalecc
fdb5c6aa1d Fix alpine edge build with PHP 7.4 and 8.0 2024-08-18 15:50:08 +08:00
crazywhalecc
47ba881870 Fix alpine edge build imap library bug 2024-08-18 15:50:08 +08:00
crazywhalecc
9fd0508417 Fix swoole-hook-sqlite with PHP 8.3 on macOS arm64 bug 2024-08-18 15:50:08 +08:00
crazywhalecc
c0b52fc2d1 Add extension rdkafka support 2023-11-05 17:09:48 +08:00
498 changed files with 26828 additions and 9305 deletions

16
.editorconfig Normal file
View File

@@ -0,0 +1,16 @@
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false
indent_size = 2
[*.{yml,yaml,vue,ts}]
indent_size = 2

6
.github/FUNDING.yml vendored
View File

@@ -1,9 +1,9 @@
# These are supported funding model platforms
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
github: [crazywhalecc]# Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
# ko_fi: crazywhalecc # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
@@ -11,5 +11,5 @@ issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
# noinspection YAMLSchemaValidation
buy_me_a_coffee: crazywhalecc
buy_me_a_coffee: # crazywhalecc
custom: 'https://github.com/crazywhalecc/crazywhalecc/blob/master/FUNDING.md' # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

17
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@@ -0,0 +1,17 @@
---
name: Bug report
about: Build PHP or library failed, download failed, doesn't seem to work...
title: ''
labels: bug
body:
- type: textarea
id: what-happened
attributes:
label: What happened?
description: |
Please tell us what you do, what you get and what you expected.
Provide with some step-by-step instructions to reproduce the issue.
If possible, attach a screenshot or log files in ./log directory.
validations:
required: true
---

View File

@@ -0,0 +1,8 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: new feature
assignees: crazywhalecc
---

View File

@@ -0,0 +1,10 @@
---
name: Something want to know
about: Describe your question about static-php, we will reply ASAP
title: ''
labels: question
assignees: ''
---

View File

@@ -7,6 +7,11 @@
> If your PR involves the changes mentioned below and completed the action, please tick the corresponding option.
> If a modification is not involved, please skip it directly.
- [ ] If it's an extension or dependency update, make sure adding related extensions in `src/global/test-extensions.php`.
- [ ] If you changed the behavior of static-php-cli, update docs in `./docs/`.
- [ ] If you updated `config/xxx.json` content, run `bin/spc dev:sort-config xxx`.
- If you modified `*.php` or `*.json`, run them locally to ensure your changes are valid:
- [ ] `composer cs-fix`
- [ ] `composer analyse`
- [ ] `composer test`
- [ ] `bin/spc dev:sort-config`
- If it's an extension or dependency update, please ensure the following:
- [ ] Add your test combination to `src/globals/test-extensions.php`.
- [ ] If adding new or fixing bugs, add commit message containing `extension test` or `test extensions` to trigger full test suite.

View File

@@ -1,130 +0,0 @@
name: CI on arm linux
on:
workflow_dispatch:
inputs:
operating-system:
required: true
description: Compile target arch (Linux only)
type: choice
options:
- aarch64
version:
required: true
description: php version to compile
default: '8.2'
type: choice
options:
- '8.3'
- '8.2'
- '8.1'
- '8.0'
- '7.4'
build-cli:
description: build cli binary
default: true
type: boolean
build-micro:
description: build phpmicro binary
type: boolean
build-fpm:
description: build fpm binary
type: boolean
extensions:
description: extensions to compile (comma separated)
required: true
type: string
prefer-pre-built:
description: prefer pre-built binaries (reduce build time)
type: boolean
default: true
debug:
description: enable debug logs
type: boolean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
build:
name: build ${{ inputs.version }} on ${{ inputs.operating-system }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Cache composer dependencies
- id: cache-composer-deps
uses: actions/cache@v4
with:
path: vendor
key: composer-dependencies
# If there's no Composer cache, install dependencies
- if: steps.cache-composer-deps.outputs.cache-hit != 'true'
run: composer update --no-dev --classmap-authoritative
- name: Generate hashed key for download cache
run: |
INPUT_HASH=$(echo "${{ runner.os }}-${{ inputs.version }}-${{ inputs.extensions }}" | sha256sum | awk '{print $1}')
echo "INPUT_HASH=${INPUT_HASH}" >> $GITHUB_ENV
# Cache downloaded source
- id: cache-download
uses: actions/cache@v4
with:
path: downloads
key: php-${{ env.INPUT_HASH }}
# With or without debug
- if: inputs.debug == true
run: echo "SPC_BUILD_DEBUG=--debug" >> $GITHUB_ENV
- if: inputs.prefer-pre-built == true
run: echo "SPC_PRE_BUILT=--prefer-pre-built" >> $env:GITHUB_ENV
# With target select: cli, micro or both
- if: ${{ inputs.build-cli == true }}
run: echo "SPC_BUILD_CLI=--build-cli" >> $GITHUB_ENV
- if: ${{ inputs.build-micro == true }}
run: echo "SPC_BUILD_MICRO=--build-micro" >> $GITHUB_ENV
- if: ${{ inputs.build-fpm == true }}
run: echo "SPC_BUILD_FPM=--build-fpm" >> $GITHUB_ENV
# If there's no dependencies cache, fetch sources, with or without debug
- if: steps.cache-download.outputs.cache-hit != 'true'
run: SPC_USE_ARCH=${{ inputs.operating-system }} ./bin/spc-alpine-docker download --with-php=${{ inputs.version }} --for-extensions=${{ inputs.extensions }} ${{ env.SPC_BUILD_DEBUG }} ${{ env.SPC_PRE_BUILT }}
# Run build command
- run: SPC_USE_ARCH=${{ inputs.operating-system }} ./bin/spc-alpine-docker build ${{ inputs.extensions }} ${{ env.SPC_BUILD_DEBUG }} ${{ env.SPC_BUILD_CLI }} ${{ env.SPC_BUILD_MICRO }} ${{ env.SPC_BUILD_FPM }}
# Upload cli executable
- if: ${{ inputs.build-cli == true }}
uses: actions/upload-artifact@v4
with:
name: php-${{ inputs.version }}-linux-${{ inputs.operating-system }}
path: buildroot/bin/php
# Upload micro self-extracted executable
- if: ${{ inputs.build-micro == true }}
uses: actions/upload-artifact@v4
with:
name: micro-${{ inputs.version }}-linux-${{ inputs.operating-system }}
path: buildroot/bin/micro.sfx
# Upload fpm executable
- if: ${{ inputs.build-fpm == true }}
uses: actions/upload-artifact@v4
with:
name: php-fpm-${{ inputs.version }}-linux-${{ inputs.operating-system }}
path: buildroot/bin/php-fpm
# Upload extensions metadata
- uses: actions/upload-artifact@v4
with:
name: license-files
path: buildroot/license/
- uses: actions/upload-artifact@v4
with:
name: build-meta
path: |
buildroot/build-extensions.json
buildroot/build-libraries.json

View File

@@ -1,125 +0,0 @@
name: CI on x86_64 linux
on:
workflow_dispatch:
inputs:
version:
required: true
description: php version to compile
default: '8.2'
type: choice
options:
- '8.3'
- '8.2'
- '8.1'
- '8.0'
- '7.4'
build-cli:
description: build cli binary
default: true
type: boolean
build-micro:
description: build phpmicro binary
type: boolean
build-fpm:
description: build fpm binary
type: boolean
extensions:
description: extensions to compile (comma separated)
required: true
type: string
prefer-pre-built:
description: prefer pre-built binaries (reduce build time)
type: boolean
default: true
debug:
description: enable debug logs
type: boolean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
build:
name: build ${{ inputs.version }} on Linux x86_64
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Cache composer dependencies
- id: cache-composer-deps
uses: actions/cache@v4
with:
path: vendor
key: composer-dependencies
# If there's no Composer cache, install dependencies
- if: steps.cache-composer-deps.outputs.cache-hit != 'true'
run: composer update --no-dev --classmap-authoritative
- name: Generate hashed key for download cache
run: |
INPUT_HASH=$(echo "${{ runner.os }}-${{ inputs.version }}-${{ inputs.extensions }}" | sha256sum | awk '{print $1}')
echo "INPUT_HASH=${INPUT_HASH}" >> $GITHUB_ENV
# Cache downloaded source
- id: cache-download
uses: actions/cache@v4
with:
path: downloads
key: php-${{ env.INPUT_HASH }}
# With or without debug
- if: inputs.debug == true
run: echo "SPC_BUILD_DEBUG=--debug" >> $GITHUB_ENV
- if: inputs.prefer-pre-built == true
run: echo "SPC_PRE_BUILT=--prefer-pre-built" >> $env:GITHUB_ENV
# With target select: cli, micro or both
- if: ${{ inputs.build-cli == true }}
run: echo "SPC_BUILD_CLI=--build-cli" >> $GITHUB_ENV
- if: ${{ inputs.build-micro == true }}
run: echo "SPC_BUILD_MICRO=--build-micro" >> $GITHUB_ENV
- if: ${{ inputs.build-fpm == true }}
run: echo "SPC_BUILD_FPM=--build-fpm" >> $GITHUB_ENV
# If there's no dependencies cache, fetch sources, with or without debug
- if: steps.cache-download.outputs.cache-hit != 'true'
run: CACHE_API_EXEC=yes ./bin/spc-alpine-docker download --with-php=${{ inputs.version }} --for-extensions=${{ inputs.extensions }} ${{ env.SPC_BUILD_DEBUG }} ${{ env.SPC_PRE_BUILT }}
# Run build command
- run: ./bin/spc-alpine-docker build ${{ inputs.extensions }} ${{ env.SPC_BUILD_DEBUG }} ${{ env.SPC_BUILD_CLI }} ${{ env.SPC_BUILD_MICRO }} ${{ env.SPC_BUILD_FPM }}
# Upload cli executable
- if: ${{ inputs.build-cli == true }}
uses: actions/upload-artifact@v4
with:
name: php-${{ inputs.version }}-${{ env.SPC_BUILD_OS }}
path: buildroot/bin/php
# Upload micro self-extracted executable
- if: ${{ inputs.build-micro == true }}
uses: actions/upload-artifact@v4
with:
name: micro-${{ inputs.version }}-${{ env.SPC_BUILD_OS }}
path: buildroot/bin/micro.sfx
# Upload fpm executable
- if: ${{ inputs.build-fpm == true }}
uses: actions/upload-artifact@v4
with:
name: php-fpm-${{ inputs.version }}-${{ env.SPC_BUILD_OS }}
path: buildroot/bin/php-fpm
# Upload extensions metadata
- uses: actions/upload-artifact@v4
with:
name: license-files
path: buildroot/license/
- uses: actions/upload-artifact@v4
with:
name: build-meta
path: |
buildroot/build-extensions.json
buildroot/build-libraries.json

View File

@@ -1,139 +0,0 @@
name: CI on arm64 macOS
on:
workflow_dispatch:
inputs:
version:
required: true
description: php version to compile
default: '8.2'
type: choice
options:
- '8.3'
- '8.2'
- '8.1'
- '8.0'
- '7.4'
build-cli:
description: build cli binary
default: true
type: boolean
build-micro:
description: build phpmicro binary
type: boolean
build-fpm:
description: build fpm binary
type: boolean
extensions:
description: extensions to compile (comma separated)
required: true
type: string
prefer-pre-built:
description: prefer pre-built binaries (reduce build time)
type: boolean
default: true
debug:
description: enable debug logs
type: boolean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
build:
name: build ${{ inputs.version }} on macOS arm64
runs-on: macos-14
steps:
- uses: actions/checkout@v4
# Install macOS missing packages and mark os suffix
- run: |
brew install automake gzip
echo "SPC_BUILD_OS=macos" >> $GITHUB_ENV
- name: "Setup PHP"
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
tools: pecl, composer
extensions: curl, openssl, mbstring, tokenizer
ini-values: memory_limit=-1
# Cache composer dependencies
- id: cache-composer-deps
uses: actions/cache@v4
with:
path: vendor
key: composer-dependencies
# If there's no Composer cache, install dependencies
- if: steps.cache-composer-deps.outputs.cache-hit != 'true'
run: composer update --no-dev --classmap-authoritative
- name: Generate hashed key for download cache
run: |
INPUT_HASH=$(echo "${{ runner.os }}-${{ inputs.version }}-${{ inputs.extensions }}" | sha256sum | awk '{print $1}')
echo "INPUT_HASH=${INPUT_HASH}" >> $GITHUB_ENV
# Cache downloaded source
- id: cache-download
uses: actions/cache@v4
with:
path: downloads
key: php-${{ env.INPUT_HASH }}
# With or without debug
- if: inputs.debug == true
run: echo "SPC_BUILD_DEBUG=--debug" >> $GITHUB_ENV
- if: inputs.prefer-pre-built == true
run: echo "SPC_PRE_BUILT=--prefer-pre-built" >> $env:GITHUB_ENV
# With target select: cli, micro or both
- if: ${{ inputs.build-cli == true }}
run: echo "SPC_BUILD_CLI=--build-cli" >> $GITHUB_ENV
- if: ${{ inputs.build-micro == true }}
run: echo "SPC_BUILD_MICRO=--build-micro" >> $GITHUB_ENV
- if: ${{ inputs.build-fpm == true }}
run: echo "SPC_BUILD_FPM=--build-fpm" >> $GITHUB_ENV
# If there's no dependencies cache, fetch sources, with or without debug
- if: steps.cache-download.outputs.cache-hit != 'true'
run: ./bin/spc download --with-php=${{ inputs.version }} --for-extensions=${{ inputs.extensions }} ${{ env.SPC_BUILD_DEBUG }} ${{ env.SPC_PRE_BUILT }}
# Run build command
- run: ./bin/spc build ${{ inputs.extensions }} ${{ env.SPC_BUILD_DEBUG }} ${{ env.SPC_BUILD_CLI }} ${{ env.SPC_BUILD_MICRO }} ${{ env.SPC_BUILD_FPM }}
# Upload cli executable
- if: ${{ inputs.build-cli == true }}
uses: actions/upload-artifact@v4
with:
name: php-${{ inputs.version }}-${{ env.SPC_BUILD_OS }}
path: buildroot/bin/php
# Upload micro self-extracted executable
- if: ${{ inputs.build-micro == true }}
uses: actions/upload-artifact@v4
with:
name: micro-${{ inputs.version }}-${{ env.SPC_BUILD_OS }}
path: buildroot/bin/micro.sfx
# Upload fpm executable
- if: ${{ inputs.build-fpm == true }}
uses: actions/upload-artifact@v4
with:
name: php-fpm-${{ inputs.version }}-${{ env.SPC_BUILD_OS }}
path: buildroot/bin/php-fpm
# Upload extensions metadata
- uses: actions/upload-artifact@v4
with:
name: license-files
path: buildroot/license/
- uses: actions/upload-artifact@v4
with:
name: build-meta
path: |
buildroot/build-extensions.json
buildroot/build-libraries.json

View File

@@ -1,138 +0,0 @@
name: CI on x86_64 macOS
on:
workflow_dispatch:
inputs:
version:
required: true
description: php version to compile
default: '8.2'
type: choice
options:
- '8.3'
- '8.2'
- '8.1'
- '8.0'
- '7.4'
build-cli:
description: build cli binary
default: true
type: boolean
build-micro:
description: build phpmicro binary
type: boolean
build-fpm:
description: build fpm binary
type: boolean
extensions:
description: extensions to compile (comma separated)
required: true
type: string
prefer-pre-built:
description: prefer pre-built binaries (reduce build time)
type: boolean
default: true
debug:
description: enable debug logs
type: boolean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
build:
name: build ${{ inputs.version }} on macOS x86_64
runs-on: macos-13
steps:
- uses: actions/checkout@v4
# Install macOS missing packages and mark os suffix
- run: |
brew install automake gzip
echo "SPC_BUILD_OS=macos" >> $GITHUB_ENV
- name: "Setup PHP"
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
tools: pecl, composer
extensions: curl, openssl, mbstring, tokenizer
ini-values: memory_limit=-1
# Cache composer dependencies
- id: cache-composer-deps
uses: actions/cache@v4
with:
path: vendor
key: composer-dependencies
# If there's no Composer cache, install dependencies
- if: steps.cache-composer-deps.outputs.cache-hit != 'true'
run: composer update --no-dev --classmap-authoritative
- name: Generate hashed key for download cache
run: |
INPUT_HASH=$(echo "${{ runner.os }}-${{ inputs.version }}-${{ inputs.extensions }}" | sha256sum | awk '{print $1}')
echo "INPUT_HASH=${INPUT_HASH}" >> $GITHUB_ENV
# Cache downloaded source
- id: cache-download
uses: actions/cache@v4
with:
path: downloads
key: php-${{ env.INPUT_HASH }}
# With or without debug
- if: inputs.debug == true
run: echo "SPC_BUILD_DEBUG=--debug" >> $GITHUB_ENV
- if: inputs.prefer-pre-built == true
run: echo "SPC_PRE_BUILT=--prefer-pre-built" >> $env:GITHUB_ENV
# With target select: cli, micro or both
- if: ${{ inputs.build-cli == true }}
run: echo "SPC_BUILD_CLI=--build-cli" >> $GITHUB_ENV
- if: ${{ inputs.build-micro == true }}
run: echo "SPC_BUILD_MICRO=--build-micro" >> $GITHUB_ENV
- if: ${{ inputs.build-fpm == true }}
run: echo "SPC_BUILD_FPM=--build-fpm" >> $GITHUB_ENV
# If there's no dependencies cache, fetch sources, with or without debug
- if: steps.cache-download.outputs.cache-hit != 'true'
run: ./bin/spc download --with-php=${{ inputs.version }} --for-extensions=${{ inputs.extensions }} ${{ env.SPC_BUILD_DEBUG }} ${{ env.SPC_PRE_BUILT }}
# Run build command
- run: ./bin/spc build ${{ inputs.extensions }} ${{ env.SPC_BUILD_DEBUG }} ${{ env.SPC_BUILD_CLI }} ${{ env.SPC_BUILD_MICRO }} ${{ env.SPC_BUILD_FPM }}
# Upload cli executable
- if: ${{ inputs.build-cli == true }}
uses: actions/upload-artifact@v4
with:
name: php-${{ inputs.version }}-${{ env.SPC_BUILD_OS }}
path: buildroot/bin/php
# Upload micro self-extracted executable
- if: ${{ inputs.build-micro == true }}
uses: actions/upload-artifact@v4
with:
name: micro-${{ inputs.version }}-${{ env.SPC_BUILD_OS }}
path: buildroot/bin/micro.sfx
# Upload fpm executable
- if: ${{ inputs.build-fpm == true }}
uses: actions/upload-artifact@v4
with:
name: php-fpm-${{ inputs.version }}-${{ env.SPC_BUILD_OS }}
path: buildroot/bin/php-fpm
# Upload extensions metadata
- uses: actions/upload-artifact@v4
with:
name: license-files
path: buildroot/license/
- uses: actions/upload-artifact@v4
with:
name: build-meta
path: |
buildroot/build-extensions.json
buildroot/build-libraries.json

335
.github/workflows/build-unix.yml vendored Normal file
View File

@@ -0,0 +1,335 @@
name: "CI on Unix"
on:
workflow_dispatch:
inputs:
os:
required: true
description: Build target OS
default: 'linux-x86_64'
type: choice
options:
- 'linux-x86_64'
- 'linux-aarch64'
- 'linux-x86_64-glibc'
- 'linux-aarch64-glibc'
- 'macos-x86_64'
- 'macos-aarch64'
php-version:
required: true
description: PHP version to compile
default: '8.4'
type: choice
options:
- '8.4'
- '8.3'
- '8.2'
- '8.1'
extensions:
description: Extensions to build (comma separated)
required: true
type: string
shared-extensions:
description: Shared extensions to build (optional, comma separated)
type: string
extra-libs:
description: Extra libraries to build (optional, comma separated)
type: string
build-cli:
description: Build cli binary
default: true
type: boolean
build-micro:
description: Build phpmicro binary
type: boolean
build-fpm:
description: Build fpm binary
type: boolean
build-frankenphp:
description: Build frankenphp binary (requires ZTS)
type: boolean
default: false
enable-zts:
description: Enable ZTS
type: boolean
default: false
prefer-pre-built:
description: Prefer pre-built binaries (reduce build time)
type: boolean
default: true
with-suggested-libs:
description: Build with suggested libs
type: boolean
default: false
debug:
description: Show full build logs
type: boolean
no-strip:
description: Keep debug symbols for debugging
type: boolean
default: false
workflow_call:
inputs:
os:
required: true
description: Build target OS
default: 'linux-x86_64'
type: string
php-version:
required: true
description: PHP version to compile
default: '8.4'
type: string
extensions:
description: Extensions to build (comma separated)
required: true
type: string
shared-extensions:
description: Shared extensions to build (optional, comma separated)
type: string
extra-libs:
description: Extra libraries to build (optional, comma separated)
type: string
build-cli:
description: Build cli binary
default: true
type: boolean
build-micro:
description: Build phpmicro binary
type: boolean
build-fpm:
description: Build fpm binary
type: boolean
build-frankenphp:
description: Build frankenphp binary (requires ZTS)
type: boolean
default: false
enable-zts:
description: Enable ZTS
type: boolean
default: false
prefer-pre-built:
description: Prefer pre-built binaries (reduce build time)
type: boolean
default: true
with-suggested-libs:
description: Include suggested libs
type: boolean
default: false
debug:
description: Show full build logs
type: boolean
no-strip:
description: Keep debug symbols for debugging
type: boolean
default: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
define-build:
name: "Define Build Scripts"
runs-on: ubuntu-latest
outputs:
run: ${{ steps.gendef.outputs.run }}
download: ${{ steps.gendef.outputs.download }}
build: ${{ steps.gendef.outputs.build }}
steps:
- name: "Checkout"
uses: actions/checkout@v4
- name: "Define"
id: gendef
run: |
case "${{ inputs.os }}" in
linux-x86_64)
DOWN_CMD="./bin/spc-alpine-docker download"
BUILD_CMD="./bin/spc-alpine-docker build"
RUNS_ON="ubuntu-latest"
;;
linux-aarch64)
DOWN_CMD="./bin/spc-alpine-docker download"
BUILD_CMD="./bin/spc-alpine-docker build"
RUNS_ON="ubuntu-24.04-arm"
;;
linux-x86_64-glibc)
DOWN_CMD="./bin/spc-gnu-docker download"
BUILD_CMD="./bin/spc-gnu-docker build"
RUNS_ON="ubuntu-22.04"
;;
linux-aarch64-glibc)
DOWN_CMD="./bin/spc-gnu-docker download"
BUILD_CMD="./bin/spc-gnu-docker build"
RUNS_ON="ubuntu-22.04-arm"
;;
macos-x86_64)
DOWN_CMD="composer update --no-dev --classmap-authoritative && ./bin/spc doctor --auto-fix && ./bin/spc download"
BUILD_CMD="./bin/spc build"
RUNS_ON="macos-15-intel"
;;
macos-aarch64)
DOWN_CMD="composer update --no-dev --classmap-authoritative && ./bin/spc doctor --auto-fix && ./bin/spc download"
BUILD_CMD="./bin/spc build"
RUNS_ON="macos-15"
;;
esac
STATIC_EXTS="${{ inputs.extensions }}"
SHARED_EXTS="${{ inputs['shared-extensions'] }}"
BUILD_FRANKENPHP="${{ inputs['build-frankenphp'] }}"
ENABLE_ZTS="${{ inputs['enable-zts'] }}"
ALL_EXTS="$STATIC_EXTS"
if [ -n "$SHARED_EXTS" ]; then
ALL_EXTS="$ALL_EXTS,$SHARED_EXTS"
fi
DOWN_CMD="$DOWN_CMD --with-php=${{ inputs.php-version }} --for-extensions=$ALL_EXTS --ignore-cache-sources=php-src"
BUILD_CMD="$BUILD_CMD $STATIC_EXTS"
if [ -n "$SHARED_EXTS" ]; then
BUILD_CMD="$BUILD_CMD --build-shared=$SHARED_EXTS"
fi
if [ -n "${{ inputs.extra-libs }}" ]; then
DOWN_CMD="$DOWN_CMD --for-libs=${{ inputs.extra-libs }}"
BUILD_CMD="$BUILD_CMD --with-libs=${{ inputs.extra-libs }}"
fi
if [ ${{ inputs.debug }} == true ]; then
DOWN_CMD="$DOWN_CMD --debug"
BUILD_CMD="$BUILD_CMD --debug"
fi
if [ ${{ inputs.prefer-pre-built }} == true ]; then
DOWN_CMD="$DOWN_CMD --prefer-pre-built"
fi
if [ ${{ inputs.with-suggested-libs }} == true ]; then
BUILD_CMD="$BUILD_CMD --with-suggested-libs"
fi
if [ ${{ inputs.build-cli }} == true ]; then
BUILD_CMD="$BUILD_CMD --build-cli"
fi
if [ ${{ inputs.build-micro }} == true ]; then
BUILD_CMD="$BUILD_CMD --build-micro"
fi
if [ ${{ inputs.build-fpm }} == true ]; then
BUILD_CMD="$BUILD_CMD --build-fpm"
fi
if [ "$BUILD_FRANKENPHP" = "true" ]; then
BUILD_CMD="$BUILD_CMD --build-frankenphp"
fi
if [ "$ENABLE_ZTS" = "true" ]; then
BUILD_CMD="$BUILD_CMD --enable-zts"
fi
echo 'download='"$DOWN_CMD" >> "$GITHUB_OUTPUT"
echo 'build='"$BUILD_CMD" >> "$GITHUB_OUTPUT"
echo 'run='"$RUNS_ON" >> "$GITHUB_OUTPUT"
build:
name: "Build ${{ inputs.version }} on ${{ inputs.os }}"
runs-on: ${{ needs.define-build.outputs.run }}
needs: define-build
timeout-minutes: 240
steps:
- name: "Checkout"
uses: actions/checkout@v4
- name: "Setup PHP"
uses: shivammathur/setup-php@v2
with:
php-version: 8.4
tools: pecl, composer
extensions: curl, openssl, mbstring
ini-values: memory_limit=-1
env:
phpts: nts
- if: ${{ inputs['build-frankenphp'] == true }}
name: "Install go-xcaddy for FrankenPHP"
run: |
case "${{ inputs.os }}" in
linux-x86_64|linux-aarch64)
./bin/spc-alpine-docker install-pkg go-xcaddy
;;
linux-x86_64-glibc|linux-aarch64-glibc)
./bin/spc-gnu-docker install-pkg go-xcaddy
;;
macos-x86_64|macos-aarch64)
composer update --no-dev --classmap-authoritative
./bin/spc doctor --auto-fix
./bin/spc install-pkg go-xcaddy
;;
*)
echo "Unsupported OS for go-xcaddy install: ${{ inputs.os }}"
exit 1
;;
esac
# Cache downloaded source
- id: cache-download
uses: actions/cache@v4
with:
path: downloads
key: php-dependencies-${{ inputs.os }}
- name: "Download sources"
run: ${{ needs.define-build.outputs.download }}
- name: "Build PHP"
run: ${{ needs.define-build.outputs.build }}
# - name: Setup tmate session
# if: ${{ failure() }}
# uses: mxschmitt/action-tmate@v3
# Upload debug logs
- if: ${{ inputs.debug && failure() }}
name: "Upload build logs on failure"
uses: actions/upload-artifact@v4
with:
name: spc-logs-${{ inputs.php-version }}-${{ inputs.os }}
path: log/*.log
# Upload cli executable
- if: ${{ inputs.build-cli == true }}
name: "Upload PHP cli SAPI"
uses: actions/upload-artifact@v4
with:
name: php-cli-${{ inputs.php-version }}-${{ inputs.os }}
path: buildroot/bin/php
# Upload micro self-extracted executable
- if: ${{ inputs.build-micro == true }}
name: "Upload PHP micro SAPI"
uses: actions/upload-artifact@v4
with:
name: php-micro-${{ inputs.php-version }}-${{ inputs.os }}
path: buildroot/bin/micro.sfx
# Upload fpm executable
- if: ${{ inputs.build-fpm == true }}
name: "Upload PHP fpm SAPI"
uses: actions/upload-artifact@v4
with:
name: php-fpm-${{ inputs.php-version }}-${{ inputs.os }}
path: buildroot/bin/php-fpm
# Upload frankenphp executable
- if: ${{ inputs['build-frankenphp'] == true }}
name: "Upload FrankenPHP SAPI"
uses: actions/upload-artifact@v4
with:
name: php-frankenphp-${{ inputs.php-version }}-${{ inputs.os }}
path: buildroot/bin/frankenphp
# Upload extensions metadata
- if: ${{ inputs['shared-extensions'] != '' }}
name: "Upload shared extensions"
uses: actions/upload-artifact@v4
with:
name: php-shared-ext-${{ inputs.php-version }}-${{ inputs.os }}
path: |
buildroot/modules/*.so
- uses: actions/upload-artifact@v4
name: "Upload License Files"
with:
name: license-files-${{ inputs.php-version }}-${{ inputs.os }}
path: buildroot/license/
- uses: actions/upload-artifact@v4
name: "Upload Build Metadata"
with:
name: build-meta-${{ inputs.php-version }}-${{ inputs.os }}
path: |
buildroot/build-extensions.json
buildroot/build-libraries.json

View File

@@ -6,14 +6,14 @@ on:
version:
required: true
description: php version to compile
default: '8.2'
default: '8.4'
type: choice
options:
- '8.4'
- '8.3'
- '8.2'
- '8.1'
- '8.0'
- '7.4'
build-cli:
description: build cli binary
default: true

139
.github/workflows/ext-matrix-tests.yml vendored Normal file
View File

@@ -0,0 +1,139 @@
name: "Extension Matrix Tests"
on:
workflow_dispatch:
push:
jobs:
test:
name: "${{ matrix.extension }} (PHP ${{ matrix.php-version }} on ${{ matrix.operating-system }})"
runs-on: ${{ matrix.operating-system }}
if: contains(github.event.head_commit.message, 'extension test') || contains(github.event.head_commit.message, 'test extensions')
strategy:
fail-fast: false
matrix:
extension:
- amqp
- apcu
- bcmath
- bz2
- calendar
- ctype
- curl
- dba
- dom
- ds
- event
- exif
- filter
- fileinfo
- ftp
- gd
- gettext
- gmp
- iconv
- igbinary
- imagick
- imap
- intl
- ldap
- mbstring,mbregex
- memcache
- mysqli,mysqlnd,pdo_mysql
- opcache
- openssl
- pcntl
- password-argon2
- pcntl
- pdo
- pgsql,pdo_pgsql
- phar
- posix
- rar
- protobuf
- readline
- redis
- session
- shmop
- simdjson
- simplexml,xml
- snappy
- soap
- sockets
- sodium
- sqlite3,pdo_sqlite
- sqlsrv
- ssh2
- swoole
- swoole,swoole-hook-pgsql,swoole-hook-mysql,swoole-hook-sqlite,swoole-hook-odbc
- swow
- sysvmsg,sysvsem,sysvshm
- tidy
- tokenizer
- uuid
- uv
- xhprof
- xlswriter
- xmlwriter,xmlreader
- xsl
- yac
- yaml
- zip
- zlib
- zstd
php-version:
- "8.4"
operating-system:
- "ubuntu-latest"
#- "macos-15-intel"
#- "debian-arm64-self-hosted"
- "macos-15"
steps:
- name: "Checkout"
uses: "actions/checkout@v4"
- name: OS type
id: os-type
run: |
OS=""
if [ "${{ matrix.operating-system }}" = "ubuntu-latest" ]; then
OS="linux-x86_64"
elif [ "${{ matrix.operating-system }}" = "macos-15-intel" ]; then
OS="macos-x86_64"
elif [ "${{ matrix.operating-system }}" = "debian-arm64-self-hosted" ]; then
OS="linux-aarch64"
elif [ "${{ matrix.operating-system }}" = "macos-15" ]; then
OS="macos-aarch64"
fi
echo "OS=$OS" >> $GITHUB_ENV
- name: "Setup PHP"
uses: shivammathur/setup-php@v2
with:
php-version: 8.4
tools: pecl, composer
extensions: curl, openssl, mbstring
ini-values: memory_limit=-1
env:
phpts: nts
- name: "Install Dependencies"
run: composer update -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
- id: cache-download
uses: actions/cache@v4
with:
path: downloads
key: php-${{ matrix.php-version }}-dependencies-for-tests
# If there's no dependencies cache, fetch sources
- name: "Download sources"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./bin/spc download --with-php=${{ matrix.php-version }} --for-extensions=${{ matrix.extension }} --debug --ignore-cache-sources=php-src
- name: "Build library: ${{ matrix.library }}"
run: |
SPC_USE_SUDO=yes ./bin/spc doctor --auto-fix
./bin/spc build --build-cli --build-micro --build-fpm ${{ matrix.extension }} --debug --with-suggested-libs --with-suggested-exts

View File

@@ -3,14 +3,18 @@ name: Build SPC Binary
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
paths:
- '.github/workflows/release-build.yml'
release:
types:
- published
workflow_dispatch:
env:
PHP_VERSION: 8.2
MICRO_VERSION: 8.2.18
PHP_VERSION: 8.4
MICRO_VERSION: 8.4.11
jobs:
build-release-artifacts:
@@ -23,7 +27,7 @@ jobs:
os: "ubuntu-latest"
filename: "spc-linux-x86_64.tar.gz"
- name: "macos-x86_64"
os: "macos-13"
os: "macos-15-intel"
filename: "spc-macos-x86_64.tar.gz"
- name: "linux-aarch64"
os: "ubuntu-latest"
@@ -42,12 +46,13 @@ jobs:
run: echo "SPC_BUILD_DEBUG=--debug" >> $GITHUB_ENV
- name: "Install PHP for official runners"
uses: "shivammathur/setup-php@v2"
uses: shivammathur/setup-php@v2
with:
coverage: none
tools: composer:v2
php-version: "${{ env.PHP_VERSION }}"
ini-values: memory_limit=-1
extensions: curl, openssl, mbstring
- name: "Get Composer Cache Directory"
id: composer-cache
@@ -115,20 +120,56 @@ jobs:
with:
files: dist/${{ matrix.operating-system.filename }}
- name: "Deploy to Self-Hosted Server"
if: github.repository == 'crazywhalecc/static-php-cli'
uses: easingthemes/ssh-deploy@main
env:
SSH_PRIVATE_KEY: ${{ secrets.DEPLOY_SERVER_SECRET_KEY }}
ARGS: "-rltgoDzvO"
SOURCE: "dist/"
REMOTE_HOST: ${{ secrets.DEPLOY_SERVER_HOST }}
REMOTE_PORT: ${{ secrets.DEPLOY_SERVER_PORT }}
REMOTE_USER: ${{ secrets.DEPLOY_SERVER_USER }}
TARGET: ${{ secrets.DEPLOY_SERVER_TARGET_SPC_NIGHTLY }}
- name: "Deploy to self-hosted OSS"
# only run this step if the repository is static-php-cli and the branch is main
if: github.repository == 'crazywhalecc/static-php-cli' && github.ref == 'refs/heads/main'
uses: static-php/upload-s3-action@v1.0.0
with:
aws_key_id: ${{ secrets.AWS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws_bucket: ${{ secrets.AWS_BUCKET }}
source_dir: "dist/"
destination_dir: static-php-cli/spc-bin/nightly/
endpoint: ${{ secrets.AWS_ENDPOINT }}
- name: "Upload Artifact"
uses: actions/upload-artifact@v4
with:
path: spc${{ env.SUFFIX }}
name: spc-${{ matrix.operating-system.name }}${{ env.SUFFIX }}
test-spc:
name: "Test SPC Binary for ${{ matrix.operating-system.name }}"
runs-on: ${{ matrix.operating-system.os }}
needs: [build-release-artifacts]
strategy:
matrix:
operating-system:
- name: "linux-x86_64"
os: "ubuntu-latest"
- name: "macos-x86_64"
os: "macos-15-intel"
- name: "linux-aarch64"
os: "ubuntu-24.04-arm"
- name: "macos-aarch64"
os: "macos-15"
- name: "windows-x64"
os: "windows-latest"
steps:
- name: "Checkout"
uses: actions/checkout@v4
- name: "Download Artifact"
uses: actions/download-artifact@v4
env:
SUFFIX: ${{ matrix.operating-system.name == 'windows-x64' && '.exe' || '' }}
with:
name: spc-${{ matrix.operating-system.name }}${{ env.SUFFIX }}
- name: "Chmod"
if: matrix.operating-system.name != 'windows-x64'
run: chmod +x spc
- name: "Run SPC Tests"
env:
SUFFIX: ${{ matrix.operating-system.name == 'windows-x64' && '.exe' || '' }}
run: ./spc${{ env.SUFFIX }} dev:extensions

View File

@@ -1,13 +1,9 @@
name: Tests
on:
push:
branches:
- main
paths:
- 'src/globals/test-extensions.php'
pull_request:
branches: [ "main" ]
types: [ opened, synchronize, reopened ]
paths:
- 'src/**'
- 'config/**'
@@ -17,8 +13,7 @@ on:
- 'box.json'
- '.php-cs-fixer.php'
permissions:
contents: read
permissions: read-all
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -34,13 +29,16 @@ jobs:
- name: "Setup PHP"
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '8.4'
extensions: curl, openssl, mbstring
ini-values: memory_limit=-1
tools: pecl, composer, php-cs-fixer
tools: pecl, composer
- name: "Install dependencies"
run: composer install --no-progress --prefer-dist --optimize-autoloader
- name: Run PHP-CS-Fixer fix
run: php-cs-fixer fix --dry-run --diff --ansi
run: vendor/bin/php-cs-fixer fix --dry-run --diff --ansi
phpstan:
runs-on: ubuntu-latest
@@ -52,10 +50,12 @@ jobs:
- name: "Setup PHP"
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '8.4'
extensions: curl, openssl, mbstring
ini-values: memory_limit=-1
tools: composer
env:
phpts: zts
- name: "Cache Composer packages"
id: composer-cache
@@ -79,9 +79,7 @@ jobs:
strategy:
matrix:
include:
- php: '8.1'
- php: '8.2'
- php: '8.3'
- php: '8.4'
steps:
- name: "Checkout"
@@ -102,32 +100,20 @@ jobs:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
${{ runner.os }}-php
- name: "Install Dependencies"
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
- name: "Run PHPUnit Tests"
run: |
vendor/bin/phpunit tests/ --no-coverage
run: SPC_LIBC=glibc vendor/bin/phpunit tests/ --no-coverage
build:
name: "Build PHP Test (PHP ${{ matrix.php }} ${{ matrix.os }})"
runs-on: ${{ matrix.os }}
timeout-minutes: 120
strategy:
matrix:
php:
- "8.0"
- "8.1"
- "8.2"
- "8.3"
os:
- ubuntu-latest
- macos-13
- windows-latest
- macos-14
fail-fast: false
define-matrix:
name: "Define Matrix"
runs-on: ubuntu-latest
outputs:
php: ${{ steps.gendef.outputs.php }}
os: ${{ steps.gendef.outputs.os }}
steps:
- name: "Checkout"
uses: actions/checkout@v4
@@ -135,10 +121,45 @@ jobs:
- name: "Setup PHP"
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
php-version: 8.4
extensions: curl, openssl, mbstring
- name: Define
id: gendef
run: |
PHP_VERSIONS=$(php src/globals/test-extensions.php php)
OS_VERSIONS=$(php src/globals/test-extensions.php os)
echo 'php='"$PHP_VERSIONS" >> "$GITHUB_OUTPUT"
echo 'os='"$OS_VERSIONS" >> "$GITHUB_OUTPUT"
build:
name: "Build PHP Test (PHP ${{ matrix.php }} ${{ matrix.os }})"
runs-on: ${{ matrix.os }}
needs: [define-matrix, php-cs-fixer, phpstan, phpunit]
timeout-minutes: 120
strategy:
matrix:
php: ${{ fromJSON(needs.define-matrix.outputs.php) }}
os: ${{ fromJSON(needs.define-matrix.outputs.os) }}
fail-fast: false
steps:
- name: "Update runner packages"
if: ${{ startsWith(matrix.os, 'ubuntu-') }}
run: sudo apt-get update && sudo apt-get install -y ca-certificates
- name: "Checkout"
uses: actions/checkout@v4
- name: "Setup PHP"
uses: shivammathur/setup-php@v2
with:
php-version: 8.4
tools: pecl, composer
extensions: curl, openssl, mbstring
ini-values: memory_limit=-1
env:
phpts: nts
- name: "Cache composer packages"
id: composer-cache
@@ -154,40 +175,43 @@ jobs:
uses: actions/cache@v4
with:
path: downloads
key: php-${{ matrix.php }}-dependencies
key: php-dependencies-${{ matrix.os }}
- name: "Install Dependencies"
run: composer update -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
run: composer update -vvv --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist --no-plugins
- name: "Run Build Tests (doctor)"
run: bin/spc doctor --auto-fix
run: php src/globals/test-extensions.php doctor_cmd ${{ matrix.os }} ${{ matrix.php }}
- name: "Prepare UPX for Windows"
if: matrix.os == 'windows-latest'
if: ${{ startsWith(matrix.os, 'windows-') }}
run: |
bin/spc install-pkg upx
php src/globals/test-extensions.php install_upx_cmd ${{ matrix.os }} ${{ matrix.php }}
echo "UPX_CMD=$(php src/globals/test-extensions.php upx)" >> $env:GITHUB_ENV
- name: "Prepare UPX for Linux"
if: matrix.os == 'ubunut-latest'
if: ${{ startsWith(matrix.os, 'ubuntu-') }}
run: |
bin/spc install-pkg upx
php src/globals/test-extensions.php install_upx_cmd ${{ matrix.os }} ${{ matrix.php }}
echo "UPX_CMD=$(php src/globals/test-extensions.php upx)" >> $GITHUB_ENV
- name: "Run Build Tests (download)"
run: |
bin/spc download --for-extensions="$(php src/globals/test-extensions.php extensions)" --for-libs="$(php src/globals/test-extensions.php libs)" --with-php=${{ matrix.php }} --ignore-cache-sources=php-src --debug --retry=5 --shallow-clone
run: php src/globals/test-extensions.php download_cmd ${{ matrix.os }} ${{ matrix.php }}
- name: "Download pre-built libraries for pkg-config"
if: matrix.os != 'windows-latest'
run: |
bin/spc del-download pkg-config
bin/spc download pkg-config --prefer-pre-built --debug
- name: "Run Build Tests (build)"
run: php src/globals/test-extensions.php build_cmd ${{ matrix.os }} ${{ matrix.php }}
- name: "Run Build Tests (build, *nix)"
if: matrix.os != 'windows-latest'
run: bin/spc build "$(php src/globals/test-extensions.php extensions)" $(php src/globals/test-extensions.php zts) $(php src/globals/test-extensions.php no_strip) $UPX_CMD --with-libs="$(php src/globals/test-extensions.php libs)" --build-cli --build-micro --build-fpm --debug
- name: "Run Build Tests (build - embed for non-windows)"
if: ${{ !startsWith(matrix.os, 'windows-') }}
run: php src/globals/test-extensions.php build_embed_cmd ${{ matrix.os }} ${{ matrix.php }}
- name: "Run Build Tests (build, windows)"
if: matrix.os == 'windows-latest'
run: bin/spc build "$(php src/globals/test-extensions.php extensions)" $(php src/globals/test-extensions.php zts) $(php src/globals/test-extensions.php no_strip) $env:UPX_CMD --with-libs="$(php src/globals/test-extensions.php libs)" --build-cli --build-micro --debug
- name: "Upload logs"
if: ${{ always() && hashFiles('log/**') != '' }}
uses: actions/upload-artifact@v4
with:
name: build-logs-${{ matrix.os }}-${{ matrix.php }}
path: log
# - name: Setup tmate session
# if: ${{ failure() }}
# uses: mxschmitt/action-tmate@v3

View File

@@ -21,7 +21,6 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 18
cache: yarn
- run: yarn install --frozen-lockfile
@@ -32,12 +31,13 @@ jobs:
cp -r config/* docs/.vitepress/config/
- name: "Install PHP for official runners"
uses: "shivammathur/setup-php@v2"
uses: shivammathur/setup-php@v2
with:
coverage: none
tools: composer:v2
php-version: 8.2
php-version: 8.4
ini-values: memory_limit=-1
extensions: curl, openssl, mbstring
- name: "Get Composer Cache Directory"
id: composer-cache
@@ -58,6 +58,8 @@ jobs:
- name: "Generate Extension Support List"
run: |
bin/spc dev:gen-ext-docs > docs/extensions.md
bin/spc dev:gen-ext-dep-docs > docs/deps-map-ext.md
bin/spc dev:gen-lib-dep-docs > docs/deps-map-lib.md
- name: Build
run: yarn docs:build

30
.gitignore vendored
View File

@@ -5,22 +5,28 @@ docker/extensions/
docker/source/
# Vendor files
/vendor/
/vendor/**
# default source extract directory
/source/
/source/**
# built by shared embed tests
/locale/
# default source download directory
/downloads/
/downloads/**
# default source build root directory
/buildroot/
/buildroot/**
# default package root directory
/pkgroot/
/pkgroot/**
# Windows PHP SDK binary tools
/php-sdk-binary-tools/**
# default pack:lib and release directory
/dist/
/dist/**
packlib_files.txt
# tools cache files
@@ -31,7 +37,7 @@ packlib_files.txt
/bin/*
!/bin/spc*
!/bin/setup-runtime*
!/bin/spc-alpine-docker
!/bin/docker-entrypoint.sh
# exclude windows build tools
/php-sdk-binary-tools/
@@ -45,3 +51,13 @@ packlib_files.txt
/docs/.vitepress/cache/
package-lock.json
pnpm-lock.yaml
# craft
craft.yml
# SPC logs
log/
# spc.phar
spc.phar
spc.exe

View File

@@ -4,6 +4,7 @@ declare(strict_types=1);
return (new PhpCsFixer\Config())
->setRiskyAllowed(true)
->setUnsupportedPhpVersionAllowed(true)
->setRules([
'@PSR12' => true,
'@Symfony' => true,
@@ -64,7 +65,10 @@ return (new PhpCsFixer\Config())
'php_unit_test_class_requires_covers' => false,
'phpdoc_var_without_name' => false,
'fully_qualified_strict_types' => false,
'operator_linebreak' => false,
'php_unit_data_provider_method_order' => false,
])
->setFinder(
PhpCsFixer\Finder::create()->in([__DIR__ . '/src', __DIR__ . '/tests/SPC'])
);
)
->setParallelConfig(PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect());

View File

@@ -5,297 +5,168 @@
[![Releases](https://img.shields.io/packagist/v/crazywhalecc/static-php-cli?include_prereleases&label=Release&style=flat-square)](https://github.com/crazywhalecc/static-php-cli/releases)
[![CI](https://img.shields.io/github/actions/workflow/status/crazywhalecc/static-php-cli/tests.yml?branch=main&label=Build%20Test&style=flat-square)](https://github.com/crazywhalecc/static-php-cli/actions/workflows/tests.yml)
[![License](https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square)](https://github.com/crazywhalecc/static-php-cli/blob/main/LICENSE)
[![Extensions](https://img.shields.io/badge/Extension%20Counter-75+-yellow.svg?style=flat-square)](https://static-php.dev/zh/guide/extensions.html)
**static-php-cli**是一个用于静态编译、构建 PHP 解释器的工具,支持众多流行扩展。
目前 static-php-cli 支持 `cli``fpm``embed``micro` SAPI。
**static-php-cli**也支持将 PHP 代码和 PHP 运行时打包为一个文件并运行。
**static-php-cli** 是一个用于构建静态、独立 PHP 运行时的强大工具,支持众多流行扩展。
## 特性
static-php-cli简称 `spc`)有许多特性:
- :elephant: **支持多 PHP 版本** - 支持 PHP 8.1, 8.2, 8.3, 8.4, 8.5
- :handbag: **单文件 PHP 可执行文件** - 构建零依赖的独立 PHP
- :hamburger: **phpmicro 集成** - 构建 **[phpmicro](https://github.com/dixyes/phpmicro)** 自解压可执行文件(将 PHP 二进制文件和源代码合并为一个文件)
- :pill: **智能环境检查器** - 自动构建环境检查器,具备自动修复功能
- :zap: **跨平台支持** - 支持 Linux、macOS、FreeBSD 和 Windows
- :wrench: **可配置补丁** - 可自定义的源代码补丁系统
- :books: **智能依赖管理** - 自动处理构建依赖
- 📦 **自包含工具** - 提供使用 [box](https://github.com/box-project/box) 构建的 `spc` 可执行文件
- :fire: **广泛的扩展支持** - 支持 75+ 流行 [扩展](https://static-php.dev/zh/guide/extensions.html)
- :floppy_disk: **UPX 压缩** - 减小二进制文件大小 30-50%(仅 Linux/Windows
- :handbag: 构建独立的单文件 PHP 解释器,无需任何依赖
- :hamburger: 构建 **[phpmicro](https://github.com/dixyes/phpmicro)** 自执行二进制(将 PHP 代码和 PHP 解释器打包为一个文件)
- :pill: 提供一键检查和修复编译环境的 Doctor 模块
- :zap: 支持多个系统:`Linux``macOS``FreeBSD``Windows`
- :wrench: 高度自定义的代码 patch 功能
- :books: 自带编译依赖管理
- 📦 提供由自身编译的独立 `spc` 二进制(使用 spc 和 [box](https://github.com/box-project/box) 构建)
- :fire: 支持大量 [扩展](https://static-php.dev/zh/guide/extensions.html)
- :floppy_disk: 整合 UPX 工具(减小二进制文件体积)
**静态 php-cli:**
**单文件独立 php-cli**
<img width="700" alt="out1" src="https://github.com/crazywhalecc/static-php-cli/assets/20330940/01a2e60f-13b0-4242-a645-f7afa4936396">
**使用 phpmicro 打包 PHP 代码:**
**使用 phpmicro PHP 代码与 PHP 解释器结合:**
<img width="700" alt="out2" src="https://github.com/crazywhalecc/static-php-cli/assets/20330940/46b7128d-fb72-4169-957e-48564c3ff3e2">
## 文档
## 快速开始
目前 README 编写了基本用法。有关 static-php-cli 所有的功能,请点击这里查看文档:<https://static-php.dev>。
## 直接下载
如果你不想自行编译 PHP可以从本项目现有的示例 Action 下载 Artifact也可以从自托管的服务器下载。
| 组合名称 | 组合扩展数 | 系统 | 备注 |
|---------------------------------------------------------------------|----------------------------------------------------------------------------|-------------|--------------|
| [common](https://dl.static-php.dev/static-php-cli/common/) | [30+](https://dl.static-php.dev/static-php-cli/common/README.txt) | Linux/macOS | 体积为 7.5MB 左右 |
| [bulk](https://dl.static-php.dev/static-php-cli/bulk/) | [50+](https://dl.static-php.dev/static-php-cli/bulk/README.txt) | Linux/macOS | 体积为 25MB 左右 |
| [minimal](https://dl.static-php.dev/static-php-cli/minimal/) | [5](https://dl.static-php.dev/static-php-cli/minimal/README.txt) | Linux/macOS | 体积为 3MB 左右 |
| [spc-min](https://dl.static-php.dev/static-php-cli/windows/spc-min) | [5](https://dl.static-php.dev/static-php-cli/windows/spc-min/README.txt) | Windows | 体积为 3MB 左右 |
| [spc-max](https://dl.static-php.dev/static-php-cli/windows/spc-max) | [40+](https://dl.static-php.dev/static-php-cli/windows/spc-max/README.txt) | Windows | 体积为 8.5MB 左右 |
> Linux 和 Windows 默认启用了 UPX 压缩,可减小 30~50% 的 PHP 二进制体积。
> macOS 当前不支持 UPX所以上述预编译的 macOS 版本体积可能较大。
## 使用 static-php-cli 构建 PHP
### 编译环境需求
- PHP >= 8.1(这是 spc 自身需要的版本,不是支持的构建版本)
- 扩展:`mbstring,tokenizer,phar`
- 系统安装了 `curl``git`
是的,本项目采用 PHP 编写,编译前需要一个 PHP 环境,比较滑稽。
但本项目默认可通过自身构建的 micro 和 static-php 二进制运行,其他只需要包含上面提到的扩展和 PHP 版本大于等于 8.1 即可。
下面是架构支持情况,:octocat: 代表支持 GitHub Action 构建,:computer: 代表支持本地构建,空 代表暂不支持。
| | x86_64 | aarch64 |
|---------|----------------------|----------------------|
| macOS | :octocat: :computer: | :octocat: :computer: |
| Linux | :octocat: :computer: | :octocat: :computer: |
| Windows | :octocat: :computer: | |
| FreeBSD | :computer: | :computer: |
当前支持编译的 PHP 版本:
> :warning: 支持,但 static-php-cli 作者可能不再提供补丁修复
>
> :heavy_check_mark: 支持
>
> :x: 不支持
| PHP Version | Status | Comment |
|-------------|--------------------|------------------------------|
| 7.2 | :x: | |
| 7.3 | :warning: | phpmicro 和许多扩展不支持 7.3、7.4 版本 |
| 7.4 | :warning: | phpmicro 和许多扩展不支持 7.3、7.4 版本 |
| 8.0 | :heavy_check_mark: | PHP 官方已停止 8.0 的维护 |
| 8.1 | :heavy_check_mark: | PHP 官方仅对 8.1 提供安全更新 |
| 8.2 | :heavy_check_mark: | |
| 8.3 | :heavy_check_mark: | |
| 8.4 | :x: | WIP |
### 支持的扩展
请先根据下方扩展列表选择你要编译的扩展。
- [扩展支持列表](https://static-php.dev/zh/guide/extensions.html)
- [编译命令生成器](https://static-php.dev/zh/guide/cli-generator.html)
> 如果这里没有你需要的扩展,可以提交 Issue。
### 在线构建(使用 GitHub Actions
使用 GitHub Action 可以方便地构建一个静态编译的 PHP同时可以自行定义要编译的扩展。
1. Fork 本项目。
2. 进入项目的 Actions选择 CI。
3. 选择 `Run workflow`,填入你要编译的 PHP 版本、目标类型、扩展列表。(扩展列表使用英文逗号分割,例如 `bcmath,curl,mbstring`
4. 等待大约一段时间后,进入对应的任务中,获取 `Artifacts`
如果你选择了 `debug`,则会在构建时输出所有日志,包括编译的日志,以供排查错误。
### 本地构建(使用 spc 二进制,推荐)
该项目提供了 static-php-cli 的二进制文件:`spc`
您可以使用 `spc` 二进制文件,无需安装任何运行时(用起来就像 golang 程序)。
目前,`spc` 二进制文件提供的平台有 Linux 和 macOS。
使用以下命令从自托管服务器下载:
### 1. 下载 spc 二进制文件
```bash
# Download from self-hosted nightly builds (sync with main branch)
# For Linux x86_64
# Linux x86_64
curl -fsSL -o spc https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-linux-x86_64
# For Linux aarch64
# Linux aarch64
curl -fsSL -o spc https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-linux-aarch64
# macOS x86_64 (Intel)
curl -fsSL -o spc https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-macos-x86_64
# macOS aarch64 (Apple)
curl -fsSL -o spc https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-macos-aarch64
# Windows (x86_64, win10 build 17063 or later)
# Windows (x86_64, win10 build 17063 或更高版本,请先安装 VS2022)
curl.exe -fsSL -o spc.exe https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-windows-x64.exe
```
# Add execute perm (Linux and macOS only)
对于 macOS 和 Linux请先添加执行权限
```bash
chmod +x ./spc
# Run (Linux and macOS)
./spc --version
# Run (Windows powershell)
.\spc.exe --version
```
自托管 `spc` 由 GitHub Actions 构建,你也可以从 Actions 直接下载:[此处](https://github.com/crazywhalecc/static-php-cli/actions/workflows/release-build.yml)。
### 2. 构建静态 PHP
### 本地构建(使用 git 源码)
首先,创建一个 `craft.yml` 文件,并从 [扩展列表](https://static-php.dev/zh/guide/extensions.html) 或 [命令生成器](https://static-php.dev/zh/guide/cli-generator.html) 中指定要包含的扩展:
如果你需要修改 static-php-cli 源码,或者使用 spc 二进制构建有问题,你可以使用 git 源码下载 static-php-cli。
```yml
# PHP 版本支持8.1, 8.2, 8.3, 8.4, 8.5
php-version: 8.4
# 在此处放置您的扩展列表
extensions: "apcu,bcmath,calendar,ctype,curl,dba,dom,exif,fileinfo,filter,gd,iconv,mbregex,mbstring,mysqli,mysqlnd,opcache,openssl,pcntl,pdo,pdo_mysql,pdo_sqlite,phar,posix,readline,redis,session,simplexml,sockets,sodium,sqlite3,tokenizer,xml,xmlreader,xmlwriter,xsl,zip,zlib"
sapi:
- cli
- micro
- fpm
download-options:
prefer-pre-built: true
```
运行命令:
```bash
# clone 仓库即可
git clone https://github.com/crazywhalecc/static-php-cli.git
./spc craft
# 输出完整控制台日志
./spc craft --debug
```
如果您的系统上尚未安装 php我们建议你使用内置的 setup-runtime 自动安装 PHP 和 Composer。
### 3. 静态 PHP 使用
```bash
cd static-php-cli
chmod +x bin/setup-runtime
# it will download static php (from self-hosted server) and composer (from getcomposer)
bin/setup-runtime
# initialize composer deps
bin/composer install
# chmod
chmod +x bin/spc
bin/spc --version
现在您可以将 static-php-cli 构建的二进制文件复制到另一台机器上,无需依赖即可运行:
```
# php-cli
buildroot/bin/php -v
# phpmicro
echo '<?php echo "Hello world!\n";' > a.php
./spc micro:combine a.php -O my-app
./my-app
# php-fpm
buildroot/bin/php-fpm -v
```
### 开始构建 PHP
## 文档
下面是使用 static-php-cli 的基础用法:
当前 README 包含基本用法。有关 static-php-cli 的所有功能,
请访问 <https://static-php.dev>。
> 如果你使用的是打包好的 `spc` 二进制,你需要将下列命令的 `./bin/spc` 替换为 `./spc`。
## 直接下载
```bash
# 检查环境依赖,并根据尝试自动安装缺失的编译工具
./bin/spc doctor --auto-fix
如果您不想构建或想先测试,可以从 [Actions](https://github.com/static-php/static-php-cli-hosted/actions/workflows/build-php-bulk.yml) 下载示例预编译工件,或从自托管服务器下载。
# 拉取所有依赖库
./bin/spc download --all
# 只拉取编译指定扩展需要的所有依赖(推荐)
./bin/spc download --for-extensions="openssl,pcntl,mbstring,pdo_sqlite"
# 下载依赖时,优先下载有预编译的库(节省编译依赖的时间)
./bin/spc download --for-extensions="openssl,curl,mbstring,mbregex" --prefer-pre-built
# 下载编译不同版本的 PHP (--with-php=x.y推荐 7.3 ~ 8.3)
./bin/spc download --for-extensions="openssl,curl,mbstring" --with-php=8.1
以下是几个具有不同扩展组合的预编译静态 PHP 二进制文件,
您可以根据需要直接下载。
# 构建包含 bcmath,openssl,tokenizer,sqlite3,pdo_sqlite,ftp,curl 扩展的 php-cli 和 micro.sfx
./bin/spc build "bcmath,openssl,tokenizer,sqlite3,pdo_sqlite,ftp,curl" --build-cli --build-micro
# 编译线程安全版本 (--enable-zts)
./bin/spc build "curl,phar" --enable-zts --build-cli
# 编译后使用 UPX 减小可执行文件体积 (仅 Linux、Windows 可用) (至少压缩至原来的 30~50%)
./bin/spc build "curl,phar" --enable-zts --build-cli --with-upx-pack
```
| 组合名称 | 扩展数量 | 系统 | 备注 |
|----------------------------------------------------------------------|----------------------------------------------------------------------------|--------------|--------------------|
| [common](https://dl.static-php.dev/static-php-cli/common/) | [30+](https://dl.static-php.dev/static-php-cli/common/README.txt) | Linux, macOS | 二进制文件大小约为 7.5MB |
| [bulk](https://dl.static-php.dev/static-php-cli/bulk/) | [50+](https://dl.static-php.dev/static-php-cli/bulk/README.txt) | Linux, macOS | 二进制文件大小约为 25MB |
| [gnu-bulk](https://dl.static-php.dev/static-php-cli/gnu-bulk/) | [50+](https://dl.static-php.dev/static-php-cli/bulk/README.txt) | Linux, macOS | 使用 glibc 的 bulk 组合 |
| [minimal](https://dl.static-php.dev/static-php-cli/minimal/) | [5](https://dl.static-php.dev/static-php-cli/minimal/README.txt) | Linux, macOS | 二进制文件大小约为 3MB |
| [spc-min](https://dl.static-php.dev/static-php-cli/windows/spc-min/) | [5](https://dl.static-php.dev/static-php-cli/windows/spc-min/README.txt) | Windows | 二进制文件大小约为 3MB |
| [spc-max](https://dl.static-php.dev/static-php-cli/windows/spc-max/) | [40+](https://dl.static-php.dev/static-php-cli/windows/spc-max/README.txt) | Windows | 二进制文件大小约为 8.5MB |
其中,目前支持构建 climicrofpm 和 embed使用以下参数的一个或多个来指定编译的 SAPI
> Linux 和 Windows 支持对二进制文件进行 UPX 压缩,可以将二进制文件大小减少 30% 到 50%。
> macOS 不支持 UPX 压缩,因此 mac 的预构建二进制文件大小较大。
- `--build-cli`:构建 cli 二进制
- `--build-micro`:构建 phpmicro 自执行二进制
- `--build-fpm`:构建 fpm
- `--build-embed`:构建 embedlibphp
- `--build-all`:构建所有
### 在线构建(使用 GitHub Actions
如果出现了任何错误,可使用 `--debug` 参数来展示完整的输出日志,以供排查错误:
上方直接下载的二进制不能满足需求时,可使用 GitHub Action 可以轻松构建静态编译的 PHP
同时自行定义要编译的扩展。
```bash
./bin/spc build "openssl,pcntl,mbstring" --debug --build-all
./bin/spc download --all --debug
```
1. Fork 本项目。
2. 进入项目的 Actions 并选择 `CI`
3. 选择 `Run workflow`,填入您要编译的 PHP 版本、目标类型和扩展列表。(扩展用逗号分隔,例如 `bcmath,curl,mbstring`
4. 等待一段时间后,进入相应的任务并获取 `Artifacts`
## 不同 SAPI 的使用
### 使用 cli
> php-cli 是一个静态的二进制文件,类似 Go、Rust 语言编译后的单个可移植的二进制文件。
采用参数 `--build-cli``--build-all` 参数时,最后编译结果会输出一个 `./php` 的二进制文件,此文件可分发、可直接使用。
该文件编译后会存放在 `buildroot/bin/` 目录中,名称为 `php`,拷贝出来即可。
```bash
cd buildroot/bin/
./php -v # 检查版本
./php -m # 检查编译的扩展
./php your_code.php # 运行代码
./php your_project.phar # 运行打包为 phar 单文件的项目
```
### 使用 micro
> phpmicro 是一个提供自执行二进制 PHP 的项目,本项目依赖 phpmicro 进行编译自执行二进制。详见 [dixyes/phpmicro](https://github.com/dixyes/phpmicro)。
采用项目参数 `--build-micro``--build-all` 时,最后编译结果会输出一个 `./micro.sfx` 的文件,此文件需要配合你的 PHP 源码使用。
该文件编译后会存放在 `buildroot/bin/` 目录中,拷贝出来即可。
使用时应准备好你的项目源码文件,可以是单个 PHP 文件,也可以是 Phar 文件。
```bash
echo "<?php echo 'Hello world' . PHP_EOL;" > code.php
cat micro.sfx code.php > single-app && chmod +x single-app
./single-app
```
如果打包 PHAR 文件,仅需把 code.php 更换为 phar 文件路径即可。
你可以使用 [box-project/box](https://github.com/box-project/box) 将你的 CLI 项目打包为 Phar
然后将它与 phpmicro 结合,生成独立可执行的二进制文件。
```bash
# 使用 static-php-cli 生成的 micro.sfx 结合,也可以直接使用 cat 命令结合它们
bin/spc micro:combine my-app.phar
cat buildroot/bin/micro.sfx my-app.phar > my-app && chmod +x my-app
# 使用 micro:combine 结合可以将 INI 选项注入到二进制中
bin/spc micro:combine my-app.phar -I "memory_limit=4G" -I "disable_functions=system" --output my-app-2
```
> 有些情况下的 phar 文件或 PHP 项目可能无法在 micro 环境下运行。
### 使用 fpm
采用项目参数 `--build-fpm``--build-all` 时,最后编译结果会输出一个 `./php-fpm` 的文件。
该文件存放在 `buildroot/bin/` 目录,拷贝出来即可使用。
在正常的 Linux 发行版和 macOS 系统中,安装 php-fpm 后包管理会自动生成默认的 fpm 配置文件。
因为 php-fpm 必须指定配置文件才可启动,本项目编译的 php-fpm 不会带任何配置文件,所以需自行编写 `php-fpm.conf``pool.conf` 配置文件。
指定 `php-fpm.conf` 可以使用命令参数 `-y`,例如:`./php-fpm -y php-fpm.conf`
### 使用 embed
采用项目参数 `--build-embed``--build-all` 时,最后编译结果会输出一个 `libphp.a``php-config` 以及一系列头文件,存放在 `buildroot/`,你可以在你的其他代码中引入它们。
如果你知道 [embed SAPI](https://github.com/php/php-src/tree/master/sapi/embed),你应该知道如何使用它。对于有可能编译用到引入其他库的问题,你可以使用 `buildroot/bin/php-config` 来获取编译时的配置。
另外,有关如何使用此功能的高级示例,请查看[如何使用它构建 FrankenPHP 的静态版本](https://github.com/dunglas/frankenphp/blob/main/docs/static.md)。
如果您启用 `debug`,构建时将输出所有日志,包括编译日志,以便故障排除。
## 贡献
如果缺少你需要的扩展,可发起 Issue。如果你对本项目较熟悉也欢迎为本项目发起 Pull Request
如果需要的扩展缺失,可以创建 issue
如果您熟悉本项目,也欢迎发起 pull request。
另外,添加新扩展的贡献方式,可以参考下方 `进阶`
如果您想贡献文档,请直接编辑 `docs/` 目录
如果你想贡献文档内容,请直接修改 `docs/` 目录
现在有一个 [static-php](https://github.com/static-php) 组织,用于存储与项目相关的仓库
## 赞助本项目
可以 [我的个人赞助页](https://github.com/crazywhalecc/crazywhalecc/blob/master/FUNDING.md) 支持我和我的项目。捐赠的一部分将会被用于维护 **static-php.dev** 服务器。
可以 [GitHub Sponsor](https://github.com/crazywhalecc) 赞助我或我的项目。捐赠的一部分将用于维护 **static-php.dev** 服务器。
## 开源协议
**特别感谢以下赞助商**
本项目采用 MIT License 许可开源,下面是类似的项目:
<a href="https://beyondco.de/"><img src="/docs/public/images/beyondcode-seeklogo.png" width="300" alt="Beyond Code Logo" /></a>
<a href="https://nativephp.com/"><img src="/docs/public/images/nativephp-logo.svg" width="300" alt="NativePHP Logo" /></a>
## 开源许可证
本项目本身基于 MIT 许可证,
一些新添加的扩展和依赖可能来自其他项目,
这些代码文件的头部也会给出额外的许可证和作者说明。
这些是类似的项目:
- [dixyes/lwmbs](https://github.com/dixyes/lwmbs)
- [swoole/swoole-cli](https://github.com/swoole/swoole-cli)
项目使用了 [dixyes/lwmbs](https://github.com/dixyes/lwmbs) 的一些代码,例如 Windows 静态构建目标和 libiconv 支持。
lwmbs 使用 [Mulan PSL 2](http://license.coscl.org.cn/MulanPSL2) 许可进行分发。对应文件有关于作者和许可的特殊说明,除此之外,均使用 MIT 授权许可
项目使用了 [dixyes/lwmbs](https://github.com/dixyes/lwmbs) 的一些代码,例如 Windows 静态构建目标和 libiconv 支持。
lwmbs 基于 [Mulan PSL 2](http://license.coscl.org.cn/MulanPSL2) 许可
本项目的特殊性,使用项目编译过程中会使用很多其他开源项目,例如 curl、protobuf 等,它们都有各自的开源协议。
请在编译完成后,使用命令 `bin/spc dump-license` 导出项目使用项目的开源协议,并遵守对应项目的 LICENSE。
由于本项目的特殊性,
项目编译过程中会使用许多其他开源项目,如 curl 和 protobuf
它们都有自己的开源许可证。
请在编译后使用 `bin/spc dump-license` 命令导出项目中使用的开源许可证,
并遵守相应项目的 LICENSE。

330
README.md
View File

@@ -5,29 +5,22 @@
[![Releases](https://img.shields.io/packagist/v/crazywhalecc/static-php-cli?include_prereleases&label=Release&style=flat-square)](https://github.com/crazywhalecc/static-php-cli/releases)
[![CI](https://img.shields.io/github/actions/workflow/status/crazywhalecc/static-php-cli/tests.yml?branch=main&label=Build%20Test&style=flat-square)](https://github.com/crazywhalecc/static-php-cli/actions/workflows/tests.yml)
[![License](https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square)](https://github.com/crazywhalecc/static-php-cli/blob/main/LICENSE)
[![Extensions](https://img.shields.io/badge/Extension%20Counter-75+-yellow.svg?style=flat-square)](https://static-php.dev/en/guide/extensions.html)
**static-php-cli** is a powerful tool designed for building static, standalone PHP runtime
with popular extensions.
Static PHP built by **static-php-cli** supports `cli`, `fpm`, `embed` and `micro` SAPI.
**static-php-cli** also has the ability to package PHP projects
along with the PHP interpreter into one single executable file.
## Features
static-php-cli (you can call it `spc`) has a lot of features:
- :handbag: Build single-file php executable, without any dependencies
- :hamburger: Build **[phpmicro](https://github.com/dixyes/phpmicro)** self-extracted executable (glue php binary and php source code into one file)
- :pill: Automatic build environment checker (Doctor module)
- :elephant: Support multiple PHP versions - PHP 8.1, 8.2, 8.3, 8.4, 8.5
- :handbag: Build single-file PHP executable with zero dependencies
- :hamburger:Build **[phpmicro](https://github.com/dixyes/phpmicro)** self-extracting executables (combines PHP binary and source code into one file)
- :pill: Automatic build environment checker with auto-fix capabilities
- :zap: `Linux`, `macOS`, `FreeBSD`, `Windows` support
- :wrench: Configurable source code patches
- :books: Build dependency management
- 📦 Provide `spc` own standalone executable (built by spc and [box](https://github.com/box-project/box))
- :fire: Support many popular [extensions](https://static-php.dev/en/guide/extensions.html)
- :floppy_disk: UPX integration (significantly reduces binary size)
- :wrench: Configurable source code patching
- :books: Intelligent dependency management
- 📦 Self-contained `spc` executable (built with [box](https://github.com/box-project/box))
- :fire: Support 100+ popular [extensions](https://static-php.dev/en/guide/extensions.html)
- :floppy_disk: UPX compression support (reduces binary size by 30-50%)
**Single-file standalone php-cli:**
@@ -37,6 +30,72 @@ static-php-cli (you can call it `spc`) has a lot of features:
<img width="700" alt="out2" src="https://github.com/crazywhalecc/static-php-cli/assets/20330940/46b7128d-fb72-4169-957e-48564c3ff3e2">
## Quickstart
### 1. Download spc binary
```bash
# For Linux x86_64
curl -fsSL -o spc https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-linux-x86_64
# For Linux aarch64
curl -fsSL -o spc https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-linux-aarch64
# macOS x86_64 (Intel)
curl -fsSL -o spc https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-macos-x86_64
# macOS aarch64 (Apple)
curl -fsSL -o spc https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-macos-aarch64
# Windows (x86_64, win10 build 17063 or later, please install VS2022 first)
curl.exe -fsSL -o spc.exe https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-windows-x64.exe
```
For macOS and Linux, add execute permission first:
```bash
chmod +x ./spc
```
### 2. Build Static PHP
First, create a `craft.yml` file and specify which extensions you want to include from [extension list](https://static-php.dev/en/guide/extensions.html) or [command generator](https://static-php.dev/en/guide/cli-generator.html):
```yml
# PHP version support: 8.1, 8.2, 8.3, 8.4, 8.5
php-version: 8.4
# Put your extension list here
extensions: "apcu,bcmath,calendar,ctype,curl,dba,dom,exif,fileinfo,filter,gd,iconv,mbregex,mbstring,mysqli,mysqlnd,opcache,openssl,pcntl,pdo,pdo_mysql,pdo_sqlite,phar,posix,readline,redis,session,simplexml,sockets,sodium,sqlite3,tokenizer,xml,xmlreader,xmlwriter,xsl,zip,zlib"
sapi:
- cli
- micro
- fpm
download-options:
prefer-pre-built: true
```
Run command:
```bash
./spc craft
# Output full console log
./spc craft --debug
```
### 3. Static PHP usage
Now you can copy binaries built by static-php-cli to another machine and run with no dependencies:
```
# php-cli
buildroot/bin/php -v
# phpmicro
echo '<?php echo "Hello world!\n";' > a.php
./spc micro:combine a.php -O my-app
./my-app
# php-fpm
buildroot/bin/php-fpm -v
```
## Documentation
The current README contains basic usage. For all the features of static-php-cli,
@@ -53,6 +112,7 @@ which can be downloaded directly according to your needs.
|----------------------------------------------------------------------|----------------------------------------------------------------------------|--------------|--------------------------------|
| [common](https://dl.static-php.dev/static-php-cli/common/) | [30+](https://dl.static-php.dev/static-php-cli/common/README.txt) | Linux, macOS | The binary size is about 7.5MB |
| [bulk](https://dl.static-php.dev/static-php-cli/bulk/) | [50+](https://dl.static-php.dev/static-php-cli/bulk/README.txt) | Linux, macOS | The binary size is about 25MB |
| [gnu-bulk](https://dl.static-php.dev/static-php-cli/gnu-bulk/) | [50+](https://dl.static-php.dev/static-php-cli/bulk/README.txt) | Linux, macOS | Using shared glibc |
| [minimal](https://dl.static-php.dev/static-php-cli/minimal/) | [5](https://dl.static-php.dev/static-php-cli/minimal/README.txt) | Linux, macOS | The binary size is about 3MB |
| [spc-min](https://dl.static-php.dev/static-php-cli/windows/spc-min/) | [5](https://dl.static-php.dev/static-php-cli/windows/spc-min/README.txt) | Windows | The binary size is about 3MB |
| [spc-max](https://dl.static-php.dev/static-php-cli/windows/spc-max/) | [40+](https://dl.static-php.dev/static-php-cli/windows/spc-max/README.txt) | Windows | The binary size is about 8.5MB |
@@ -60,60 +120,10 @@ which can be downloaded directly according to your needs.
> Linux and Windows supports UPX compression for binaries, which can reduce the size of the binary by 30% to 50%.
> macOS does not support UPX compression, so the size of the pre-built binaries for mac is larger.
## Build
### Compilation Requirements
You can say I made a PHP builder written in PHP, pretty funny.
But static-php-cli runtime only requires an environment above PHP 8.1 and extensions mentioned below.
- PHP >= 8.1 (This is the version required by spc itself, not the build version)
- Extension: `mbstring,tokenizer,phar`
- Supported OS with `curl` and `git` installed
Here is the supported OS and arch, where :octocat: represents support for GitHub Action builds,
:computer: represents support for local manual builds, and blank represents not currently supported.
| | x86_64 | aarch64 |
|---------|----------------------|----------------------|
| macOS | :octocat: :computer: | :octocat: :computer: |
| Linux | :octocat: :computer: | :octocat: :computer: |
| Windows | :octocat: :computer: | |
| FreeBSD | :computer: | :computer: |
Currently supported PHP versions for compilation:
> :warning: supported but not maintained by static-php-cli authors
>
> :heavy_check_mark: supported
>
> :x: not supported
| PHP Version | Status | Comment |
|-------------|--------------------|---------------------------------------------------|
| 7.2 | :x: | |
| 7.3 | :warning: | phpmicro and some extensions not supported on 7.x |
| 7.4 | :warning: | phpmicro and some extensions not supported on 7.x |
| 8.0 | :heavy_check_mark: | PHP official has stopped maintenance of 8.0 |
| 8.1 | :heavy_check_mark: | PHP official has security fixes only |
| 8.2 | :heavy_check_mark: | |
| 8.3 | :heavy_check_mark: | |
| 8.4 | :x: | WIP |
### Supported Extensions
Please first select the extension you want to compile based on the extension list below.
- [Supported Extension List](https://static-php.dev/en/guide/extensions.html)
- [Command Generator](https://static-php.dev/en/guide/cli-generator.html)
> If an extension you need is missing, you can submit an issue.
Here is the current planned roadmap for extension support: [#152](https://github.com/crazywhalecc/static-php-cli/issues/152) .
### Build Online (using GitHub Actions)
Use GitHub Action to easily build a statically compiled PHP,
When the above direct download binaries cannot meet your needs,
you can use GitHub Action to easily build a statically compiled PHP,
and at the same time define the extensions to be compiled by yourself.
1. Fork me.
@@ -123,182 +133,6 @@ and at the same time define the extensions to be compiled by yourself.
If you enable `debug`, all logs will be output at build time, including compiled logs, for troubleshooting.
### Build Locally (using SPC binary, recommended)
This project provides a binary file of static-php-cli: `spc`.
You can use `spc` binary instead of installing any runtime like golang app.
Currently, the platforms supported by `spc` binary are Linux and macOS.
Download from self-hosted nightly builds using commands below:
```bash
# Download from self-hosted nightly builds (sync with main branch)
# For Linux x86_64
curl -fsSL -o spc https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-linux-x86_64
# For Linux aarch64
curl -fsSL -o spc https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-linux-aarch64
# macOS x86_64 (Intel)
curl -fsSL -o spc https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-macos-x86_64
# macOS aarch64 (Apple)
curl -fsSL -o spc https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-macos-aarch64
# Windows (x86_64, win10 build 17063 or later)
curl.exe -fsSL -o spc.exehttps://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-windows-x64.exe
# Add execute perm (Linux and macOS only)
chmod +x ./spc
# Run (Linux and macOS)
./spc --version
# Run (Windows powershell)
.\spc.exe --version
```
Self-hosted `spc` is built by GitHub Actions, you can also download from Actions artifacts [here](https://github.com/crazywhalecc/static-php-cli/actions/workflows/release-build.yml).
### Build Locally (using git source)
If you need to modify the static-php-cli source code, or have problems using the spc binary build,
you can download static-php-cli using the git source code.
```bash
# just clone me!
git clone https://github.com/crazywhalecc/static-php-cli.git
```
If you have not installed php on your system, we recommend that you use the built-in setup-runtime to install PHP and Composer automatically.
```bash
cd static-php-cli
chmod +x bin/setup-runtime
# it will download static php (from self-hosted server) and composer (from getcomposer)
bin/setup-runtime
# initialize composer deps
bin/composer install
# chmod
chmod +x bin/spc
bin/spc --version
```
### Start Building PHP
Basic usage for building php with some extensions:
> If you are using the packaged standalone `spc` binary, you need to replace `bin/spc` with `./spc` or `.\spc.exe` in the following commands.
```bash
# Check system tool dependencies, auto-fix them if possible
./bin/spc doctor --auto-fix
# fetch all libraries
./bin/spc download --all
# only fetch necessary sources by needed extensions (recommended)
./bin/spc download --for-extensions="openssl,pcntl,mbstring,pdo_sqlite"
# download pre-built libraries first (save time for compiling dependencies)
./bin/spc download --for-extensions="openssl,curl,mbstring,mbregex" --prefer-pre-built
# download different PHP version (--with-php=x.y, recommend 7.3 ~ 8.3)
./bin/spc download --for-extensions="openssl,curl,mbstring" --with-php=8.1
# with bcmath,openssl,tokenizer,sqlite3,pdo_sqlite,ftp,curl extension, build both CLI and phpmicro SAPI
./bin/spc build "bcmath,openssl,tokenizer,sqlite3,pdo_sqlite,ftp,curl" --build-cli --build-micro
# build thread-safe (ZTS) version (--enable-zts)
./bin/spc build "curl,phar" --enable-zts --build-cli
# build, pack executable with UPX (linux and windows only) (reduce binary size for 30~50%)
./bin/spc build "curl,phar" --enable-zts --build-cli --with-upx-pack
```
Now we support `cli`, `micro`, `fpm` and `embed` SAPI. You can use one or more of the following parameters to specify the compiled SAPI:
- `--build-cli`: build static cli executable
- `--build-micro`: build static phpmicro self-extracted executable
- `--build-fpm`: build static fpm binary
- `--build-embed`: build embed (libphp)
- `--build-all`: build all
If anything goes wrong, use `--debug` option to display full terminal output:
```bash
./bin/spc build "openssl,pcntl,mbstring" --debug --build-all
./bin/spc download --all --debug
```
## Different SAPI Usage
### Use cli
> php-cli is a single static binary, you can use it like normal php installed on your system.
When using the parameter `--build-cli` or `--build-all`,
the final compilation result will output a binary file named `./php`,
which can be distributed and used directly.
This file will be located in the directory `buildroot/bin/`, copy it out for use.
```bash
cd buildroot/bin/
./php -v # check version
./php -m # check extensions
./php your_code.php # run your php code
./php your_project.phar # run your phar (project archive)
```
### Use micro
> phpmicro is a SelF-extracted eXecutable SAPI module,
> provided by [phpmicro](https://github.com/dixyes/phpmicro) project.
> But this project is using a [fork](https://github.com/static-php/phpmicro) of phpmicro, because we need to add some features to it.
> It can put php runtime and your source code together.
When using the parameter `--build-all` or `--build-micro`,
the final compilation result will output a file named `./micro.sfx`,
which needs to be used with your PHP source code like `code.php`.
This file will be located in the path `buildroot/bin/micro.sfx`, simply copy it out for use.
Prepare your project source code, which can be a single PHP file or a Phar file, for use.
```bash
echo "<?php echo 'Hello world' . PHP_EOL;" > code.php
cat micro.sfx code.php > single-app && chmod +x single-app
./single-app
```
If you package a PHAR file, just replace `code.php` with the phar file path.
You can use [box-project/box](https://github.com/box-project/box) to package your CLI project as Phar,
It is then combined with phpmicro to produce a standalone executable binary.
```bash
# Use the micro.sfx generated by static-php-cli to combine,
bin/spc micro:combine my-app.phar
# or you can directly use the cat command to combine them.
cat buildroot/bin/micro.sfx my-app.phar > my-app && chmod +x my-app
# Use micro:combine combination to inject INI options into the binary.
bin/spc micro:combine my-app.phar -I "memory_limit=4G" -I "disable_functions=system" --output my-app-2
```
> In some cases, PHAR files may not run in a micro environment. Overall, micro is not production ready.
### Use fpm
When using the parameter `--build-all` or `--build-fpm`,
the final compilation result will output a file named `./php-fpm`,
This file will be located in the path `buildroot/bin/`, simply copy it out for use.
In common Linux distributions and macOS systems, the package manager will automatically generate a default fpm configuration file after installing php-fpm.
Because php-fpm must specify a configuration file before running, the php-fpm compiled by this project will not have any configuration files, so you need to write `php-fpm.conf` and `pool.conf` configuration files yourself.
Specifying `php-fpm.conf` can use the command parameter `-y`, for example: `./php-fpm -y php-fpm.conf`.
### Use embed
When using the project parameters `--build-embed` or `--build-all`,
the final compilation result will output a `libphp.a`, `php-config` and a series of header files,
stored in `buildroot/`. You can introduce them in your other projects.
If you know [embed SAPI](https://github.com/php/php-src/tree/master/sapi/embed), you should know how to use it.
You may require the introduction of other libraries during compilation,
you can use `buildroot/bin/php-config` to obtain the compile-time configuration.
For an advanced example of how to use this feature, take a look at [how to use it to build a static version of FrankenPHP](https://github.com/dunglas/frankenphp/blob/main/docs/static.md).
## Contribution
If the extension you need is missing, you can create an issue.
@@ -310,7 +144,13 @@ Now there is a [static-php](https://github.com/static-php) organization, which i
## Sponsor this project
You can sponsor my project on [this page](https://github.com/crazywhalecc/crazywhalecc/blob/master/FUNDING.md). A portion of your donation will be used to maintain the **static-php.dev** server.
You can sponsor me or my project from [GitHub Sponsor](https://github.com/crazywhalecc). A portion of your donation will be used to maintain the **static-php.dev** server.
**Special thanks to sponsors below**:
<a href="https://beyondco.de/"><img src="/docs/public/images/beyondcode-seeklogo.png" width="300" alt="Beyond Code Logo" /></a>
<a href="https://nativephp.com/"><img src="/docs/public/images/nativephp-logo.svg" width="300" alt="NativePHP Logo" /></a>
## Open-Source License

11
bin/docker-entrypoint.sh Normal file
View File

@@ -0,0 +1,11 @@
#!/usr/bin/env bash
set -e
TARGET_DIR="/app/pkgroot/$(uname -m)-linux"
BACKUP_DIR="/app/pkgroot-private"
# copy private pkgroot to pkgroot if pkgroot is empty
if [ ! -d "$TARGET_DIR" ] || [ -z "$(ls -A "$TARGET_DIR")" ]; then
echo "* Copying private pkgroot to pkgroot ..."
rm -rf "$TARGET_DIR"
cp -r "$BACKUP_DIR" "$TARGET_DIR"
fi
exec "$@"

View File

@@ -25,7 +25,7 @@ __DIR__=$(cd "$(dirname "$0")" && pwd)
__PROJECT__=$(cd "${__DIR__}"/../ && pwd)
# set download dir
__PHP_RUNTIME_URL__="https://dl.static-php.dev/static-php-cli/bulk/php-8.2.13-cli-${__OS_FIXED__}-${__ARCH__}.tar.gz"
__PHP_RUNTIME_URL__="https://dl.static-php.dev/static-php-cli/bulk/php-8.4.12-cli-${__OS_FIXED__}-${__ARCH__}.tar.gz"
__COMPOSER_URL__="https://getcomposer.org/download/latest-stable/composer.phar"
# use china mirror
@@ -45,7 +45,7 @@ done
case "$mirror" in
china)
__PHP_RUNTIME_URL__="https://dl.static-php.dev/static-php-cli/bulk/php-8.2.13-cli-${__OS_FIXED__}-${__ARCH__}.tar.gz"
__PHP_RUNTIME_URL__="https://dl.static-php.dev/static-php-cli/bulk/php-8.4.12-cli-${__OS_FIXED__}-${__ARCH__}.tar.gz"
__COMPOSER_URL__="https://mirrors.tencent.com/composer/composer.phar"
;;
@@ -61,7 +61,7 @@ test -f "${__PROJECT__}"/downloads/runtime.tar.gz || { echo "Downloading $__PHP_
test -f "${__DIR__}"/php || { tar -xf "${__PROJECT__}"/downloads/runtime.tar.gz -C "${__DIR__}"/ ; }
chmod +x "${__DIR__}"/php
# download composer
test -f "${__DIR__}"/composer || curl -#fSL -o "${__DIR__}"/composer "$__COMPOSER_URL__"
test -f "${__DIR__}"/composer || { echo "Downloading Composer from $__COMPOSER_URL__" && curl -#fSL -o "${__DIR__}"/composer "$__COMPOSER_URL__" ; }
chmod +x "${__DIR__}"/composer
# sanity check for php and composer
"${__DIR__}"/php -v >/dev/null || { echo "Failed to run php" && exit 1; }

View File

@@ -51,10 +51,11 @@ if ($action -eq 'add-path') {
}
# get php 8.1 specific version
$API = (Invoke-WebRequest -Uri "https://www.php.net/releases/index.php?json&version=8.1") | ConvertFrom-Json
# php windows download
$PHPRuntimeUrl = "https://windows.php.net/downloads/releases/php-" + $API.version + "-Win32-vs16-x64.zip"
$PHPRuntimeUrl = "https://windows.php.net/downloads/releases/archives/php-8.4.4-nts-Win32-vs17-x64.zip"
Write-Host "Downloading PHP from: " -NoNewline
Write-Host $PHPRuntimeUrl -ForegroundColor Cyan
$ComposerUrl = "https://getcomposer.org/download/latest-stable/composer.phar"
# create dir

10
bin/spc
View File

@@ -4,6 +4,11 @@
use SPC\ConsoleApplication;
use SPC\exception\ExceptionHandler;
// Load custom php if exists
if (PHP_OS_FAMILY !== 'Windows' && PHP_BINARY !== (__DIR__ . '/php') && file_exists(__DIR__ . '/php') && is_executable(__DIR__ . '/php')) {
pcntl_exec(__DIR__ . '/php', $argv);
}
if (file_exists(dirname(__DIR__) . '/vendor/autoload.php')) {
// Current: ./bin (git/project mode)
require_once dirname(__DIR__) . '/vendor/autoload.php';
@@ -17,6 +22,11 @@ if (PHP_OS_FAMILY === 'Windows' && Phar::running()) {
exec('CHCP 65001');
}
// Print deprecation notice on PHP < 8.4, use red and highlight background
if (PHP_VERSION_ID < 80400) {
echo "\e[43mDeprecation Notice: PHP < 8.4 is deprecated, please upgrade your PHP version.\e[0m\n";
}
try {
(new ConsoleApplication())->run();
} catch (Exception $e) {

View File

@@ -1,11 +1,14 @@
#!/usr/bin/env sh
#!/usr/bin/env bash
set -e
# This file is using docker to run commands
SPC_DOCKER_VERSION=v6
# Detect docker can run
if ! which docker >/dev/null; then
echo "Docker is not installed, please install docker first !"
exit 1
echo "Docker is not installed, please install docker first !"
exit 1
fi
DOCKER_EXECUTABLE="docker"
# shellcheck disable=SC2046
@@ -21,27 +24,48 @@ if [ $(id -u) -ne 0 ]; then
fi
fi
# to check if qemu-docker run
if [ "$SPC_USE_ARCH" = "" ]; then
SPC_USE_ARCH=x86_64
# Convert uname to gnu arch
CURRENT_ARCH=$(uname -m)
if [ "$CURRENT_ARCH" = "arm64" ]; then
CURRENT_ARCH=aarch64
fi
if [ -z "$SPC_USE_ARCH" ]; then
SPC_USE_ARCH=$CURRENT_ARCH
fi
# parse SPC_USE_ARCH
case $SPC_USE_ARCH in
x86_64)
ALPINE_FROM=alpine:edge
x86_64|amd64)
SPC_USE_ARCH=x86_64
if [ "$CURRENT_ARCH" != "x86_64" ]; then
PLATFORM_ARG="--platform linux/amd64"
ALPINE_FROM=multiarch/alpine:x86_64-edge
fi
;;
aarch64)
ALPINE_FROM=multiarch/alpine:aarch64-edge
# shellcheck disable=SC2039
echo -e "\e[033m* Using different arch needs to setup qemu-static for docker !\e[0m"
$DOCKER_EXECUTABLE run --rm --privileged multiarch/qemu-user-static:register --reset > /dev/null
aarch64|arm64)
SPC_USE_ARCH=aarch64
if [ "$CURRENT_ARCH" != "aarch64" ]; then
PLATFORM_ARG="--platform linux/arm64"
ALPINE_FROM=multiarch/alpine:aarch64-edge
fi
;;
*)
echo "Current arch is not supported to run in docker: $SPC_USE_ARCH"
exit 1
;;
esac
# if ALPINE_FROM is not set, use alpine:3.21
if [ -z "$ALPINE_FROM" ]; then
ALPINE_FROM=alpine:3.21
fi
if [ "$SPC_USE_ARCH" != "$CURRENT_ARCH" ]; then
echo "* Using different arch needs to setup qemu-static for docker !"
ALPINE_FROM=multiarch/alpine:$SPC_USE_ARCH-edge
if [ "$(uname -s)" = "Linux" ]; then
$DOCKER_EXECUTABLE run --rm --privileged multiarch/qemu-user-static:register --reset > /dev/null
fi
else
ALPINE_FROM=alpine:3.21
fi
if [ "$SPC_USE_MIRROR" = "yes" ]; then
SPC_USE_MIRROR="RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories"
@@ -50,9 +74,9 @@ else
fi
# Detect docker env is setup
if ! $DOCKER_EXECUTABLE images | grep -q cwcc-spc-$SPC_USE_ARCH; then
if ! $DOCKER_EXECUTABLE images | grep -q cwcc-spc-$SPC_USE_ARCH-$SPC_DOCKER_VERSION; then
echo "Docker container does not exist. Building docker image ..."
$DOCKER_EXECUTABLE build -t cwcc-spc-$SPC_USE_ARCH -f- . <<EOF
$DOCKER_EXECUTABLE build $PLATFORM_ARG -t cwcc-spc-$SPC_USE_ARCH-$SPC_DOCKER_VERSION -f- . <<EOF
FROM $ALPINE_FROM
$SPC_USE_MIRROR
RUN apk update; \
@@ -79,26 +103,32 @@ RUN apk update; \
linux-headers \
m4 \
make \
php82 \
php82-common \
php82-pcntl \
php82-phar \
php82-posix \
php82-sodium \
php82-tokenizer \
php82-dom \
php82-xml \
php82-xmlwriter \
composer \
pkgconfig \
re2c \
wget \
xz
xz \
gettext-dev \
binutils-gold
RUN curl -#fSL https://dl.static-php.dev/static-php-cli/bulk/php-8.4.4-cli-linux-\$(uname -m).tar.gz | tar -xz -C /usr/local/bin && \
chmod +x /usr/local/bin/php
RUN curl -#fSL https://getcomposer.org/download/latest-stable/composer.phar -o /usr/local/bin/composer && \
chmod +x /usr/local/bin/composer
WORKDIR /app
ADD ./src /app/src
COPY ./composer.* /app/
ADD ./bin /app/bin
RUN composer install --no-dev --classmap-authoritative
RUN composer install --no-dev
ADD ./config /app/config
RUN bin/spc doctor --auto-fix
RUN bin/spc install-pkg upx
RUN mv /app/pkgroot/\$(uname -m)-linux /app/pkgroot-private
ADD bin/docker-entrypoint.sh /bin/docker-entrypoint.sh
RUN chmod +x /bin/docker-entrypoint.sh
ENTRYPOINT ["/bin/docker-entrypoint.sh"]
EOF
fi
@@ -119,9 +149,79 @@ MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/source:/app/source"
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/dist:/app/dist"
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/downloads:/app/downloads"
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/pkgroot:/app/pkgroot"
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/log:/app/log"
if [ -f "$(pwd)/craft.yml" ]; then
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/craft.yml:/app/craft.yml"
fi
# Environment variable passthrough
ENV_LIST=""
ENV_LIST="$ENV_LIST -e SPC_FIX_DEPLOY_ROOT="$(pwd)""
if [ ! -z "$GITHUB_TOKEN" ]; then
ENV_LIST="$ENV_LIST -e GITHUB_TOKEN=$GITHUB_TOKEN"
fi
# Intercept and rewrite --with-frankenphp-app option, and mount host path to /app/app
FRANKENPHP_APP_PATH=""
NEW_ARGS=()
while [ $# -gt 0 ]; do
case "$1" in
--with-frankenphp-app=*)
FRANKENPHP_APP_PATH="${1#*=}"
NEW_ARGS+=("--with-frankenphp-app=/app/app")
shift
;;
--with-frankenphp-app)
if [ -n "${2:-}" ]; then
FRANKENPHP_APP_PATH="$2"
NEW_ARGS+=("--with-frankenphp-app=/app/app")
shift 2
else
NEW_ARGS+=("$1")
shift
fi
;;
*)
NEW_ARGS+=("$1")
shift
;;
esac
done
# Normalize the path and add mount if provided
if [ -n "$FRANKENPHP_APP_PATH" ]; then
# expand ~ to $HOME
if [ "${FRANKENPHP_APP_PATH#~}" != "$FRANKENPHP_APP_PATH" ]; then
FRANKENPHP_APP_PATH="$HOME${FRANKENPHP_APP_PATH#~}"
fi
# make absolute if relative
case "$FRANKENPHP_APP_PATH" in
/*) ABS_APP_PATH="$FRANKENPHP_APP_PATH" ;;
*) ABS_APP_PATH="$(pwd)/$FRANKENPHP_APP_PATH" ;;
esac
MOUNT_LIST="$MOUNT_LIST -v $ABS_APP_PATH:/app/app"
fi
# Run docker
# shellcheck disable=SC2068
# shellcheck disable=SC2086
# shellcheck disable=SC2090
$DOCKER_EXECUTABLE run --rm $INTERACT -e SPC_FIX_DEPLOY_ROOT="$(pwd)" $MOUNT_LIST cwcc-spc-$SPC_USE_ARCH bin/spc $@
if [ "$SPC_DOCKER_DEBUG" = "yes" ]; then
echo "* Debug mode enabled, run docker in interactive mode."
echo "* You can use 'exit' to exit the docker container."
echo "* You can use 'bin/spc' like normal builds."
echo "*"
echo "* Mounted directories:"
echo "* ./config: $(pwd)/config"
echo "* ./src: $(pwd)/src"
echo "* ./buildroot: $(pwd)/buildroot"
echo "* ./source: $(pwd)/source"
echo "* ./dist: $(pwd)/dist"
echo "* ./downloads: $(pwd)/downloads"
echo "* ./pkgroot: $(pwd)/pkgroot"
echo "*"
set -ex
$DOCKER_EXECUTABLE run $PLATFORM_ARG --rm $INTERACT $ENV_LIST $MOUNT_LIST cwcc-spc-$SPC_USE_ARCH-$SPC_DOCKER_VERSION /bin/bash
else
$DOCKER_EXECUTABLE run $PLATFORM_ARG --rm $INTERACT $ENV_LIST $MOUNT_LIST cwcc-spc-$SPC_USE_ARCH-$SPC_DOCKER_VERSION bin/spc "${NEW_ARGS[@]}"
fi

236
bin/spc-gnu-docker Executable file
View File

@@ -0,0 +1,236 @@
#!/usr/bin/env bash
set -e
# This file is using docker to run commands
SPC_DOCKER_VERSION=v6
# Detect docker can run
if ! which docker >/dev/null; then
echo "Docker is not installed, please install docker first !"
exit 1
fi
DOCKER_EXECUTABLE="docker"
# shellcheck disable=SC2046
if [ $(id -u) -ne 0 ]; then
if ! docker info > /dev/null 2>&1; then
if [ "$SPC_USE_SUDO" != "yes" ] && [ "$SPC_DOCKER_DEBUG" != "yes" ]; then
echo "Docker command requires sudo"
# shellcheck disable=SC2039
echo -n 'To use sudo to run docker, run "export SPC_USE_SUDO=yes" and run command again'
exit 1
fi
DOCKER_EXECUTABLE="sudo docker"
fi
fi
# Convert uname to gnu arch
CURRENT_ARCH=$(uname -m)
if [ "$CURRENT_ARCH" = "arm64" ]; then
CURRENT_ARCH=aarch64
fi
if [ -z "$SPC_USE_ARCH" ]; then
SPC_USE_ARCH=$CURRENT_ARCH
fi
# parse SPC_USE_ARCH
case $SPC_USE_ARCH in
x86_64|amd64)
SPC_USE_ARCH=x86_64
SPC_USE_ARCH_DOCKER=amd64
if [ "$CURRENT_ARCH" != "x86_64" ]; then
PLATFORM_ARG="--platform linux/amd64"
fi
;;
aarch64|arm64)
SPC_USE_ARCH=aarch64
SPC_USE_ARCH_DOCKER=arm64
if [ "$CURRENT_ARCH" != "aarch64" ]; then
PLATFORM_ARG="--platform linux/arm64"
fi
;;
*)
echo "Current arch is not supported to run in docker: $SPC_USE_ARCH"
exit 1
;;
esac
# detect if we need to use qemu-static
if [ "$SPC_USE_ARCH" != "$CURRENT_ARCH" ]; then
if [ "$(uname -s)" = "Linux" ]; then
echo "* Using different arch needs to setup qemu-static for docker !"
$DOCKER_EXECUTABLE run --rm --privileged multiarch/qemu-user-static --reset -p yes > /dev/null
fi
fi
# Detect docker env is setup
if ! $DOCKER_EXECUTABLE images | grep -q cwcc-spc-gnu-$SPC_USE_ARCH-$SPC_DOCKER_VERSION; then
echo "Docker container does not exist. Building docker image ..."
$DOCKER_EXECUTABLE buildx build $PLATFORM_ARG -t cwcc-spc-gnu-$SPC_USE_ARCH-$SPC_DOCKER_VERSION -f- . <<EOF
FROM centos:7
RUN sed -i 's/mirror.centos.org/vault.centos.org/g' /etc/yum.repos.d/*.repo && \
sed -i 's/^#.*baseurl=http/baseurl=http/g' /etc/yum.repos.d/*.repo && \
sed -i 's/^mirrorlist=http/#mirrorlist=http/g' /etc/yum.repos.d/*.repo
RUN yum clean all && \
yum makecache && \
yum update -y && \
localedef -c -i en_US -f UTF-8 en_US.UTF-8
RUN yum install -y centos-release-scl
RUN if [ "$SPC_USE_ARCH" = "aarch64" ]; then \
sed -i 's|mirror.centos.org/centos|vault.centos.org/altarch|g' /etc/yum.repos.d/CentOS-SCLo-scl-rh.repo ; \
sed -i 's|mirror.centos.org/centos|vault.centos.org/altarch|g' /etc/yum.repos.d/CentOS-SCLo-scl.repo ; \
else \
sed -i 's/mirror.centos.org/vault.centos.org/g' /etc/yum.repos.d/*.repo ; \
fi
RUN sed -i 's/^#.*baseurl=http/baseurl=http/g' /etc/yum.repos.d/*.repo && \
sed -i 's/^mirrorlist=http/#mirrorlist=http/g' /etc/yum.repos.d/*.repo && \
sed -i 's|http://|https://|g' /etc/yum.repos.d/*.repo
RUN yum update -y && \
yum install -y devtoolset-10-gcc-* devtoolset-10-libatomic-devel
RUN echo "source scl_source enable devtoolset-10" >> /etc/bashrc
RUN source /etc/bashrc
RUN yum install -y which
RUN curl -o cmake.tgz -#fSL https://github.com/Kitware/CMake/releases/download/v3.31.4/cmake-3.31.4-linux-$SPC_USE_ARCH.tar.gz && \
mkdir /cmake && \
tar -xzf cmake.tgz -C /cmake --strip-components 1
WORKDIR /app
COPY ./composer.* /app/
ADD ./bin/setup-runtime /app/bin/setup-runtime
ADD ./bin/spc /app/bin/spc
RUN /app/bin/setup-runtime
ADD ./src /app/src
RUN /app/bin/php /app/bin/composer install --no-dev
ENV SPC_LIBC=glibc
ENV PATH="/app/bin:/cmake/bin:/opt/rh/devtoolset-10/root/usr/bin:\$PATH"
ADD ./config /app/config
RUN CC=gcc bin/spc doctor --auto-fix --debug
RUN bin/spc install-pkg upx
RUN if [ -f /app/buildroot/bin/re2c ]; then \
cp /app/buildroot/bin/re2c /usr/local/bin/re2c ;\
fi
RUN curl -o make.tgz -fsSL https://ftp.gnu.org/gnu/make/make-4.4.tar.gz && \
tar -zxvf make.tgz && \
cd make-4.4 && \
./configure && \
make && \
make install && \
ln -sf /usr/local/bin/make /usr/bin/make
RUN curl -o automake.tgz -fsSL https://ftp.gnu.org/gnu/automake/automake-1.17.tar.xz && \
tar -xvf automake.tgz && \
cd automake-1.17 && \
./configure && \
make && \
make install && \
ln -sf /usr/local/bin/automake /usr/bin/automake
RUN mv /app/pkgroot/\$(uname -m)-linux /app/pkgroot-private
ADD bin/docker-entrypoint.sh /bin/docker-entrypoint.sh
RUN chmod +x /bin/docker-entrypoint.sh
ENTRYPOINT ["/bin/docker-entrypoint.sh"]
EOF
fi
# Check if in ci (local terminal can execute with -it)
if [ -t 0 ]; then
INTERACT=-it
else
INTERACT=''
fi
# Mounting volumes
MOUNT_LIST=""
# shellcheck disable=SC2089
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/config:/app/config"
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/src:/app/src"
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/buildroot:/app/buildroot"
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/source:/app/source"
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/dist:/app/dist"
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/downloads:/app/downloads"
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/pkgroot:/app/pkgroot"
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/log:/app/log"
if [ -f "$(pwd)/craft.yml" ]; then
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/craft.yml:/app/craft.yml"
fi
# Apply env in temp env file
echo 'SPC_DEFAULT_C_FLAGS=-fPIC' > /tmp/spc-gnu-docker.env
echo 'SPC_LIBC=glibc' >> /tmp/spc-gnu-docker.env
# Environment variable passthrough
ENV_LIST=""
ENV_LIST="$ENV_LIST -e SPC_FIX_DEPLOY_ROOT="$(pwd)""
if [ ! -z "$GITHUB_TOKEN" ]; then
ENV_LIST="$ENV_LIST -e GITHUB_TOKEN=$GITHUB_TOKEN"
fi
# Intercept and rewrite --with-frankenphp-app option, and mount host path to /app/app
FRANKENPHP_APP_PATH=""
NEW_ARGS=()
while [ $# -gt 0 ]; do
case "$1" in
--with-frankenphp-app=*)
FRANKENPHP_APP_PATH="${1#*=}"
NEW_ARGS+=("--with-frankenphp-app=/app/app")
shift
;;
--with-frankenphp-app)
if [ -n "${2:-}" ]; then
FRANKENPHP_APP_PATH="$2"
NEW_ARGS+=("--with-frankenphp-app=/app/app")
shift 2
else
NEW_ARGS+=("$1")
shift
fi
;;
*)
NEW_ARGS+=("$1")
shift
;;
esac
done
# Normalize the path and add mount if provided
if [ -n "$FRANKENPHP_APP_PATH" ]; then
# expand ~ to $HOME
if [ "${FRANKENPHP_APP_PATH#~}" != "$FRANKENPHP_APP_PATH" ]; then
FRANKENPHP_APP_PATH="$HOME${FRANKENPHP_APP_PATH#~}"
fi
# make absolute if relative
case "$FRANKENPHP_APP_PATH" in
/*) ABS_APP_PATH="$FRANKENPHP_APP_PATH" ;;
*) ABS_APP_PATH="$(pwd)/$FRANKENPHP_APP_PATH" ;;
esac
MOUNT_LIST="$MOUNT_LIST -v $ABS_APP_PATH:/app/app"
fi
# Run docker
# shellcheck disable=SC2068
# shellcheck disable=SC2086
# shellcheck disable=SC2090
if [ "$SPC_DOCKER_DEBUG" = "yes" ]; then
echo "* Debug mode enabled, run docker in interactive mode."
echo "* You can use 'exit' to exit the docker container."
echo "* You can use 'bin/spc' like normal builds."
echo "*"
echo "* Mounted directories:"
echo "* ./config: $(pwd)/config"
echo "* ./src: $(pwd)/src"
echo "* ./buildroot: $(pwd)/buildroot"
echo "* ./source: $(pwd)/source"
echo "* ./dist: $(pwd)/dist"
echo "* ./downloads: $(pwd)/downloads"
echo "* ./pkgroot: $(pwd)/pkgroot"
echo "*"
set -ex
$DOCKER_EXECUTABLE run $PLATFORM_ARG --privileged --rm -it $INTERACT $ENV_LIST --env-file /tmp/spc-gnu-docker.env $MOUNT_LIST cwcc-spc-gnu-$SPC_USE_ARCH-$SPC_DOCKER_VERSION /bin/bash
else
$DOCKER_EXECUTABLE run $PLATFORM_ARG --rm $INTERACT $ENV_LIST --env-file /tmp/spc-gnu-docker.env $MOUNT_LIST cwcc-spc-gnu-$SPC_USE_ARCH-$SPC_DOCKER_VERSION bin/spc "${NEW_ARGS[@]}"
fi

View File

@@ -9,20 +9,22 @@
}
],
"require": {
"php": ">= 8.1",
"php": ">= 8.3",
"ext-mbstring": "*",
"ext-zlib": "*",
"laravel/prompts": "^0.1.12",
"symfony/console": "^5.4 || ^6 || ^7",
"zhamao/logger": "^1.0"
"symfony/process": "^7.2",
"symfony/yaml": "^7.2",
"zhamao/logger": "^1.1.3"
},
"require-dev": {
"captainhook/captainhook-phar": "^5.23",
"captainhook/hook-installer": "^1.0",
"friendsofphp/php-cs-fixer": "^3.25",
"humbug/box": "^4.5",
"nunomaduro/collision": "^7.8",
"friendsofphp/php-cs-fixer": "^3.60",
"humbug/box": "^4.5.0 || ^4.6.0",
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^10.3 || ^9"
"phpunit/phpunit": "^10.3 || ^9.5"
},
"autoload": {
"psr-4": {

3596
composer.lock generated

File diff suppressed because it is too large Load Diff

160
config/env.ini Normal file
View File

@@ -0,0 +1,160 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; static-php-cli (spc) env configuration
;
; This file is used to set default env vars for static-php-cli build.
; As dynamic build process, some of these vars can be overwritten by CLI options.
; And you can also overwrite these vars by setting them in your shell environment.
; The value should be changed only if you know what you are doing. Otherwise, please leave them as default.
;
; We need to use some pre-defined internal env vars, like `BUILD_ROOT_PATH`, `DOWNLOAD_PATH`, etc.
; Please note that these vars cannot be defined in this file, they should only be defined before static-php-cli running.
;
; Here's a list of env vars, these variables will be defined if not defined:
;
; BUILD_ROOT_PATH: the root path of the build process. (default: `$(pwd)/buildroot`)
; BUILD_INCLUDE_PATH: the path of the include files. (default: `$BUILD_ROOT_PATH/include`)
; BUILD_LIB_PATH: the path of the lib files. (default: `$BUILD_ROOT_PATH/lib`)
; BUILD_BIN_PATH: the path of the bin files. (default: `$BUILD_ROOT_PATH/bin`)
; BUILD_MODULES_PATH: the path of the php modules (shared extensions) files. (default: `$BUILD_ROOT_PATH/modules`)
; PKG_ROOT_PATH: the root path of the package files. (default: `$(pwd)/pkgroot/$GNU_ARCH-{darwin|linux|windows}`)
; SOURCE_PATH: the path of the source files. (default: `$(pwd)/source`)
; DOWNLOAD_PATH: the path of the download files. (default: `$(pwd)/downloads`)
; PATH: (*nix only) static-php-cli will add `$BUILD_BIN_PATH` to PATH.
; PKG_CONFIG_PATH: (*nix only) static-php-cli will set `$BUILD_LIB_PATH/pkgconfig` to PKG_CONFIG_PATH.
;
; Here's a list of env vars, these variables is defined in SPC and cannot be changed anywhere:
;
; SPC_VERSION: the version of static-php-cli.
; WORKING_DIR: the working directory of the build process. (default: `$(pwd)`)
; ROOT_DIR: the root directory of static-php-cli. (default: `/path/to/static-php-cli`, when running in phar or micro mode: `phar://path/to/spc.phar`)
; CPU_COUNT: the count of the CPU cores. (default: `$(nproc)`)
; SPC_ARCH: the arch of the current system, for some libraries needed `--host=XXX` args. (default: `$(uname -m)`, e.g. `x86_64`, `aarch64`, `arm64`)
; GNU_ARCH: the GNU arch of the current system. (default: `$(uname -m)`, e.g. `x86_64`, `aarch64`)
; MAC_ARCH: the MAC arch of the current system. (default: `$(uname -m)`, e.g. `x86_64`, `arm64`)
; PKG_CONFIG: (*nix only) static-php-cli will set `$BUILD_BIN_PATH/pkg-config` to PKG_CONFIG.
; SPC_LINUX_DEFAULT_CC: (linux only) the default compiler for linux. (For alpine linux: `gcc`, default: `$GNU_ARCH-linux-musl-gcc`)
; SPC_LINUX_DEFAULT_CXX: (linux only) the default c++ compiler for linux. (For alpine linux: `g++`, default: `$GNU_ARCH-linux-musl-g++`)
; SPC_LINUX_DEFAULT_AR: (linux only) the default archiver for linux. (For alpine linux: `ar`, default: `$GNU_ARCH-linux-musl-ar`)
; SPC_EXTRA_PHP_VARS: (linux only) the extra vars for building php, used in `configure` and `make` command.
[global]
; Build concurrency for make -jN, default is CPU_COUNT, this value are used in every libs.
SPC_CONCURRENCY=${CPU_COUNT}
; Ignore PHP version check before building some extensions
SPC_SKIP_PHP_VERSION_CHECK="no"
; Ignore some check item for bin/spc doctor command, comma separated (e.g. SPC_SKIP_DOCTOR_CHECK_ITEMS="if homebrew has installed")
SPC_SKIP_DOCTOR_CHECK_ITEMS=""
; extra modules that xcaddy will include in the FrankenPHP build
SPC_CMD_VAR_FRANKENPHP_XCADDY_MODULES="--with github.com/dunglas/mercure/caddy --with github.com/dunglas/vulcain/caddy --with github.com/dunglas/caddy-cbrotli"
; The display message for php version output (PHP >= 8.4 available)
PHP_BUILD_PROVIDER="static-php-cli ${SPC_VERSION}"
; EXTENSION_DIR where the built php will look for extension when a .ini instructs to load them
; only useful for builds targeting not pure-static linking
; default paths
; Ubuntu/Debian: /usr/lib/php/{PHP_VERSION}/
; RHEL: /usr/lib64/php/modules
; Alpine: /usr/lib/php{PHP_VERSION}/modules
; where {PHP_VERSION} is 84 for php 8.4
; EXTENSION_DIR=
[windows]
; build target: win7-static
SPC_TARGET=native-windows
; php-sdk-binary-tools path
PHP_SDK_PATH="${WORKING_DIR}\php-sdk-binary-tools"
; upx executable path
UPX_EXEC="${PKG_ROOT_PATH}\bin\upx.exe"
; phpmicro patches, for more info, see: https://github.com/easysoft/phpmicro/tree/master/patches
SPC_MICRO_PATCHES=static_extensions_win32,cli_checks,disable_huge_page,vcruntime140,win32,zend_stream,cli_static,win32_api
[linux]
; Linux can use different build toolchains.
; - musl (default, when SPC_LIBC=musl): used for general linux distros, can build `musl` (statically linked) only.
; - zig (will become default): usable on all Linux distros, can build `-musl`, `arch-linux-musl -dynamic` and `arch-linux-gnu` targets. Can specify version such as `x86_64-linux-gnu.2.17`.
; - musl-native: used for alpine linux, can build `musl` and `musl -dynamic` target.
; - gnu-native: used for general linux distros, can build gnu target for the installed glibc version only.
; option to specify the target, superceded by SPC_TARGET if set
SPC_LIBC=musl
; uncomment to link libc dynamically on musl
; SPC_MUSL_DYNAMIC=true
; Recommended: specify your target here. Zig toolchain will be used.
; examples:
; `native-native-gnu` - links against glibc, current OS version
; `native-native-gnu.2.17` - links against glibc, version 2.17
; `native-native` - links against system libc dynamically
; `native-native-musl` - links against musl libc statically
; `native-native-musl -dynamic` - links against musl libc dynamically
; SPC_TARGET=
; compiler environments
CC=${SPC_LINUX_DEFAULT_CC}
CXX=${SPC_LINUX_DEFAULT_CXX}
AR=${SPC_LINUX_DEFAULT_AR}
RANLIB=${SPC_LINUX_DEFAULT_RANLIB}
LD=${SPC_LINUX_DEFAULT_LD}
; default compiler flags, used in CMake toolchain file, openssl and pkg-config build
SPC_DEFAULT_C_FLAGS="-fPIC -Os"
SPC_DEFAULT_CXX_FLAGS="-fPIC -Os"
SPC_DEFAULT_LD_FLAGS=""
; upx executable path
UPX_EXEC=${PKG_ROOT_PATH}/bin/upx
; phpmicro patches, for more info, see: https://github.com/easysoft/phpmicro/tree/master/patches
SPC_MICRO_PATCHES=cli_checks,disable_huge_page
; *** default build command for building php ***
; buildconf command
SPC_CMD_PREFIX_PHP_BUILDCONF="./buildconf --force"
; configure command
SPC_CMD_PREFIX_PHP_CONFIGURE="./configure --prefix= --with-valgrind=no --disable-shared --enable-static --disable-all --disable-phpdbg --with-pic"
; *** default build vars for building php ***
; embed type for php, static (libphp.a) or shared (libphp.so)
SPC_CMD_VAR_PHP_EMBED_TYPE="static"
; EXTRA_CFLAGS for `configure` and `make` php
SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS="-g -fstack-protector-strong -fno-ident -fPIE ${SPC_DEFAULT_C_FLAGS}"
; EXTRA_LDFLAGS for `make` php, can use -release to set a soname for libphp.so
SPC_CMD_VAR_PHP_MAKE_EXTRA_LDFLAGS=""
; optional, path to openssl conf. This affects where openssl will look for the default CA.
; default on Debian/Alpine: /etc/ssl, default on RHEL: /etc/pki/tls
OPENSSLDIR=""
[macos]
; build target: macho or macho (possibly we could support macho-universal in the future)
; Currently we do not support universal and cross-compilation for macOS.
SPC_TARGET=native-macos
; compiler environments
CC=clang
CXX=clang++
AR=ar
LD=ld
; default compiler flags, used in CMake toolchain file, openssl and pkg-config build
SPC_DEFAULT_C_FLAGS="--target=${MAC_ARCH}-apple-darwin -Os"
SPC_DEFAULT_CXX_FLAGS="--target=${MAC_ARCH}-apple-darwin -Os"
SPC_DEFAULT_LD_FLAGS=""
; phpmicro patches, for more info, see: https://github.com/easysoft/phpmicro/tree/master/patches
SPC_MICRO_PATCHES=cli_checks,macos_iconv
; *** default build command for building php ***
; buildconf command
SPC_CMD_PREFIX_PHP_BUILDCONF="./buildconf --force"
; configure command
SPC_CMD_PREFIX_PHP_CONFIGURE="./configure --prefix= --with-valgrind=no --enable-shared=no --enable-static=yes --disable-all --disable-phpdbg"
; *** default build vars for building php ***
; embed type for php, static (libphp.a) or shared (libphp.dylib)
SPC_CMD_VAR_PHP_EMBED_TYPE="static"
; EXTRA_CFLAGS for `configure` and `make` php
SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS="-g -fstack-protector-strong -fpic -fpie -Werror=unknown-warning-option ${SPC_DEFAULT_C_FLAGS}"
; EXTRA_LDFLAGS for `make` php, can use -release to set a soname for libphp.so
SPC_CMD_VAR_PHP_MAKE_EXTRA_LDFLAGS=""
; minimum compatible macOS version (LLVM vars, availability not guaranteed)
MACOSX_DEPLOYMENT_TARGET=12.0
[freebsd]
; compiler environments
CC=clang
CXX=clang++

View File

@@ -17,12 +17,24 @@
"type": "external",
"source": "apcu"
},
"ast": {
"type": "external",
"source": "ast"
},
"bcmath": {
"type": "builtin"
},
"brotli": {
"type": "external",
"source": "ext-brotli",
"arg-type": "enable",
"lib-depends": [
"brotli"
]
},
"bz2": {
"type": "builtin",
"arg-type-unix": "with-prefix",
"arg-type-unix": "with-path",
"arg-type-windows": "with",
"lib-depends": [
"bzip2"
@@ -31,6 +43,27 @@
"calendar": {
"type": "builtin"
},
"clickhouse": {
"support": {
"Windows": "wip",
"BSD": "wip"
},
"type": "external",
"source": "ext-clickhouse",
"arg-type": "custom",
"cpp-extension": true,
"lib-suggests": [
"openssl"
]
},
"com_dotnet": {
"support": {
"BSD": "no",
"Linux": "no",
"Darwin": "no"
},
"type": "builtin"
},
"ctype": {
"type": "builtin"
},
@@ -43,7 +76,8 @@
],
"ext-depends-windows": [
"zlib",
"openssl"
"openssl",
"brotli"
]
},
"dba": {
@@ -53,6 +87,26 @@
"qdbm"
]
},
"decimal": {
"type": "external",
"source": "ext-decimal",
"arg-type": "custom",
"lib-depends": [
"libmpdec"
]
},
"deepclone": {
"type": "external",
"source": "deepclone",
"arg-type": "enable"
},
"dio": {
"support": {
"BSD": "wip"
},
"type": "external",
"source": "dio"
},
"dom": {
"support": {
"BSD": "wip"
@@ -81,6 +135,14 @@
},
"type": "wip"
},
"ev": {
"type": "external",
"source": "ev",
"arg-type-windows": "with",
"ext-depends": [
"sockets"
]
},
"event": {
"support": {
"Windows": "wip",
@@ -100,12 +162,44 @@
"sockets"
]
},
"excimer": {
"support": {
"Windows": "wip",
"BSD": "wip"
},
"type": "external",
"source": "ext-excimer"
},
"exif": {
"type": "builtin"
},
"fastchart": {
"support": {
"Windows": "wip",
"BSD": "wip"
},
"type": "external",
"source": "ext-fastchart",
"lib-depends": [
"freetype"
],
"lib-suggests": [
"libpng",
"libjpeg",
"libwebp"
]
},
"fastjson": {
"support": {
"Windows": "wip",
"BSD": "wip"
},
"type": "external",
"source": "ext-fastjson"
},
"ffi": {
"support": {
"Linux": "no",
"Linux": "partial",
"BSD": "wip"
},
"notes": true,
@@ -158,7 +252,7 @@
"BSD": "wip"
},
"type": "builtin",
"arg-type": "with-prefix",
"arg-type": "with-path",
"lib-depends": [
"gettext"
]
@@ -184,17 +278,44 @@
"BSD": "wip"
},
"type": "builtin",
"arg-type": "with-prefix",
"arg-type": "with-path",
"lib-depends": [
"gmp"
]
},
"gmssl": {
"support": {
"BSD": "wip"
},
"arg-type": "with-path",
"type": "external",
"source": "ext-gmssl",
"lib-depends": [
"gmssl"
]
},
"grpc": {
"support": {
"Windows": "wip",
"BSD": "wip"
},
"type": "external",
"source": "ext-grpc",
"arg-type-unix": "enable-path",
"cpp-extension": true,
"lib-depends": [
"grpc",
"zlib",
"openssl",
"libcares"
]
},
"iconv": {
"support": {
"BSD": "wip"
},
"type": "builtin",
"arg-type": "with-prefix",
"arg-type": "with-path",
"arg-type-windows": "with",
"lib-depends-unix": [
"libiconv"
@@ -219,6 +340,7 @@
"Windows": "wip",
"BSD": "wip"
},
"notes": true,
"type": "external",
"source": "ext-imagick",
"arg-type": "custom",
@@ -232,7 +354,8 @@
"BSD": "wip"
},
"notes": true,
"type": "builtin",
"type": "external",
"source": "ext-imap",
"arg-type": "custom",
"lib-depends": [
"imap"
@@ -252,12 +375,14 @@
},
"intl": {
"support": {
"Windows": "no",
"BSD": "wip"
},
"type": "builtin",
"lib-depends": [
"lib-depends-unix": [
"icu"
],
"lib-depends-windows": [
"icu-static-win"
]
},
"ldap": {
@@ -266,7 +391,7 @@
"BSD": "wip"
},
"type": "builtin",
"arg-type": "with-prefix",
"arg-type": "with-path",
"lib-depends": [
"ldap"
],
@@ -286,11 +411,42 @@
"arg-type": "none",
"ext-depends": [
"xml"
],
"build-with-php": true,
"target": [
"static"
]
},
"lz4": {
"support": {
"Windows": "wip",
"BSD": "wip"
},
"type": "external",
"source": "ext-lz4",
"arg-type": "custom",
"lib-depends": [
"liblz4"
]
},
"maxminddb": {
"support": {
"BSD": "wip",
"Windows": "wip"
},
"type": "external",
"source": "ext-maxminddb",
"arg-type": "with",
"lib-depends": [
"libmaxminddb"
]
},
"mbregex": {
"type": "builtin",
"arg-type": "custom",
"target": [
"static"
],
"ext-depends": [
"mbstring"
],
@@ -320,18 +476,15 @@
"type": "external",
"source": "ext-memcache",
"arg-type": "custom",
"lib-depends": [
"zlib"
],
"ext-depends": [
"zlib",
"session"
]
},
"memcached": {
"support": {
"Windows": "wip",
"BSD": "wip",
"Linux": "no"
"BSD": "wip"
},
"type": "external",
"source": "memcached",
@@ -340,9 +493,21 @@
"lib-depends": [
"libmemcached"
],
"lib-depends-unix": [
"libmemcached",
"fastlz"
],
"lib-suggests": [
"zstd"
],
"ext-depends": [
"session",
"zlib"
],
"ext-suggests": [
"igbinary",
"msgpack",
"session"
]
},
"mongodb": {
@@ -358,11 +523,28 @@
"openssl",
"zstd",
"zlib"
],
"frameworks": [
"CoreFoundation",
"Security"
]
},
"msgpack": {
"support": {
"BSD": "wip"
},
"type": "external",
"source": "msgpack",
"arg-type-unix": "with",
"arg-type-windows": "enable",
"ext-depends": [
"session"
]
},
"mysqli": {
"type": "builtin",
"arg-type": "with",
"build-with-php": true,
"ext-depends": [
"mysqlnd"
]
@@ -370,10 +552,45 @@
"mysqlnd": {
"type": "builtin",
"arg-type-windows": "with",
"build-with-php": true,
"lib-depends": [
"zlib"
]
},
"mysqlnd_ed25519": {
"type": "external",
"source": "mysqlnd_ed25519",
"arg-type": "enable",
"target": [
"shared"
],
"ext-depends": [
"mysqlnd"
],
"lib-depends": [
"libsodium"
],
"lib-suggests": [
"openssl"
]
},
"mysqlnd_parsec": {
"type": "external",
"source": "mysqlnd_parsec",
"arg-type": "enable",
"target": [
"shared"
],
"ext-depends": [
"mysqlnd"
],
"lib-depends": [
"libsodium"
],
"lib-suggests": [
"openssl"
]
},
"oci8": {
"type": "wip",
"support": {
@@ -384,15 +601,29 @@
},
"notes": true
},
"odbc": {
"support": {
"BSD": "wip",
"Windows": "wip"
},
"type": "builtin",
"arg-type-unix": "custom",
"lib-depends-unix": [
"unixodbc"
]
},
"opcache": {
"type": "builtin",
"arg-type-unix": "custom"
"arg-type-unix": "custom",
"arg-type-windows": "enable",
"zend-extension": true
},
"openssl": {
"notes": true,
"type": "builtin",
"arg-type": "custom",
"arg-type-windows": "with",
"build-with-php": true,
"lib-depends": [
"openssl",
"zlib"
@@ -401,6 +632,13 @@
"zlib"
]
},
"opentelemetry": {
"support": {
"BSD": "wip"
},
"type": "external",
"source": "opentelemetry"
},
"parallel": {
"support": {
"BSD": "wip"
@@ -420,9 +658,10 @@
},
"notes": true,
"type": "builtin",
"arg-type": "with-prefix",
"arg-type": "custom",
"lib-depends": [
"libargon2"
"libargon2",
"openssl"
]
},
"pcntl": {
@@ -432,6 +671,13 @@
"type": "builtin",
"unix-only": true
},
"pcov": {
"type": "external",
"source": "pcov",
"target": [
"shared"
]
},
"pdo": {
"type": "builtin"
},
@@ -443,19 +689,36 @@
"mysqlnd"
]
},
"pdo_pgsql": {
"pdo_odbc": {
"support": {
"Windows": "wip",
"BSD": "wip"
},
"type": "builtin",
"arg-type": "with-prefix",
"arg-type": "custom",
"lib-depends-unix": [
"unixodbc"
],
"ext-depends": [
"pdo",
"odbc"
]
},
"pdo_pgsql": {
"support": {
"BSD": "wip"
},
"type": "builtin",
"arg-type": "with-path",
"arg-type-windows": "custom",
"ext-depends": [
"pdo",
"pgsql"
],
"lib-depends": [
"lib-depends-unix": [
"postgresql"
],
"lib-depends-windows": [
"postgresql-win"
]
},
"pdo_sqlite": {
@@ -486,14 +749,16 @@
},
"pgsql": {
"support": {
"Windows": "wip",
"BSD": "wip"
},
"notes": true,
"type": "builtin",
"arg-type": "with-prefix",
"lib-depends": [
"arg-type": "custom",
"lib-depends-unix": [
"postgresql"
],
"lib-depends-windows": [
"postgresql-win"
]
},
"phar": {
@@ -527,15 +792,31 @@
"source": "rar",
"cpp-extension": true
},
"rdkafka": {
"support": {
"BSD": "wip",
"Windows": "wip"
},
"type": "external",
"source": "ext-rdkafka",
"arg-type": "custom",
"cpp-extension": true,
"lib-depends": [
"librdkafka"
]
},
"readline": {
"support": {
"Windows": "wip",
"BSD": "wip"
},
"type": "builtin",
"arg-type": "with-prefix",
"arg-type": "with-path",
"lib-depends": [
"readline"
"libedit"
],
"target": [
"static"
]
},
"redis": {
@@ -547,7 +828,8 @@
"arg-type": "custom",
"ext-suggests": [
"session",
"igbinary"
"igbinary",
"msgpack"
],
"lib-suggests-unix": [
"zstd",
@@ -555,10 +837,12 @@
]
},
"session": {
"type": "builtin"
"type": "builtin",
"build-with-php": true
},
"shmop": {
"type": "builtin"
"type": "builtin",
"build-with-php": true
},
"simdjson": {
"type": "external",
@@ -576,7 +860,8 @@
],
"ext-depends-windows": [
"xml"
]
],
"build-with-php": true
},
"snappy": {
"support": {
@@ -590,21 +875,31 @@
"lib-depends": [
"snappy"
],
"ext-suggest": [
"ext-suggests": [
"apcu"
]
},
"snmp": {
"support": {
"Windows": "wip",
"BSD": "wip"
},
"type": "builtin",
"arg-type-unix": "with",
"arg-type-windows": "with",
"lib-depends": [
"net-snmp"
]
},
"soap": {
"support": {
"BSD": "wip"
},
"type": "builtin",
"arg-type": "custom",
"lib-depends": [
"libxml2"
],
"ext-depends-windows": [
"xml"
"ext-depends": [
"libxml",
"session"
]
},
"sockets": {
@@ -612,7 +907,6 @@
},
"sodium": {
"support": {
"Windows": "wip",
"BSD": "wip"
},
"type": "builtin",
@@ -639,8 +933,9 @@
"BSD": "wip"
},
"type": "builtin",
"arg-type": "with-prefix",
"arg-type": "with-path",
"arg-type-windows": "with",
"build-with-php": true,
"lib-depends": [
"sqlite"
]
@@ -665,12 +960,12 @@
},
"type": "external",
"source": "ext-ssh2",
"arg-type": "with-prefix",
"arg-type": "with-path",
"arg-type-windows": "with",
"lib-depends": [
"libssh2"
],
"ext-depends-windows": [
"ext-depends": [
"openssl",
"zlib"
]
@@ -692,14 +987,23 @@
"nghttp2",
"zlib"
],
"lib-suggests": [
"zstd"
],
"lib-suggests-linux": [
"zstd",
"liburing"
],
"ext-depends": [
"openssl",
"curl"
],
"ext-suggests": [
"sockets",
"swoole-hook-pgsql",
"swoole-hook-mysql",
"swoole-hook-sqlite"
"swoole-hook-sqlite",
"swoole-hook-odbc"
]
},
"swoole-hook-mysql": {
@@ -709,16 +1013,33 @@
},
"notes": true,
"type": "addon",
"arg-type": "custom",
"arg-type": "none",
"ext-depends": [
"mysqlnd",
"pdo",
"pdo_mysql"
"pdo_mysql",
"swoole"
],
"ext-suggests": [
"mysqli"
]
},
"swoole-hook-odbc": {
"support": {
"Windows": "no",
"BSD": "wip"
},
"notes": true,
"type": "addon",
"arg-type": "none",
"ext-depends": [
"pdo",
"swoole"
],
"lib-depends": [
"unixodbc"
]
},
"swoole-hook-pgsql": {
"support": {
"Windows": "no",
@@ -727,10 +1048,11 @@
},
"notes": true,
"type": "addon",
"arg-type": "custom",
"arg-type": "none",
"ext-depends": [
"pgsql",
"pdo"
"pdo",
"swoole"
]
},
"swoole-hook-sqlite": {
@@ -740,10 +1062,11 @@
},
"notes": true,
"type": "addon",
"arg-type": "custom",
"arg-type": "none",
"ext-depends": [
"sqlite3",
"pdo"
"pdo",
"swoole"
]
},
"swow": {
@@ -791,13 +1114,22 @@
"BSD": "wip"
},
"type": "builtin",
"arg-type": "with-prefix",
"arg-type": "with-path",
"lib-depends": [
"tidy"
]
},
"tokenizer": {
"type": "builtin"
"type": "builtin",
"build-with-php": true
},
"trader": {
"support": {
"BSD": "wip",
"Windows": "wip"
},
"type": "external",
"source": "ext-trader"
},
"uuid": {
"support": {
@@ -806,7 +1138,7 @@
},
"type": "external",
"source": "ext-uuid",
"arg-type": "with-prefix",
"arg-type": "with-path",
"lib-depends": [
"libuuid"
]
@@ -818,7 +1150,7 @@
},
"type": "external",
"source": "ext-uv",
"arg-type": "with-prefix",
"arg-type": "with-path",
"lib-depends": [
"libuv"
],
@@ -827,14 +1159,19 @@
]
},
"xdebug": {
"type": "builtin",
"type": "external",
"source": "xdebug",
"target": [
"shared"
],
"support": {
"Windows": "wip",
"BSD": "no",
"Darwin": "no",
"Linux": "no"
"Darwin": "partial",
"Linux": "partial"
},
"notes": true
"notes": true,
"zend-extension": true
},
"xhprof": {
"support": {
@@ -846,11 +1183,11 @@
"source": "xhprof",
"ext-depends": [
"ctype"
]
],
"build-with-php": true
},
"xlswriter": {
"support": {
"Windows": "wip",
"BSD": "wip"
},
"type": "external",
@@ -877,7 +1214,8 @@
],
"ext-depends-windows": [
"iconv"
]
],
"build-with-php": true
},
"xmlreader": {
"support": {
@@ -891,7 +1229,8 @@
"ext-depends-windows": [
"xml",
"dom"
]
],
"build-with-php": true
},
"xmlwriter": {
"support": {
@@ -904,7 +1243,8 @@
],
"ext-depends-windows": [
"xml"
]
],
"build-with-php": true
},
"xsl": {
"support": {
@@ -912,7 +1252,7 @@
"BSD": "wip"
},
"type": "builtin",
"arg-type": "with-prefix",
"arg-type": "with-path",
"lib-depends": [
"libxslt"
],
@@ -921,6 +1261,14 @@
"dom"
]
},
"xz": {
"type": "external",
"source": "ext-xz",
"arg-type": "with",
"lib-depends": [
"xz"
]
},
"yac": {
"support": {
"BSD": "wip"
@@ -928,6 +1276,9 @@
"type": "external",
"source": "yac",
"arg-type-unix": "custom",
"lib-depends-unix": [
"fastlz"
],
"ext-depends-unix": [
"igbinary"
]
@@ -938,7 +1289,7 @@
},
"type": "external",
"source": "yaml",
"arg-type-unix": "with-prefix",
"arg-type-unix": "with-path",
"arg-type-windows": "with",
"lib-depends": [
"libyaml"
@@ -948,8 +1299,9 @@
"support": {
"BSD": "wip"
},
"type": "builtin",
"arg-type": "with-prefix",
"type": "external",
"source": "ext-zip",
"arg-type": "custom",
"arg-type-windows": "enable",
"lib-depends-unix": [
"libzip"
@@ -971,6 +1323,10 @@
"arg-type-windows": "enable",
"lib-depends": [
"zlib"
],
"build-with-php": true,
"target": [
"static"
]
},
"zstd": {

View File

@@ -1,10 +1,58 @@
{
"lib-base": {
"type": "root"
},
"php": {
"type": "root",
"source": "php-src",
"lib-depends": [
"lib-base",
"micro",
"frankenphp"
],
"lib-depends-macos": [
"lib-base",
"micro",
"libxml2",
"frankenphp"
],
"lib-suggests-linux": [
"libacl",
"brotli",
"watcher"
],
"lib-suggests-macos": [
"brotli",
"watcher"
]
},
"frankenphp": {
"source": "frankenphp",
"type": "target"
},
"micro": {
"type": "target",
"source": "micro"
},
"pkg-config": {
"type": "package",
"source": "pkg-config",
"bin-unix": [
"pkg-config"
]
},
"attr": {
"source": "attr",
"static-libs-unix": [
"libattr.a"
]
},
"brotli": {
"source": "brotli",
"static-libs-unix": [
"libbrotlidec.a",
"libbrotlienc.a",
"libbrotlicommon.a"
"pkg-configs": [
"libbrotlicommon",
"libbrotlidec",
"libbrotlienc"
],
"static-libs-windows": [
"brotlicommon.lib",
@@ -44,7 +92,6 @@
"zlib"
],
"lib-depends-windows": [
"openssl",
"zlib",
"libssh2",
"nghttp2"
@@ -53,12 +100,16 @@
"libssh2",
"brotli",
"nghttp2",
"nghttp3",
"ngtcp2",
"zstd",
"libcares"
"libcares",
"ldap",
"idn2",
"krb5"
],
"lib-suggests-windows": [
"brotli",
"zstd"
"brotli"
],
"frameworks": [
"CoreFoundation",
@@ -66,6 +117,15 @@
"SystemConfiguration"
]
},
"fastlz": {
"source": "fastlz",
"static-libs-unix": [
"libfastlz.a"
],
"headers": [
"fastlz.h"
]
},
"freetype": {
"source": "freetype",
"static-libs-unix": [
@@ -82,9 +142,7 @@
"zlib"
],
"lib-suggests": [
"libpng",
"bzip2",
"brotli"
"libpng"
]
},
"gettext": {
@@ -127,35 +185,94 @@
"gmp.h"
]
},
"gmssl": {
"source": "gmssl",
"static-libs-unix": [
"libgmssl.a"
],
"static-libs-windows": [
"gmssl.lib"
],
"frameworks": [
"Security"
]
},
"grpc": {
"source": "grpc",
"pkg-configs": [
"grpc"
],
"lib-depends": [
"zlib",
"openssl",
"libcares"
],
"cpp-library": true,
"frameworks": [
"CoreFoundation"
]
},
"icu": {
"source": "icu",
"cpp-library": true,
"static-libs-unix": [
"libicui18n.a",
"libicuio.a",
"libicuuc.a",
"libicudata.a"
"pkg-configs": [
"icu-uc",
"icu-i18n",
"icu-io"
]
},
"icu-static-win": {
"source": "icu-static-win",
"static-libs-windows": [
"icudt.lib",
"icuin.lib",
"icuio.lib",
"icuuc.lib"
],
"headers-windows": [
"unicode"
]
},
"idn2": {
"source": "libidn2",
"pkg-configs": [
"libidn2"
],
"headers": [
"idn2.h"
],
"lib-suggests-unix": [
"libiconv",
"gettext",
"libunistring"
],
"lib-depends-macos": [
"libiconv",
"gettext"
]
},
"imagemagick": {
"source": "imagemagick",
"static-libs-unix": [
"libMagick++-7.Q16HDRI.a",
"libMagickWand-7.Q16HDRI.a",
"libMagickCore-7.Q16HDRI.a"
"cpp-library": true,
"pkg-configs": [
"Magick++-7.Q16HDRI",
"MagickCore-7.Q16HDRI",
"MagickWand-7.Q16HDRI"
],
"lib-depends": [
"zlib",
"libpng",
"libjpeg",
"libjxl",
"libpng",
"libwebp",
"freetype",
"libtiff"
"libtiff",
"libheif",
"bzip2"
],
"lib-suggests": [
"zstd",
"xz",
"bzip2",
"libzip",
"libxml2"
]
@@ -169,11 +286,43 @@
"openssl"
]
},
"jbig": {
"source": "jbig",
"static-libs-unix": [
"libjbig.a",
"libjbig85.a"
],
"headers": [
"jbig.h",
"jbig85.h",
"jbig_ar.h"
]
},
"krb5": {
"source": "krb5",
"pkg-configs": [
"krb5-gssapi"
],
"headers": [
"krb5.h",
"gssapi/gssapi.h"
],
"lib-depends": [
"openssl"
],
"lib-suggests": [
"ldap",
"libedit"
],
"frameworks": [
"Kerberos"
]
},
"ldap": {
"source": "ldap",
"static-libs-unix": [
"liblber.a",
"libldap.a"
"pkg-configs": [
"ldap",
"lber"
],
"lib-depends": [
"openssl",
@@ -182,10 +331,39 @@
"libsodium"
]
},
"lerc": {
"source": "lerc",
"static-libs-unix": [
"libLerc.a"
],
"cpp-library": true
},
"libacl": {
"source": "libacl",
"static-libs-unix": [
"libacl.a"
],
"lib-depends": [
"attr"
]
},
"libaom": {
"source": "libaom",
"static-libs-unix": [
"libaom.a"
],
"static-libs-windows": [
"aom.lib"
],
"cpp-library": true
},
"libargon2": {
"source": "libargon2",
"static-libs-unix": [
"libargon2.a"
],
"lib-suggests": [
"libsodium"
]
},
"libavif": {
@@ -195,6 +373,15 @@
],
"static-libs-windows": [
"avif.lib"
],
"lib-depends": [
"libaom"
],
"lib-suggests": [
"libwebp",
"libjpeg",
"libxml2",
"libpng"
]
},
"libcares": {
@@ -205,8 +392,23 @@
"headers-unix": [
"ares.h",
"ares_dns.h",
"ares_nameser.h",
"ares_rules.h"
"ares_nameser.h"
]
},
"libde265": {
"source": "libde265",
"static-libs-unix": [
"libde265.a"
],
"cpp-library": true
},
"libedit": {
"source": "libedit",
"static-libs-unix": [
"libedit.a"
],
"lib-depends": [
"ncurses"
]
},
"libevent": {
@@ -250,6 +452,20 @@
"fficonfig.h"
]
},
"libheif": {
"source": "libheif",
"cpp-library": true,
"static-libs-unix": [
"libheif.a"
],
"lib-depends": [
"libde265",
"libwebp",
"libaom",
"zlib",
"brotli"
]
},
"libiconv": {
"source": "libiconv",
"static-libs-unix": [
@@ -278,21 +494,61 @@
"static-libs-windows": [
"libjpeg_a.lib"
],
"lib-suggests-windows": [
"lib-depends": [
"zlib"
]
},
"libjxl": {
"source": "libjxl",
"pkg-configs": [
"libjxl",
"libjxl_cms",
"libjxl_threads",
"libhwy"
],
"lib-depends": [
"brotli",
"libjpeg",
"libpng",
"libwebp"
]
},
"liblz4": {
"source": "liblz4",
"static-libs-unix": [
"liblz4.a"
]
},
"libmaxminddb": {
"source": "libmaxminddb",
"static-libs-unix": [
"libmaxminddb.a"
],
"headers": [
"maxminddb.h",
"maxminddb_config.h"
]
},
"libmpdec": {
"source": "libmpdec",
"static-libs-unix": [
"libmpdec.a"
],
"static-libs-windows": [
"libmpdec_a.lib"
],
"headers": [
"mpdecimal.h"
]
},
"libmemcached": {
"source": "libmemcached",
"cpp-library": true,
"static-libs-unix": [
"libmemcached.a",
"libmemcachedutil.a"
"libmemcachedprotocol.a",
"libmemcachedutil.a",
"libhashkit.a"
]
},
"libpng": {
@@ -329,10 +585,28 @@
"openssl"
]
},
"librdkafka": {
"source": "librdkafka",
"pkg-configs": [
"rdkafka++-static",
"rdkafka-static"
],
"cpp-library": true,
"lib-suggests": [
"curl",
"liblz4",
"openssl",
"zlib",
"zstd"
]
},
"libsodium": {
"source": "libsodium",
"static-libs-unix": [
"libsodium.a"
],
"static-libs-windows": [
"libsodium.lib"
]
},
"libssh2": {
@@ -350,15 +624,48 @@
],
"lib-depends": [
"openssl"
],
"lib-suggests": [
"zlib"
]
},
"libtiff": {
"source": "libtiff",
"static-libs-unix": [
"libtiff.a"
],
"lib-depends": [
"zlib",
"libjpeg"
],
"lib-suggests-unix": [
"lerc",
"libwebp",
"jbig",
"xz",
"zstd"
]
},
"libunistring": {
"source": "libunistring",
"static-libs-unix": [
"libunistring.a"
],
"headers": [
"unistr.h",
"unistring/"
]
},
"liburing": {
"source": "liburing",
"pkg-configs": [
"liburing",
"liburing-ffi"
],
"static-libs-linux": [
"liburing.a",
"liburing-ffi.a"
],
"headers-linux": [
"liburing/",
"liburing.h"
]
},
"libuuid": {
@@ -378,12 +685,12 @@
},
"libwebp": {
"source": "libwebp",
"static-libs-unix": [
"libwebp.a",
"libwebpdecoder.a",
"libwebpdemux.a",
"libwebpmux.a",
"libsharpyuv.a"
"pkg-configs": [
"libwebp",
"libwebpdecoder",
"libwebpdemux",
"libwebpmux",
"libsharpyuv"
],
"static-libs-windows": [
"libwebp.lib",
@@ -394,8 +701,8 @@
},
"libxml2": {
"source": "libxml2",
"static-libs-unix": [
"libxml2.a"
"pkg-configs": [
"libxml-2.0"
],
"static-libs-windows": [
"libxml2s.lib",
@@ -409,7 +716,6 @@
],
"lib-suggests-unix": [
"xz",
"icu",
"zlib"
],
"lib-depends-windows": [
@@ -469,16 +775,32 @@
"xz"
],
"lib-suggests-windows": [
"zstd",
"openssl"
]
},
"mimalloc": {
"source": "mimalloc",
"static-libs-unix": [
"libmimalloc.a"
]
},
"ncurses": {
"source": "ncurses",
"static-libs-unix": [
"libncurses.a"
]
},
"net-snmp": {
"source": "net-snmp",
"pkg-configs": [
"netsnmp",
"netsnmp-agent"
],
"lib-depends": [
"openssl",
"zlib"
]
},
"nghttp2": {
"source": "nghttp2",
"static-libs-unix": [
@@ -495,7 +817,45 @@
"openssl"
],
"lib-suggests": [
"libxml2"
"libxml2",
"nghttp3",
"ngtcp2"
]
},
"nghttp3": {
"source": "nghttp3",
"static-libs-unix": [
"libnghttp3.a"
],
"static-libs-windows": [
"nghttp3.lib"
],
"headers": [
"nghttp3"
],
"lib-depends": [
"openssl"
]
},
"ngtcp2": {
"source": "ngtcp2",
"static-libs-unix": [
"libngtcp2.a",
"libngtcp2_crypto_ossl.a"
],
"static-libs-windows": [
"ngtcp2.lib",
"ngtcp2_crypto_ossl.lib"
],
"headers": [
"ngtcp2"
],
"lib-depends": [
"openssl"
],
"lib-suggests": [
"nghttp3",
"brotli"
]
},
"onig": {
@@ -514,6 +874,9 @@
},
"openssl": {
"source": "openssl",
"pkg-configs": [
"openssl"
],
"static-libs-unix": [
"libssl.a",
"libcrypto.a"
@@ -529,22 +892,17 @@
"zlib"
]
},
"pkg-config": {
"source": "pkg-config"
},
"postgresql": {
"source": "postgresql",
"static-libs-unix": [
"libpq.a",
"libpgport.a",
"libpgcommon.a"
"pkg-configs": [
"libpq"
],
"lib-depends": [
"libiconv",
"libxml2",
"openssl",
"zlib",
"readline"
"libedit"
],
"lib-suggests": [
"icu",
@@ -553,6 +911,14 @@
"zstd"
]
},
"postgresql-win": {
"source": "postgresql-win",
"static-libs": [
"libpq.lib",
"libpgport.lib",
"libpgcommon.lib"
]
},
"pthreads4w": {
"source": "pthreads4w",
"static-libs-windows": [
@@ -571,6 +937,12 @@
"depot.h"
]
},
"re2c": {
"source": "re2c",
"bin-unix": [
"re2c"
]
},
"readline": {
"source": "readline",
"static-libs-unix": [
@@ -582,6 +954,7 @@
},
"snappy": {
"source": "snappy",
"cpp-library": true,
"static-libs-unix": [
"libsnappy.a"
],
@@ -616,6 +989,11 @@
},
"unixodbc": {
"source": "unixodbc",
"pkg-configs": [
"odbc",
"odbccr",
"odbcinst"
],
"static-libs-unix": [
"libodbc.a",
"libodbccr.a",
@@ -625,13 +1003,26 @@
"libiconv"
]
},
"watcher": {
"source": "watcher",
"cpp-library": true,
"static-libs-unix": [
"libwatcher-c.a"
],
"headers": [
"wtr/watcher-c.h"
],
"frameworks": [
"CoreServices"
]
},
"xz": {
"source": "xz",
"static-libs-unix": [
"liblzma.a"
],
"static-libs-windows": [
"liblzma.lib",
"lzma.lib",
"liblzma_a.lib"
],
"headers-unix": [
@@ -647,6 +1038,9 @@
},
"zlib": {
"source": "zlib",
"pkg-configs": [
"zlib"
],
"static-libs-unix": [
"libz.a"
],
@@ -660,6 +1054,9 @@
},
"zstd": {
"source": "zstd",
"pkg-configs": [
"libzstd"
],
"static-libs-unix": [
"libzstd.a"
],

View File

@@ -1,4 +1,16 @@
{
"go-xcaddy-aarch64-linux": {
"type": "custom"
},
"go-xcaddy-aarch64-macos": {
"type": "custom"
},
"go-xcaddy-x86_64-linux": {
"type": "custom"
},
"go-xcaddy-x86_64-macos": {
"type": "custom"
},
"musl-toolchain-aarch64-linux": {
"type": "url",
"url": "https://dl.static-php.dev/static-php-cli/deps/musl-toolchain/aarch64-musl-toolchain.tgz"
@@ -9,10 +21,42 @@
},
"nasm-x86_64-win": {
"type": "url",
"url": "https://www.nasm.us/pub/nasm/releasebuilds/2.16.01/win64/nasm-2.16.01-win64.zip",
"url": "https://dl.static-php.dev/static-php-cli/deps/nasm/nasm-2.16.01-win64.zip",
"extract-files": {
"nasm-2.16.01/nasm.exe": "{php_sdk_path}/bin/nasm.exe",
"nasm-2.16.01/ndisasm.exe": "{php_sdk_path}/bin/ndisasm.exe"
"nasm.exe": "{php_sdk_path}/bin/nasm.exe",
"ndisasm.exe": "{php_sdk_path}/bin/ndisasm.exe"
}
},
"pkg-config-aarch64-linux": {
"type": "ghrel",
"repo": "static-php/static-php-cli-hosted",
"match": "pkg-config-aarch64-linux-musl-1.2.5.txz",
"extract-files": {
"bin/pkg-config": "{pkg_root_path}/bin/pkg-config"
}
},
"pkg-config-aarch64-macos": {
"type": "ghrel",
"repo": "static-php/static-php-cli-hosted",
"match": "pkg-config-aarch64-darwin.txz",
"extract-files": {
"bin/pkg-config": "{pkg_root_path}/bin/pkg-config"
}
},
"pkg-config-x86_64-linux": {
"type": "ghrel",
"repo": "static-php/static-php-cli-hosted",
"match": "pkg-config-x86_64-linux-musl-1.2.5.txz",
"extract-files": {
"bin/pkg-config": "{pkg_root_path}/bin/pkg-config"
}
},
"pkg-config-x86_64-macos": {
"type": "ghrel",
"repo": "static-php/static-php-cli-hosted",
"match": "pkg-config-x86_64-darwin.txz",
"extract-files": {
"bin/pkg-config": "{pkg_root_path}/bin/pkg-config"
}
},
"strawberry-perl-x86_64-win": {
@@ -40,7 +84,22 @@
"repo": "upx/upx",
"match": "upx.+-win64\\.zip",
"extract-files": {
"upx-*-win64/upx.exe": "{pkg_root_path}/bin/upx.exe"
"upx.exe": "{pkg_root_path}/bin/upx.exe"
}
},
"zig-aarch64-linux": {
"type": "custom"
},
"zig-aarch64-macos": {
"type": "custom"
},
"zig-x86_64-linux": {
"type": "custom"
},
"zig-x86_64-macos": {
"type": "custom"
},
"zig-x86_64-win": {
"type": "custom"
}
}

View File

@@ -1,6 +1,7 @@
{
"repo": "static-php/static-php-cli-hosted",
"prefer-stable": true,
"match-pattern": "{name}-{arch}-{os}.txz",
"suffix": "txz"
}
"match-pattern-linux": "{name}-{arch}-{os}-{libc}-{libcver}.txz",
"match-pattern-macos": "{name}-{arch}-{os}.txz",
"match-pattern-windows": "{name}-{arch}-{os}.tgz"
}

View File

@@ -4,7 +4,8 @@
"license": {
"type": "file",
"path": "LICENSE"
}
},
"alt": false
},
"amqp": {
"type": "url",
@@ -26,9 +27,33 @@
"path": "LICENSE"
}
},
"ast": {
"type": "url",
"url": "https://pecl.php.net/get/ast",
"path": "php-src/ext/ast",
"filename": "ast.tgz",
"license": {
"type": "file",
"path": "LICENSE"
}
},
"attr": {
"alt": {
"type": "url",
"url": "https://mirror.souseiseki.middlendian.com/nongnu/attr/attr-2.5.2.tar.gz"
},
"type": "url",
"url": "https://download.savannah.nongnu.org/releases/attr/attr-2.5.2.tar.gz",
"provide-pre-built": true,
"license": {
"type": "file",
"path": "doc/COPYING.LGPL"
}
},
"brotli": {
"type": "ghtar",
"type": "ghtagtar",
"repo": "google/brotli",
"match": "v1\\.\\d.*",
"provide-pre-built": true,
"license": {
"type": "file",
@@ -36,9 +61,13 @@
}
},
"bzip2": {
"type": "filelist",
"url": "https://sourceware.org/pub/bzip2/",
"regex": "/href=\"(?<file>bzip2-(?<version>[^\"]+)\\.tar\\.gz)\"/",
"alt": {
"type": "filelist",
"url": "https://sourceware.org/pub/bzip2/",
"regex": "/href=\"(?<file>bzip2-(?<version>[^\"]+)\\.tar\\.gz)\"/"
},
"type": "url",
"url": "https://dl.static-php.dev/static-php-cli/deps/bzip2/bzip2-1.0.8.tar.gz",
"provide-pre-built": true,
"license": {
"type": "text",
@@ -55,6 +84,64 @@
"path": "COPYING"
}
},
"ext-decimal": {
"type": "ghtagtar",
"repo": "php-decimal/ext-decimal",
"match": "v2\\.\\d.*",
"path": "php-src/ext/decimal",
"license": {
"type": "file",
"path": "LICENSE"
}
},
"deepclone": {
"type": "ghtagtar",
"repo": "symfony/php-ext-deepclone",
"path": "php-src/ext/deepclone",
"license": {
"type": "file",
"path": "LICENSE"
}
},
"dio": {
"type": "url",
"url": "https://pecl.php.net/get/dio",
"path": "php-src/ext/dio",
"filename": "dio.tgz",
"license": {
"type": "file",
"path": "LICENSE"
}
},
"ev": {
"type": "url",
"url": "https://pecl.php.net/get/ev",
"path": "php-src/ext/ev",
"filename": "ev.tgz",
"license": {
"type": "file",
"path": "LICENSE"
}
},
"ext-brotli": {
"type": "ghtagtar",
"repo": "kjdev/php-ext-brotli",
"path": "php-src/ext/brotli",
"license": {
"type": "file",
"path": "LICENSE"
}
},
"ext-clickhouse": {
"type": "ghtagtar",
"repo": "iliaal/php_clickhouse",
"match": "tarball/refs/tags/\\d",
"path": "php-src/ext/clickhouse",
"license": {
"type": "file",
"path": "LICENSE"
}
},
"ext-ds": {
"type": "url",
"url": "https://pecl.php.net/get/ds",
@@ -67,13 +154,41 @@
},
"ext-event": {
"type": "url",
"url": "https://bitbucket.org/osmanov/pecl-event/get/3.0.8.tar.gz",
"url": "https://bitbucket.org/osmanov/pecl-event/get/3.1.4.tar.gz",
"path": "php-src/ext/event",
"license": {
"type": "file",
"path": "LICENSE"
}
},
"ext-excimer": {
"type": "url",
"url": "https://pecl.php.net/get/excimer",
"path": "php-src/ext/excimer",
"filename": "excimer.tgz",
"license": {
"type": "file",
"path": "LICENSE"
}
},
"ext-fastchart": {
"type": "ghtagtar",
"repo": "iliaal/fastchart",
"path": "php-src/ext/fastchart",
"license": {
"type": "file",
"path": "LICENSE"
}
},
"ext-fastjson": {
"type": "ghtagtar",
"repo": "iliaal/fastjson",
"path": "php-src/ext/fastjson",
"license": {
"type": "file",
"path": "LICENSE"
}
},
"ext-glfw": {
"type": "git",
"url": "https://github.com/mario-deluna/php-glfw",
@@ -83,6 +198,27 @@
"path": "LICENSE"
}
},
"ext-gmssl": {
"type": "ghtar",
"repo": "gmssl/GmSSL-PHP",
"path": "php-src/ext/gmssl",
"license": {
"type": "file",
"path": "LICENSE"
}
},
"ext-grpc": {
"type": "url",
"url": "https://pecl.php.net/get/grpc",
"path": "php-src/ext/grpc",
"filename": "grpc.tgz",
"license": {
"type": "file",
"path": [
"LICENSE"
]
}
},
"ext-imagick": {
"type": "url",
"url": "https://pecl.php.net/get/imagick",
@@ -93,6 +229,38 @@
"path": "LICENSE"
}
},
"ext-imap": {
"type": "url",
"url": "https://pecl.php.net/get/imap",
"path": "php-src/ext/imap",
"filename": "imap.tgz",
"license": {
"type": "file",
"path": [
"LICENSE"
]
}
},
"ext-lz4": {
"type": "ghtagtar",
"repo": "kjdev/php-ext-lz4",
"path": "php-src/ext/lz4",
"license": {
"type": "file",
"path": [
"LICENSE"
]
}
},
"ext-maxminddb": {
"type": "url",
"url": "https://pecl.php.net/get/maxminddb",
"filename": "ext-maxminddb.tgz",
"license": {
"type": "file",
"path": "LICENSE"
}
},
"ext-memcache": {
"type": "url",
"url": "https://pecl.php.net/get/memcache",
@@ -103,6 +271,15 @@
"path": "LICENSE"
}
},
"ext-rdkafka": {
"type": "ghtar",
"repo": "php-rdkafka/php-rdkafka",
"path": "php-src/ext/rdkafka",
"license": {
"type": "file",
"path": "LICENSE"
}
},
"ext-simdjson": {
"type": "url",
"url": "https://pecl.php.net/get/simdjson",
@@ -133,6 +310,16 @@
"path": "LICENSE"
}
},
"ext-trader": {
"type": "url",
"url": "https://pecl.php.net/get/trader",
"path": "php-src/ext/trader",
"filename": "trader.tgz",
"license": {
"type": "file",
"path": "LICENSE"
}
},
"ext-uuid": {
"type": "url",
"url": "https://pecl.php.net/get/uuid",
@@ -153,20 +340,56 @@
"path": "LICENSE"
}
},
"ext-zstd": {
"ext-xz": {
"type": "git",
"path": "php-src/ext/xz",
"rev": "main",
"url": "https://github.com/codemasher/php-ext-xz",
"license": {
"type": "file",
"path": "LICENSE"
}
},
"ext-zip": {
"type": "url",
"url": "https://pecl.php.net/get/zip",
"filename": "ext-zip.tgz",
"license": {
"type": "file",
"path": "LICENSE"
}
},
"ext-zstd": {
"type": "ghtar",
"repo": "kjdev/php-ext-zstd",
"path": "php-src/ext/zstd",
"license": {
"type": "file",
"path": "LICENSE"
}
},
"fastlz": {
"type": "git",
"url": "https://github.com/ariya/FastLZ.git",
"rev": "master",
"url": "https://github.com/kjdev/php-ext-zstd",
"license": {
"type": "file",
"path": "LICENSE.MIT"
}
},
"frankenphp": {
"type": "ghtar",
"repo": "php/frankenphp",
"prefer-stable": true,
"license": {
"type": "file",
"path": "LICENSE"
}
},
"freetype": {
"type": "git",
"rev": "VER-2-13-2",
"url": "https://github.com/freetype/freetype",
"type": "ghtagtar",
"repo": "freetype/freetype",
"match": "VER-2-\\d+-\\d+",
"license": {
"type": "file",
"path": "LICENSE.TXT"
@@ -178,22 +401,42 @@
"regex": "/href=\"(?<file>gettext-(?<version>[^\"]+)\\.tar\\.xz)\"/",
"license": {
"type": "file",
"path": "COPYING"
"path": "gettext-runtime/intl/COPYING.LIB"
}
},
"gmp": {
"type": "url",
"url": "https://dl.static-php.dev/static-php-cli/deps/gmp/gmp-6.3.0.tar.xz",
"type": "filelist",
"url": "https://ftp.gnu.org/gnu/gmp/",
"regex": "/href=\"(?<file>gmp-(?<version>[^\"]+)\\.tar\\.xz)\"/",
"provide-pre-built": true,
"alt": {
"type": "ghtagtar",
"repo": "alisw/GMP"
"type": "url",
"url": "https://dl.static-php.dev/static-php-cli/deps/gmp/gmp-6.3.0.tar.xz"
},
"license": {
"type": "text",
"text": "Since version 6, GMP is distributed under the dual licenses, GNU LGPL v3 and GNU GPL v2. These licenses make the library free to use, share, and improve, and allow you to pass on the result. The GNU licenses give freedoms, but also set firm restrictions on the use with non-free programs."
}
},
"gmssl": {
"type": "git",
"url": "https://github.com/guanzhi/GmSSL.git",
"rev": "master",
"license": {
"type": "file",
"path": "LICENSE"
}
},
"grpc": {
"type": "git",
"rev": "v1.75.x",
"url": "https://github.com/grpc/grpc.git",
"provide-pre-built": true,
"license": {
"type": "file",
"path": "LICENSE"
}
},
"icu": {
"type": "ghrel",
"repo": "unicode-org/icu",
@@ -205,6 +448,14 @@
"path": "LICENSE"
}
},
"icu-static-win": {
"type": "url",
"url": "https://dl.static-php.dev/static-php-cli/deps/icu-static-windows-x64/icu-static-windows-x64.zip",
"license": {
"type": "text",
"text": "none"
}
},
"igbinary": {
"type": "url",
"url": "https://pecl.php.net/get/igbinary",
@@ -242,6 +493,27 @@
"path": "LICENSE"
}
},
"jbig": {
"type": "url",
"url": "https://dl.static-php.dev/static-php-cli/deps/jbig/jbigkit-2.1.tar.gz",
"provide-pre-built": true,
"alt": {
"type": "url",
"url": "https://www.cl.cam.ac.uk/~mgk25/jbigkit/download/jbigkit-2.1.tar.gz"
},
"license": {
"type": "file",
"path": "COPYING"
}
},
"krb5": {
"type": "url",
"url": "https://web.mit.edu/kerberos/dist/krb5/1.22/krb5-1.22.2.tar.gz",
"license": {
"type": "file",
"path": "NOTICE"
}
},
"ldap": {
"type": "filelist",
"url": "https://www.openldap.org/software/download/OpenLDAP/openldap-release/",
@@ -251,6 +523,39 @@
"path": "LICENSE"
}
},
"lerc": {
"type": "ghtar",
"repo": "Esri/lerc",
"prefer-stable": true,
"provide-pre-built": true,
"license": {
"type": "file",
"path": "LICENSE"
}
},
"libacl": {
"alt": {
"type": "url",
"url": "https://mirror.souseiseki.middlendian.com/nongnu/acl/acl-2.3.2.tar.gz"
},
"type": "url",
"url": "https://download.savannah.nongnu.org/releases/acl/acl-2.3.2.tar.gz",
"provide-pre-built": true,
"license": {
"type": "file",
"path": "doc/COPYING.LGPL"
}
},
"libaom": {
"type": "git",
"rev": "main",
"url": "https://aomedia.googlesource.com/aom",
"provide-pre-built": true,
"license": {
"type": "file",
"path": "LICENSE"
}
},
"libargon2": {
"type": "git",
"rev": "master",
@@ -264,7 +569,7 @@
"libavif": {
"type": "ghtar",
"repo": "AOMediaCodec/libavif",
"provide-pre-built": true,
"provide-pre-built": false,
"license": {
"type": "file",
"path": "LICENSE"
@@ -286,6 +591,27 @@
"path": "LICENSE.md"
}
},
"libde265": {
"type": "ghrel",
"repo": "strukturag/libde265",
"match": "libde265-.+\\.tar\\.gz",
"prefer-stable": true,
"provide-pre-built": true,
"license": {
"type": "file",
"path": "COPYING"
}
},
"libedit": {
"type": "filelist",
"url": "https://thrysoee.dk/editline/",
"regex": "/href=\"(?<file>libedit-(?<version>[^\"]+)\\.tar\\.gz)\"/",
"provide-pre-built": true,
"license": {
"type": "file",
"path": "COPYING"
}
},
"libevent": {
"type": "ghrel",
"repo": "libevent/libevent",
@@ -316,6 +642,17 @@
"path": "LICENSE"
}
},
"libheif": {
"type": "ghrel",
"repo": "strukturag/libheif",
"match": "libheif-.+\\.tar\\.gz",
"prefer-stable": true,
"provide-pre-built": true,
"license": {
"type": "file",
"path": "COPYING"
}
},
"libiconv": {
"type": "filelist",
"url": "https://ftp.gnu.org/gnu/libiconv/",
@@ -323,7 +660,7 @@
"provide-pre-built": true,
"license": {
"type": "file",
"path": "COPYING"
"path": "COPYING.LIB"
}
},
"libiconv-win": {
@@ -335,14 +672,39 @@
"path": "source/COPYING"
}
},
"libidn2": {
"type": "filelist",
"url": "https://ftp.gnu.org/gnu/libidn/",
"regex": "/href=\"(?<file>libidn2-(?<version>[^\"]+)\\.tar\\.gz)\"/",
"license": {
"type": "file",
"path": "COPYING.LESSERv3"
}
},
"libjpeg": {
"type": "ghtar",
"repo": "libjpeg-turbo/libjpeg-turbo",
"prefer-stable": true,
"license": {
"type": "file",
"path": "LICENSE.md"
}
},
"libjxl": {
"type": "git",
"url": "https://github.com/libjxl/libjxl",
"rev": "main",
"submodules": [
"third_party/highway",
"third_party/libjpeg-turbo",
"third_party/sjpeg",
"third_party/skcms"
],
"license": {
"type": "file",
"path": "LICENSE"
}
},
"liblz4": {
"type": "ghrel",
"repo": "lz4/lz4",
@@ -354,19 +716,38 @@
"path": "LICENSE"
}
},
"libmemcached": {
"type": "git",
"url": "https://github.com/static-php/libmemcached-macos.git",
"rev": "master",
"libmaxminddb": {
"type": "ghrel",
"repo": "maxmind/libmaxminddb",
"match": "libmaxminddb-.+\\.tar\\.gz",
"prefer-stable": true,
"license": {
"type": "file",
"path": "COPYING"
"path": "LICENSE"
}
},
"libmpdec": {
"type": "url",
"url": "https://www.bytereef.org/software/mpdecimal/releases/mpdecimal-4.0.1.tar.gz",
"license": {
"type": "file",
"path": "COPYRIGHT.txt"
}
},
"libmemcached": {
"type": "ghtagtar",
"repo": "awesomized/libmemcached",
"match": "1.\\d.\\d",
"license": {
"type": "file",
"path": "LICENSE"
}
},
"libpng": {
"type": "git",
"url": "https://github.com/glennrp/libpng.git",
"rev": "libpng16",
"type": "ghtagtar",
"repo": "pnggroup/libpng",
"match": "v1\\.6\\.\\d+",
"query": "?per_page=150",
"provide-pre-built": true,
"license": {
"type": "file",
@@ -374,9 +755,17 @@
}
},
"librabbitmq": {
"type": "git",
"url": "https://github.com/alanxz/rabbitmq-c.git",
"rev": "master",
"type": "ghtar",
"repo": "alanxz/rabbitmq-c",
"prefer-stable": true,
"license": {
"type": "file",
"path": "LICENSE"
}
},
"librdkafka": {
"type": "ghtar",
"repo": "confluentinc/librdkafka",
"license": {
"type": "file",
"path": "LICENSE"
@@ -385,7 +774,7 @@
"libsodium": {
"type": "ghrel",
"repo": "jedisct1/libsodium",
"match": "libsodium-\\d+(\\.\\d+)*\\.tar\\.gz",
"match": "libsodium-(?!1\\.0\\.21)\\d+(\\.\\d+)*\\.tar\\.gz",
"prefer-stable": true,
"provide-pre-built": true,
"license": {
@@ -398,6 +787,7 @@
"repo": "libssh2/libssh2",
"match": "libssh2.+\\.tar\\.gz",
"prefer-stable": true,
"provide-pre-built": true,
"license": {
"type": "file",
"path": "COPYING"
@@ -407,16 +797,35 @@
"type": "filelist",
"url": "https://download.osgeo.org/libtiff/",
"regex": "/href=\"(?<file>tiff-(?<version>[^\"]+)\\.tar\\.xz)\"/",
"provide-pre-built": true,
"license": {
"type": "file",
"path": "LICENSE.md"
}
},
"libunistring": {
"type": "filelist",
"url": "https://ftp.gnu.org/gnu/libunistring/",
"regex": "/href=\"(?<file>libunistring-(?<version>[^\"]+)\\.tar\\.gz)\"/",
"provide-pre-built": true,
"license": {
"type": "file",
"path": "COPYING.LIB"
}
},
"liburing": {
"type": "ghtar",
"repo": "axboe/liburing",
"prefer-stable": true,
"license": {
"type": "file",
"path": "COPYING"
}
},
"libuuid": {
"type": "git",
"url": "https://github.com/static-php/libuuid.git",
"rev": "master",
"provide-pre-built": true,
"license": {
"type": "file",
"path": "COPYING"
@@ -437,8 +846,9 @@
]
},
"libwebp": {
"type": "url",
"url": "https://github.com/webmproject/libwebp/archive/refs/tags/v1.3.2.tar.gz",
"type": "ghtagtar",
"repo": "webmproject/libwebp",
"match": "v1\\.\\d+\\.\\d+$",
"provide-pre-built": true,
"license": {
"type": "file",
@@ -446,8 +856,10 @@
}
},
"libxml2": {
"type": "url",
"url": "https://github.com/GNOME/libxml2/archive/refs/tags/v2.12.5.tar.gz",
"type": "ghtagtar",
"repo": "GNOME/libxml2",
"match": "v2\\.\\d+\\.\\d+$",
"provide-pre-built": false,
"license": {
"type": "file",
"path": "Copyright"
@@ -459,7 +871,7 @@
"regex": "/href=\"(?<file>libxslt-(?<version>[^\"]+)\\.tar\\.xz)\"/",
"license": {
"type": "file",
"path": "COPYING"
"path": "Copyright"
}
},
"libyaml": {
@@ -497,7 +909,17 @@
"type": "git",
"path": "php-src/sapi/micro",
"rev": "master",
"url": "https://github.com/easysoft/phpmicro",
"url": "https://github.com/static-php/phpmicro",
"license": {
"type": "file",
"path": "LICENSE"
}
},
"mimalloc": {
"type": "ghtagtar",
"repo": "microsoft/mimalloc",
"match": "v2\\.\\d\\.[^3].*",
"provide-pre-built": false,
"license": {
"type": "file",
"path": "LICENSE"
@@ -514,6 +936,34 @@
"path": "LICENSE"
}
},
"msgpack": {
"type": "url",
"url": "https://pecl.php.net/get/msgpack",
"path": "php-src/ext/msgpack",
"filename": "msgpack.tgz",
"license": {
"type": "file",
"path": "LICENSE"
}
},
"mysqlnd_ed25519": {
"type": "pie",
"repo": "mariadb/mysqlnd_ed25519",
"path": "php-src/ext/mysqlnd_ed25519",
"license": {
"type": "file",
"path": "LICENSE"
}
},
"mysqlnd_parsec": {
"type": "pie",
"repo": "mariadb/mysqlnd_parsec",
"path": "php-src/ext/mysqlnd_parsec",
"license": {
"type": "file",
"path": "LICENSE"
}
},
"ncurses": {
"type": "filelist",
"url": "https://ftp.gnu.org/pub/gnu/ncurses/",
@@ -524,6 +974,14 @@
"path": "COPYING"
}
},
"net-snmp": {
"type": "ghtagtar",
"repo": "net-snmp/net-snmp",
"license": {
"type": "file",
"path": "COPYING"
}
},
"nghttp2": {
"type": "ghrel",
"repo": "nghttp2/nghttp2",
@@ -534,6 +992,26 @@
"path": "COPYING"
}
},
"nghttp3": {
"type": "ghrel",
"repo": "ngtcp2/nghttp3",
"match": "nghttp3.+\\.tar\\.xz",
"prefer-stable": true,
"license": {
"type": "file",
"path": "COPYING"
}
},
"ngtcp2": {
"type": "ghrel",
"repo": "ngtcp2/ngtcp2",
"match": "ngtcp2.+\\.tar\\.xz",
"prefer-stable": true,
"license": {
"type": "file",
"path": "COPYING"
}
},
"onig": {
"type": "ghrel",
"repo": "kkos/oniguruma",
@@ -548,7 +1026,7 @@
"openssl": {
"type": "ghrel",
"repo": "openssl/openssl",
"match": "openssl.+\\.tar\\.gz",
"match": "openssl-3.+\\.tar\\.gz",
"prefer-stable": true,
"alt": {
"type": "filelist",
@@ -561,6 +1039,16 @@
"path": "LICENSE.txt"
}
},
"opentelemetry": {
"type": "url",
"url": "https://pecl.php.net/get/opentelemetry",
"path": "php-src/ext/opentelemetry",
"filename": "opentelemetry.tgz",
"license": {
"type": "file",
"path": "LICENSE"
}
},
"parallel": {
"type": "url",
"url": "https://pecl.php.net/get/parallel",
@@ -571,6 +1059,15 @@
"path": "LICENSE"
}
},
"pcov": {
"type": "url",
"url": "https://pecl.php.net/get/pcov",
"filename": "pcov.tgz",
"license": {
"type": "file",
"path": "LICENSE"
}
},
"pdo_sqlsrv": {
"type": "url",
"url": "https://pecl.php.net/get/pdo_sqlsrv",
@@ -591,13 +1088,22 @@
}
},
"postgresql": {
"type": "url",
"url": "https://ftp.postgresql.org/pub/source/v16.2/postgresql-16.2.tar.bz2",
"type": "ghtagtar",
"repo": "postgres/postgres",
"match": "REL_18_\\d+",
"license": {
"type": "file",
"path": "COPYRIGHT"
}
},
"postgresql-win": {
"type": "url",
"url": "https://get.enterprisedb.com/postgresql/postgresql-16.8-1-windows-x64-binaries.zip",
"license": {
"type": "text",
"text": "PostgreSQL Database Management System\n(also known as Postgres, formerly as Postgres95)\n\nPortions Copyright (c) 1996-2025, The PostgreSQL Global Development Group\n\nPortions Copyright (c) 1994, The Regents of the University of California\n\nPermission to use, copy, modify, and distribute this software and its\ndocumentation for any purpose, without fee, and without a written\nagreement is hereby granted, provided that the above copyright notice\nand this paragraph and the following two paragraphs appear in all\ncopies.\n\nIN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY\nFOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,\nINCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS\nDOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF\nTHE POSSIBILITY OF SUCH DAMAGE.\n\nTHE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,\nINCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS\nON AN \"AS IS\" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS\nTO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS."
}
},
"protobuf": {
"type": "url",
"url": "https://pecl.php.net/get/protobuf",
@@ -636,6 +1142,20 @@
"path": "LICENSE"
}
},
"re2c": {
"type": "ghrel",
"repo": "skvadrik/re2c",
"match": "re2c.+\\.tar\\.xz",
"prefer-stable": true,
"alt": {
"type": "url",
"url": "https://dl.static-php.dev/static-php-cli/deps/re2c/re2c-4.3.tar.xz"
},
"license": {
"type": "file",
"path": "LICENSE"
}
},
"readline": {
"type": "filelist",
"url": "https://ftp.gnu.org/pub/gnu/readline/",
@@ -647,18 +1167,20 @@
}
},
"redis": {
"type": "git",
"type": "url",
"url": "https://pecl.php.net/get/redis",
"path": "php-src/ext/redis",
"rev": "5.3.7",
"url": "https://github.com/phpredis/phpredis",
"filename": "redis.tgz",
"license": {
"type": "file",
"path": "COPYING"
"path": [
"LICENSE",
"COPYING"
]
}
},
"snappy": {
"type": "git",
"repo": "google/snappy",
"rev": "main",
"url": "https://github.com/google/snappy",
"license": {
@@ -667,9 +1189,8 @@
}
},
"spx": {
"type": "git",
"rev": "master",
"url": "https://github.com/static-php/php-spx.git",
"type": "pie",
"repo": "noisebynorthwest/php-spx",
"path": "php-src/ext/spx",
"license": {
"type": "file",
@@ -678,7 +1199,7 @@
},
"sqlite": {
"type": "url",
"url": "https://www.sqlite.org/2023/sqlite-autoconf-3430200.tar.gz",
"url": "https://www.sqlite.org/2024/sqlite-autoconf-3450200.tar.gz",
"provide-pre-built": true,
"license": {
"type": "text",
@@ -696,8 +1217,8 @@
}
},
"swoole": {
"type": "ghtar",
"path": "php-src/ext/swoole",
"type": "ghtar",
"repo": "swoole/swoole-src",
"prefer-stable": true,
"license": {
@@ -706,20 +1227,19 @@
}
},
"swow": {
"type": "git",
"path": "php-src/ext/swow-src",
"rev": "ci",
"url": "https://github.com/swow/swow",
"patch": "patchSwow",
"type": "ghtar",
"repo": "swow/swow",
"prefer-stable": true,
"license": {
"type": "file",
"path": "LICENSE"
}
},
"tidy": {
"type": "url",
"url": "https://github.com/htacg/tidy-html5/archive/refs/tags/5.8.0.tar.gz",
"filename": "tidy-html5.tgz",
"type": "ghtar",
"repo": "htacg/tidy-html5",
"prefer-stable": true,
"license": {
"type": "file",
"path": "README/LICENSE.md"
@@ -734,6 +1254,23 @@
"path": "COPYING"
}
},
"watcher": {
"type": "ghtar",
"repo": "e-dant/watcher",
"prefer-stable": true,
"license": {
"type": "file",
"path": "license"
}
},
"xdebug": {
"type": "pie",
"repo": "xdebug/xdebug",
"license": {
"type": "file",
"path": "LICENSE"
}
},
"xhprof": {
"type": "url",
"url": "https://pecl.php.net/get/xhprof",

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,219 @@
<template>
<div class="contributors-container">
<div class="contributors-header">
<h2>Contributors</h2>
<p class="contributors-description">
Thanks to all the amazing people who have contributed to this project!
</p>
</div>
<div v-if="loading" class="loading-state">
<div class="spinner"></div>
<p>Loading contributors...</p>
</div>
<div v-else-if="error" class="error-state">
<p>{{ error }}</p>
</div>
<div v-else class="contributors-grid">
<a
v-for="contributor in contributors"
:key="contributor.id"
:href="contributor.html_url"
target="_blank"
rel="noopener noreferrer"
class="contributor-card"
:title="contributor.login"
>
<img
:src="contributor.avatar_url"
:alt="contributor.login"
class="contributor-avatar"
loading="lazy"
/>
<div class="contributor-name">{{ contributor.login }}</div>
</a>
</div>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted } from 'vue';
interface Contributor {
id: number;
login: string;
avatar_url: string;
html_url: string;
contributions: number;
}
const contributors = ref<Contributor[]>([]);
const loading = ref(true);
const error = ref('');
const fetchContributors = async () => {
try {
loading.value = true;
error.value = '';
const response = await fetch(
'https://api.github.com/repos/crazywhalecc/static-php-cli/contributors?per_page=24'
);
if (!response.ok) {
throw new Error('Failed to fetch contributors');
}
const data = await response.json();
contributors.value = data;
} catch (err) {
error.value = 'Failed to load contributors. Please try again later.';
console.error('Error fetching contributors:', err);
} finally {
loading.value = false;
}
};
onMounted(() => {
fetchContributors();
});
</script>
<style scoped>
.contributors-container {
margin: 48px auto;
padding: 32px 24px;
max-width: 1152px;
background: linear-gradient(135deg, var(--vp-c-bg-soft) 0%, var(--vp-c-bg) 100%);
border-radius: 16px;
border: 1px solid var(--vp-c-divider);
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}
.contributors-header {
text-align: center;
margin-bottom: 24px;
}
.contributors-header h2 {
font-size: 1.5rem;
font-weight: 700;
margin: 0 0 8px 0;
background: linear-gradient(120deg, var(--vp-c-brand-1), var(--vp-c-brand-2));
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}
.contributors-description {
font-size: 0.95rem;
color: var(--vp-c-text-2);
margin: 0;
line-height: 1.5;
}
.loading-state,
.error-state {
text-align: center;
padding: 40px 20px;
color: var(--vp-c-text-2);
}
.spinner {
width: 40px;
height: 40px;
margin: 0 auto 16px;
border: 4px solid var(--vp-c-divider);
border-top-color: var(--vp-c-brand-1);
border-radius: 50%;
animation: spin 1s linear infinite;
}
@keyframes spin {
to {
transform: rotate(360deg);
}
}
.contributors-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
gap: 16px;
}
.contributor-card {
display: flex;
flex-direction: column;
align-items: center;
padding: 12px;
background: var(--vp-c-bg);
border-radius: 12px;
border: 1px solid var(--vp-c-divider);
transition: all 0.3s ease;
text-decoration: none;
color: var(--vp-c-text-1);
}
.contributor-card:hover {
transform: translateY(-4px);
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
border-color: var(--vp-c-brand-1);
}
.contributor-avatar {
width: 60px;
height: 60px;
border-radius: 50%;
border: 2px solid var(--vp-c-divider);
transition: all 0.3s ease;
margin-bottom: 8px;
}
.contributor-card:hover .contributor-avatar {
border-color: var(--vp-c-brand-1);
transform: scale(1.05);
}
.contributor-name {
font-size: 12px;
font-weight: 500;
text-align: center;
word-break: break-word;
max-width: 100%;
}
@media (max-width: 768px) {
.contributors-container {
margin: 32px 16px;
padding: 24px 16px;
}
.contributors-header h2 {
font-size: 1.25rem;
}
.contributors-description {
font-size: 0.9rem;
}
.contributors-grid {
grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
gap: 12px;
}
.contributor-card {
padding: 8px;
}
.contributor-avatar {
width: 48px;
height: 48px;
}
.contributor-name {
font-size: 11px;
}
}
</style>

View File

@@ -0,0 +1,79 @@
<template>
<div>
<header class="DocSearch-SearchBar" style="padding: 0">
<form class="DocSearch-Form searchinput">
<input class="DocSearch-Input" v-model="filterText" placeholder="Filter name..." @input="doFilter" />
</form>
</header>
<table>
<thead>
<tr>
<th>Extension Name</th>
<th>Linux</th>
<th>macOS</th>
<th>FreeBSD</th>
<th>Windows</th>
</tr>
</thead>
<tbody>
<tr v-for="item in filterData">
<td v-if="!item.notes">{{ item.name }}</td>
<td v-else>
<a :href="'./extension-notes.html#' + item.name">{{ item.name }}</a>
</td>
<td>{{ item.linux }}</td>
<td>{{ item.macos }}</td>
<td>{{ item.freebsd }}</td>
<td>{{ item.windows }}</td>
</tr>
</tbody>
</table>
<div v-if="filterData.length === 0" style="margin: 0 4px 20px 4px; color: var(--vp-c-text-2); font-size: 14px">
No result, please try another keyword.
</div>
</div>
</template>
<script>
export default {
name: "SearchTable"
}
</script>
<script setup>
import {ref} from "vue";
import ext from '../../../config/ext.json';
// 将 ext 转换为列表,方便后续操作
const data = ref([]);
for (const [name, item] of Object.entries(ext)) {
data.value.push({
name,
linux: item.support?.Linux === undefined ? 'yes' : (item.support?.Linux === 'wip' ? '' : item.support?.Linux),
macos: item.support?.Darwin === undefined ? 'yes' : (item.support?.Darwin === 'wip' ? '' : item.support?.Darwin),
freebsd: item.support?.BSD === undefined ? 'yes' : (item.support?.BSD === 'wip' ? '' : item.support?.BSD),
windows: item.support?.Windows === undefined ? 'yes' : (item.support?.Windows === 'wip' ? '' : item.support?.Windows),
notes: item.notes === true,
});
}
const filterData = ref(data.value);
const filterText = ref('');
const doFilter = () => {
if (filterText.value === '') {
filterData.value = data.value;
return;
}
filterData.value = data.value.filter(item => {
return item.name.toLowerCase().includes(filterText.value.toLowerCase());
});
}
</script>
<style>
.searchinput {
border: 1px solid var(--vp-c-divider);
}
</style>

View File

@@ -4,7 +4,7 @@ import sidebarZh from "./sidebar.zh";
// https://vitepress.dev/reference/site-config
export default {
title: "static-php-cli",
title: "Static PHP",
description: "Build single static PHP binary, with PHP project together, with popular extensions included.",
locales: {
en: {
@@ -44,9 +44,22 @@ export default {
},
themeConfig: {
// https://vitepress.dev/reference/default-theme-config
logo: '/images/static-php_nobg.png',
nav: [],
socialLinks: [
{icon: 'github', link: 'https://github.com/crazywhalecc/static-php-cli'}
]
],
footer: {
message: 'Released under the MIT License.',
copyright: 'Copyright © 2023-present crazywhalecc'
},
search: {
provider: 'algolia',
options: {
appId: 'IHJHUB1SF1',
apiKey: '8266d31cc2ffbd0e059f1c6e5bdaf8fc',
indexName: 'static-php docs',
},
},
}
}

View File

@@ -1,53 +1,57 @@
export default {
'/en/guide/': [
{
text: 'Guide',
items: [
{text: 'Guide', link: '/en/guide/'},
{text: 'Actions Build', link: '/en/guide/action-build'},
{text: 'Manual Build', link: '/en/guide/manual-build'},
{text: 'Extension List', link: '/en/guide/extensions'},
{text: 'Extension Notes', link: '/en/guide/extension-notes'},
{text: 'Command Generator', link: '/en/guide/cli-generator'},
{text: 'Environment Variables', link: '/en/guide/env-vars', collapsed: true,},
]
},
{
items: [
{text: 'Troubleshooting', link: '/en/guide/troubleshooting'},
{text: 'Build on Windows', link: '/en/guide/build-on-windows'},
],
}
],
'/en/develop/': [
{
text: 'Development',
items: [
{text: 'Get Started', link: '/en/develop/'},
{text: 'Project Structure', link: '/en/develop/structure'},
{text: 'PHP Source Modification', link: '/en/develop/php-src-changes'},
],
},
{
text: 'Module',
items: [
{text: 'Doctor ', link: '/en/develop/doctor-module'},
{text: 'Source', link: '/en/develop/source-module'},
]
},
{
text: 'Extra',
items: [
{text: 'Compilation Tools', link: '/en/develop/system-build-tools'},
]
}
],
'/en/contributing/': [
{
text: 'Contributing',
items: [
{text: 'Contributing', link: '/en/contributing/'},
],
}
],
'/en/guide/': [
{
text: 'Basic Build Guides',
items: [
{text: 'Guide', link: '/en/guide/'},
{text: 'Build (Local)', link: '/en/guide/manual-build'},
{text: 'Build (CI)', link: '/en/guide/action-build'},
{text: 'Supported Extensions', link: '/en/guide/extensions'},
{text: 'Extension Notes', link: '/en/guide/extension-notes'},
{text: 'Build Command Generator', link: '/en/guide/cli-generator'},
{text: 'Environment Variables', link: '/en/guide/env-vars', collapsed: true,},
{text: 'Dependency Table', link: '/en/guide/deps-map'},
]
},
{
text: 'Extended Build Guides',
items: [
{text: 'Troubleshooting', link: '/en/guide/troubleshooting'},
{text: 'Build on Windows', link: '/en/guide/build-on-windows'},
{text: 'Build with GNU libc', link: '/en/guide/build-with-glibc'},
],
}
],
'/en/develop/': [
{
text: 'Development',
items: [
{text: 'Get Started', link: '/en/develop/'},
{text: 'Project Structure', link: '/en/develop/structure'},
{text: 'PHP Source Modification', link: '/en/develop/php-src-changes'},
],
},
{
text: 'Module',
items: [
{text: 'Doctor ', link: '/en/develop/doctor-module'},
{text: 'Source', link: '/en/develop/source-module'},
]
},
{
text: 'Extra',
items: [
{text: 'Compilation Tools', link: '/en/develop/system-build-tools'},
{text: 'craft.yml Configuration', link: '/zh/develop/craft-yml'},
]
}
],
'/en/contributing/': [
{
text: 'Contributing',
items: [
{text: 'Contributing', link: '/en/contributing/'},
],
}
],
};

View File

@@ -1,53 +1,57 @@
export default {
'/zh/guide/': [
{
text: '构建指南',
items: [
{text: '指南', link: '/zh/guide/'},
{text: 'Actions 构建', link: '/zh/guide/action-build'},
{text: '本地构建', link: '/zh/guide/manual-build'},
{text: '扩展列表', link: '/zh/guide/extensions'},
{text: '扩展注意事项', link: '/zh/guide/extension-notes'},
{text: '编译命令生成器', link: '/zh/guide/cli-generator'},
{text: '环境变量列表', link: '/zh/guide/env-vars'},
]
},
{
items: [
{text: '故障排除', link: '/zh/guide/troubleshooting'},
{text: '在 Windows 上构建', link: '/zh/guide/build-on-windows'},
],
}
],
'/zh/develop/': [
{
text: '开发指南',
items: [
{ text: '开发简介', link: '/zh/develop/' },
{ text: '项目结构简介', link: '/zh/develop/structure' },
{text: '对 PHP 源码的修改', link: '/zh/develop/php-src-changes'},
],
},
{
text: '模块',
items: [
{ text: 'Doctor 环境检查工具', link: '/zh/develop/doctor-module' },
{ text: '资源模块', link: '/zh/develop/source-module' },
]
},
{
text: '其他',
items: [
{text: '系统编译工具', link: '/zh/develop/system-build-tools'},
]
}
],
'/zh/contributing/': [
{
text: '贡献指南',
items: [
{text: '贡献指南', link: '/zh/contributing/'},
],
}
],
'/zh/guide/': [
{
text: '构建指南',
items: [
{text: '指南', link: '/zh/guide/'},
{text: '本地构建', link: '/zh/guide/manual-build'},
{text: 'Actions 构建', link: '/zh/guide/action-build'},
{text: '扩展列表', link: '/zh/guide/extensions'},
{text: '扩展注意事项', link: '/zh/guide/extension-notes'},
{text: '编译命令生成器', link: '/zh/guide/cli-generator'},
{text: '环境变量列表', link: '/zh/guide/env-vars'},
{text: '依赖关系图表', link: '/zh/guide/deps-map'},
]
},
{
text: '扩展构建指南',
items: [
{text: '故障排除', link: '/zh/guide/troubleshooting'},
{text: '在 Windows 上构建', link: '/zh/guide/build-on-windows'},
{text: '构建 GNU libc 兼容的二进制', link: '/zh/guide/build-with-glibc'},
],
}
],
'/zh/develop/': [
{
text: '开发指南',
items: [
{text: '开发简介', link: '/zh/develop/'},
{text: '项目结构简介', link: '/zh/develop/structure'},
{text: '对 PHP 源码的修改', link: '/zh/develop/php-src-changes'},
],
},
{
text: '模块',
items: [
{text: 'Doctor 环境检查工具', link: '/zh/develop/doctor-module'},
{text: '资源模块', link: '/zh/develop/source-module'},
]
},
{
text: '其他',
items: [
{text: '系统编译工具', link: '/zh/develop/system-build-tools'},
{text: 'craft.yml 配置详解', link: '/zh/develop/craft-yml'},
]
}
],
'/zh/contributing/': [
{
text: '贡献指南',
items: [
{text: '贡献指南', link: '/zh/contributing/'},
],
}
],
};

View File

@@ -2,6 +2,7 @@
import DefaultTheme from 'vitepress/theme'
import {inBrowser, useData} from "vitepress";
import {watchEffect} from "vue";
import './style.css';
export default {
...DefaultTheme,
@@ -13,4 +14,4 @@ export default {
}
})
}
}
}

View File

@@ -0,0 +1,24 @@
/** override default styles */
.vp-sponsor-grid-image {
max-height:36px !important;
max-width: 1000px !important;
}
.vp-doc .contributors-header h2 {
padding-top: 0;
border-top: none;
}
.vp-doc .sponsors-header h2 {
padding-top: 0;
border-top: none;
}
.dark .VPImage.logo {
filter: contrast(0.7);
}
.dark .VPImage.image-src {
filter: contrast(0.7);
}

70
docs/deps-craft-yml.md Normal file
View File

@@ -0,0 +1,70 @@
```yaml
# PHP version to build (default: 8.4)
php-version: 8.4
# [REQUIRED] Static PHP extensions to build (list or comma-separated are both accepted)
extensions: bcmath,fileinfo,phar,zlib,sodium,posix,pcntl
# Extra libraries to build (list or comma-separated are both accepted)
libs: [ ]
# [REQUIRED] Build SAPIs (list or comma-separated are both accepted)
sapi: cli,micro,fpm
# Show full console output (default: false)
debug: false
# Build options (same as `build` command options, all options are optional)
build-options:
# Before build, remove all old build files and sources (default: false)
with-clean: false
# Build with all suggested libraries (default: false)
with-suggested-libs: false
# Build with all suggested extensions (default: false)
with-suggested-exts: false
# Build extra shared extensions (list or comma-separated are both accepted)
build-shared: [ ]
# Build without stripping the binary (default: false)
no-strip: false
# Disable Opcache JIT (default: false)
disable-opcache-jit: false
# PHP configuration options (same as --with-config-file-path)
with-config-file-path: ""
# PHP configuration options (same as --with-config-file-scan-dir)
with-config-file-scan-dir: ""
# Hardcoded INI options for cli and micro SAPI (e.g. "memory_limit=4G", list accepted)
with-hardcoded-ini: [ ]
# Pretend micro SAPI as cli SAPI to avoid some frameworks to limit the usage of micro SAPI
with-micro-fake-cli: false
# Additional patch point injection files (e.g. "path/to/patch.php", list accepted)
with-added-patch: [ ]
# Ignore micro extension tests (if you are using micro SAPI, default: false)
without-micro-ext-test: false
# UPX pack the binary (default: false)
with-upx-pack: false
# Set the micro.exe program icon (only for Windows, default: "")
with-micro-logo: ""
# Set micro SAPI as win32 mode, without this, micro SAPI will be compiled as a console application (only for Windows, default: false)
enable-micro-win32: false
# Build options for shared extensions (list or comma-separated are both accepted)
shared-extensions: [ ]
# Download options
download-options:
# Use custom url for specified sources, format: "{source-name}:{url}" (e.g. "php-src:https://example.com/php-8.4.0.tar.gz")
custom-url: [ ]
# Use custom git repo for specified sources, format: "{source-name}:{branch}:{url}" (e.g. "php-src:master:https://github.com/php/php-src.git")
custom-git: [ ]
# Retries count for downloading sources (default: 5)
retry: 5
# Use pre-built libraries if available (default: false)
prefer-pre-built: true
# Do not download from alternative sources (default: false)
no-alt: false
craft-options:
doctor: true
download: true
build: true
# Extra environment variables
extra-env:
# e.g. Use github token to avoid rate limit
GITHUB_TOKEN: your-github-token
```

0
docs/deps-map-ext.md Normal file
View File

0
docs/deps-map-lib.md Normal file
View File

View File

@@ -0,0 +1,7 @@
---
aside: false
---
# craft.yml Configuration
<!--@include: ../../deps-craft-yml.md-->

View File

@@ -36,6 +36,7 @@ The following is the source download configuration corresponding to the `libeven
The most important field here is `type`. Currently, the types it supports are:
- `url`: Directly use URL to download, for example: `https://download.libsodium.org/libsodium/releases/libsodium-1.0.18.tar.gz`.
- `pie`: Download PHP extensions from Packagist using the PIE (PHP Installer for Extensions) standard.
- `ghrel`: Use the GitHub Release API to download, download the artifacts uploaded from the latest version released by maintainers.
- `ghtar`: Use the GitHub Release API to download.
Different from `ghrel`, `ghtar` is downloaded from the `source code (tar.gz)` in the latest Release of the project.
@@ -89,6 +90,37 @@ Example (download the imagick extension and extract it to the extension storage
}
```
## Download type - pie
PIE (PHP Installer for Extensions) type sources refer to downloading PHP extensions from Packagist that follow the PIE standard.
This method automatically fetches extension information from the Packagist repository and downloads the appropriate distribution file.
The parameters included are:
- `repo`: The Packagist vendor/package name, such as `vendor/package-name`
Example (download a PHP extension from Packagist using PIE):
```json
{
"ext-example": {
"type": "pie",
"repo": "vendor/example-extension",
"path": "php-src/ext/example",
"license": {
"type": "file",
"path": "LICENSE"
}
}
}
```
::: tip
The PIE download type will automatically detect the extension information from Packagist metadata,
including the download URL, version, and distribution type.
The extension must be marked as `type: php-ext` or contain `php-ext` metadata in its Packagist package definition.
:::
## Download type - ghrel
ghrel will download files from Assets uploaded in GitHub Release.
@@ -317,3 +349,24 @@ When an open source project has multiple licenses, multiple files can be specifi
}
}
```
When the license of an open source project uses different files between versions,
`path` can be used as an array to list the possible license files:
```json
{
"redis": {
"type": "git",
"path": "php-src/ext/redis",
"rev": "release/6.0.2",
"url": "https://github.com/phpredis/phpredis",
"license": {
"type": "file",
"path": [
"LICENSE",
"COPYING"
]
}
}
}
```

View File

@@ -2,35 +2,59 @@
Here will be some questions that you may encounter easily. There are currently many, but I need to take time to organize them.
## Can statically compiled PHP install extensions?
## What is the path of php.ini ?
Because the principle of installing extensions in PHP under the traditional architecture is to install new extensions using `.so` type dynamic link libraries,
and statically linked PHP compiled using this project cannot **directly** install new extensions using dynamic link libraries.
On Linux, macOS and FreeBSD, the path of `php.ini` is `/usr/local/etc/php/php.ini`.
On Windows, the path is `C:\windows\php.ini` or the current directory of `php.exe`.
The directory where to look for `php.ini` can be changed on *nix using the manual build option `--with-config-file-path`.
For the macOS platform, almost all binary files under macOS cannot be linked purely statically,
and almost all binary files will link macOS system libraries: `/usr/lib/libresolv.9.dylib` and `/usr/lib/libSystem.B.dylib`.
So under macOS system, statically compiled php binary files can be used under certain compilation conditions,
and dynamic link extensions can be used at the same time:
In addition, on Linux, macOS and FreeBSD, `.ini` files present in the `/usr/local/etc/php/conf.d` directory will also be loaded.
On Windows, this path is empty by default.
The directory can be changed using the manual build option `--with-config-file-scan-dir`.
1. Using the `--no-strip` parameter will not strip information such as debugging symbols from the binary file for use with external Zend extensions such as `Xdebug`.
2. If you want to compile some Zend extensions, use Homebrew, MacPorts, source code compilation, and install a normal version of PHP on your operating system.
3. Use the `phpize && ./configure && make` command to compile the extensions you want to use.
4. Copy the extension file `xxxx.so` to the outside, use the statically compiled PHP binary, for example to use the Xdebug extension: `cd buildroot/bin/ && ./php -d "zend_extension=/path/to/xdebug.so"`.
`php.ini` will also be searched for in [the other standard locations](https://www.php.net/manual/configuration.file.php).
## Can statically-compiled PHP install extensions?
Because the principle of installing PHP extensions under the normal mode is to use `.so` type dynamic link library to install new extensions,
and we use the static link PHP compiled by this project. However, static linking has different definitions in different operating systems.
First of all, for Linux systems, statically linked binaries will not link the system's dynamic link library.
Purely statically linked binaries (`build with -all-static`) cannot load dynamic libraries, so new extensions cannot be added.
At the same time, in pure static mode, you cannot use extensions such as `ffi` to load external `.so` modules.
You can use the command `ldd buildroot/bin/php` to check whether the binary you built under Linux is purely statically linked.
If you [build GNU libc based PHP](../guide/build-with-glibc), you can use the `ffi` extension to load external `.so` modules and load `.so` extensions with the same ABI.
For example, you can use the following command to build a static PHP binary dynamically linked with glibc,
supporting FFI extensions and loading the `xdebug.so` extension of the same PHP version and the same TS type:
```bash
# build statically linked php-cli but not stripped
bin/spc build ffi --build-cli --no-strip
bin/spc-gnu-docker download --for-extensions=ffi,xml --with-php=8.4
bin/spc-gnu-docker build ffi,xml --build-cli --debug
buildroot/bin/php -d "zend_extension=/path/to/php{PHP_VER}-{ts/nts}/xdebug.so" --ri xdebug
```
For the Linux platform, the current compilation result is a purely statically linked binary file,
and new extensions cannot be installed using a dynamic link library.
For macOS platform, almost all binaries under macOS cannot be truly purely statically linked, and almost all binaries will link macOS system libraries: `/usr/lib/libresolv.9.dylib` and `/usr/lib/libSystem.B.dylib`.
So on macOS, you can **directly** use SPC to build statically compiled PHP binaries with dynamically linked extensions:
1. Build shared extension `xxx.so` using: `--build-shared=XXX` option. e.g. `bin/spc build bcmath,zlib --build-shared=xdebug --build-cli`
2. You will get `buildroot/modules/xdebug.so` and `buildroot/bin/php`.
3. The `xdebug.so` file could be used for php that version and thread-safe are the same.
For the Windows platform, since officially built extensions (such as `php_yaml.dll`) force the use of the `php8.dll` dynamic library as a link, and statically built PHP does not include any dynamic libraries other than system libraries,
php.exe built by static-php cannot load officially built dynamic extensions. Since static-php-cli does not yet support building dynamic extensions, there is currently no way to load dynamic extensions with static-php.
However, Windows can normally use the `FFI` extension to load other dll files and call them.
## Can it support Oracle database extension?
Some extensions that rely on closed source libraries, such as `oci8`, `sourceguardian`, etc.,
they do not provide purely statically compiled dependent library files (`.a`), only dynamic dependent library files (`.so`).
These extensions cannot be compiled into static-php-cli from source, so this project may never support them.
However, in theory, you can access and use such extensions under macOS according to the above questions.
These extensions cannot be compiled into static-php-cli using source code, so this project may never support these extensions.
However, in theory you can access and use such extensions under macOS and Linux according to the above questions.
If you have a need for such extensions, or most people have needs for these closed-source extensions,
see the discussion on [standalone-php-cli](https://github.com/crazywhalecc/static-php-cli/discussions/58). Welcome to leave a message.
@@ -63,6 +87,8 @@ such as Swoole Compiler, Source Guardian, etc.
## Unable to use ssl
**Update: This issue has been fixed in the latest version of static-php-cli, which now reads the system's certificate file by default. If you still have problems, try the solution below.**
When using curl, pgsql, etc. to request an HTTPS website or establish an SSL connection, there may be an `error:80000002:system library::No such file or directory` error.
This error is caused by statically compiled PHP without specifying `openssl.cafile` via `php.ini`.
@@ -72,3 +98,11 @@ For Linux systems, you can download the [cacert.pem](https://curl.se/docs/caextr
For the certificate locations of different distros, please refer to [Golang docs](https://go.dev/src/crypto/x509/root_linux.go).
> INI configuration `openssl.cafile` cannot be set dynamically using the `ini_set()` function, because `openssl.cafile` is a `PHP_INI_SYSTEM` type configuration and can only be set in the `php.ini` file.
## Why don't we support older versions of PHP?
Because older versions of PHP have many problems, such as security issues, performance issues, and functional issues.
In addition, many older versions of PHP are not compatible with the latest dependency libraries,
which is one of the reasons why older versions of PHP are not supported.
You can use older versions compiled earlier by static-php-cli, such as PHP 8.0, but earlier versions will not be explicitly supported.

View File

@@ -16,8 +16,10 @@ while also defining the extensions to compile.
1. Fork project.
2. Go to the Actions of the project and select `CI`.
3. Select `Run workflow`, fill in the PHP version you want to compile, the target type, and the list of extensions. (extensions comma separated, e.g. `bcmath,curl,mbstring`)
4. After waiting for about a period of time, enter the corresponding task and get `Artifacts`.
3. Select `Run workflow`, fill in the PHP version you want to compile, the target type, and the list of static extensions. (comma separated, e.g. `bcmath,curl,mbstring`)
4. If you need shared extensions (for example `xdebug`), set `shared-extensions` (comma separated, e.g. `xdebug`).
5. If you need FrankenPHP, enable `build-frankenphp` and also enable `enable-zts`.
6. After waiting for about a period of time, enter the corresponding task and get `Artifacts`.
If you enable `debug`, all logs will be output at build time, including compiled logs, for troubleshooting.

View File

@@ -74,6 +74,12 @@ bin/setup-runtime -action add-path
bin/setup-runtime -action remove-path
```
Finally, now that you have PHP and Composer installed, you need to install static-php-cli's Composer dependencies:
```shell
composer install
```
### Install other Tools (automatic)
For `php-sdk-binary-tools`, `strawberry-perl`, and `nasm`,
@@ -159,7 +165,8 @@ You can try to use the following commands:
- `--with-clean`: clean up old make files before compiling PHP
- `--enable-zts`: Make compiled PHP thread-safe version (default is NTS version)
- `--with-libs=XXX,YYY`: Compile the specified dependent library before compiling PHP, and activate some extension optional functions
- `--with-libs=XXX,YYY`: Compile the specified dependent library before compiling PHP, and activate some extension optional functions
- `--with-config-file-scan-dir=XXX`: Set the directory to scan for `.ini` files after reading `php.ini` (Check [here](../faq/index.html#what-is-the-path-of-php-ini) for default paths)
- `-I xxx=yyy`: Hard compile INI options into PHP before compiling (support multiple options, alias is `--with-hardcoded-ini`)
- `--with-micro-fake-cli`: When compiling micro, let micro's `PHP_SAPI` pretend to be `cli` (for compatibility with some programs that check `PHP_SAPI`)
- `--disable-opcache-jit`: Disable opcache jit (enabled by default)

View File

@@ -0,0 +1,64 @@
# Build glibc Compatible Linux Binary
## Why Build glibc Compatible Binary
Currently, the binaries built by static-php-cli on Linux by default are based on musl-libc (statically linked).
musl-libc is a lightweight libc implementation
that aims to be compatible with glibc and provides good support for pure static linking.
This means that the compiled static PHP executable can be used on almost any Linux distribution without worrying about the versions of libc, libstdc++, etc.
However, there are some issues with pure static linking of musl-libc binaries on Linux:
- The `dl()` function in PHP cannot be used to load dynamic libraries and external PHP extensions.
- The FFI extension in PHP cannot be used.
- In some extreme cases, performance issues may occur. See [musl-libc performance issues](https://github.com/php/php-src/issues/13648).
Different Linux distributions use different default libc.
For example, Alpine Linux uses musl libc, while most Linux distributions use glibc.
However, even so, we cannot directly use any distribution using glibc to build portable static binaries because glibc has some issues:
- Binaries built with gcc and other tools on newer versions of distributions cannot run on older versions of distributions.
- glibc is not recommended to be statically linked because some of its features require the support of dynamic libraries.
However, we can use Docker to solve this problem.
The final output is a binary **dynamically linked with glibc** and some necessary libraries,
but **statically linked with all other dependencies**.
1. Use an older version of a Linux distribution (such as CentOS 7.x), which has an older version of glibc but can run on most modern Linux distributions.
2. Build the static binary of PHP in this container so that it can run on most modern Linux distributions.
> Using glibc static binaries can run on most modern Linux distributions but cannot run on musl libc distributions, such as CentOS 6, Alpine Linux, etc.
## Build glibc Compatible Linux Binary
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.
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.
```bash
bin/spc-gnu-docker
```
After the image is built, you will see the same command help menu as `bin/spc`, which means the container is ready.
After the container is ready, you can refer to the [local build](./manual-build) section to build your PHP static binary.
Just replace `bin/spc` or `./spc` with `bin/spc-gnu-docker`.
```bash
bin/spc-gnu-docker build bcmath,ctype,openssl,pdo,phar,posix,session,tokenizer,xml,zip --build-cli --debug
```
## Notes
In rare cases, glibc-based static PHP may encounter segment faults and other errors, but there are currently few examples.
If you encounter any issues, please submit an issue.
glibc build is an extended feature and is not part of the default static-php support.
If you have related issues or requirements, please indicate that you are building based on glibc when submitting an issue.
If you need to build glibc-based binaries without using Docker,
please refer to the `bin/spc-gnu-docker` script to manually create a similar environment.
Please keep in mind that we only support glibc build with `bin/spc-gnu-docker`. Compilation on RHEL 9 & 10 has been tested and is stable, but if you run into issues, we may choose not to fix them.

View File

@@ -1,3 +1,7 @@
---
aside: false
---
<script setup lang="ts">
import CliGenerator from "../../.vitepress/components/CliGenerator.vue";
</script>

26
docs/en/guide/deps-map.md Normal file
View File

@@ -0,0 +1,26 @@
---
outline: 'deep'
---
# Dependency Table
When compiling PHP, each extension and library has dependencies, which may be required or optional.
You can choose whether to include these optional dependencies.
For example, when compiling the `gd` extension under Linux,
the `zlib,libpng` libraries and the `zlib` extension are forced to be compiled,
while the `libavif,libwebp,libjpeg,freetype` libraries are optional libraries and will not be compiled by default
unless specified by the `--with-libs=avif,webp,jpeg,freetype` option.
- For optional extensions (optional features of extensions), you need to specify them manually at compile time, for example, to enable igbinary support for Redis: `bin/spc build redis,igbinary`.
- For optional libraries, you need to compile and specify them through the `--with-libs=XXX` option.
- If you want to enable all optional extensions, you can use `bin/spc build redis --with-suggested-exts`.
- If you want to enable all optional libraries, you can use `--with-suggested-libs`.
## Extension Dependency Table
<!--@include: ../../deps-map-ext.md-->
## Library Dependency Table
<!--@include: ../../deps-map-lib.md-->

View File

@@ -1,12 +1,23 @@
---
aside: false
---
# Environment variables
All environment variables mentioned in the list on this page have default values unless otherwise noted.
You can override the default values by setting these environment variables.
## Environment variables list
Starting from version 2.3.5, we have centralized the environment variables in the `config/env.ini` file.
You can set environment variables by modifying this file.
We divide the environment variables supported by static-php-cli into three types:
- Global internal environment variables: declared after static-php-cli starts, you can use `getenv()` to get them internally in static-php-cli, and you can override them before starting static-php-cli.
- Fixed environment variables: declared after static-php-cli starts, you can only use `getenv()` to get them, but you cannot override them through shell scripts.
- Config file environment variables: declared before static-php-cli build, you can set these environment variables by modifying the `config/env.ini` file or through shell scripts.
You can read the comments for each parameter in [config/env.ini](https://github.com/crazywhalecc/static-php-cli/blob/main/config/env.ini) to understand its purpose.
## Custom environment variables
Generally, you don't need to modify any of the following environment variables as they are already set to optimal values.
However, if you have special needs, you can set these environment variables to meet your needs
(for example, you need to debug PHP performance under different compilation parameters).
@@ -22,91 +33,28 @@ bin/spc build mbstring,pcntl --build-cli
SPC_CONCURRENCY=4 bin/spc build mbstring,pcntl --build-cli
```
## General environment variables
Or, if you need to modify an environment variable for a long time, you can modify the `config/env.ini` file.
General environment variables can be used by all build targets.
`config/env.ini` is divided into three sections, `[global]` is globally effective, `[windows]`, `[macos]`, `[linux]` are only effective for the corresponding operating system.
| var name | default value | comment |
|------------------------------|---------------------------|-------------------------------------------------|
| `BUILD_ROOT_PATH` | `{pwd}/buildroot` | The root directory of the build target |
| `BUILD_LIB_PATH` | `{pwd}/buildroot/lib` | The root directory of compilation libraries |
| `BUILD_INCLUDE_PATH` | `{pwd}/buildroot/include` | Header file directory for compiling libraries |
| `BUILD_BIN_PATH` | `{pwd}/buildroot/bin` | Compiled binary file directory |
| `PKG_ROOT_PATH` | `{pwd}/pkgroot` | Directory where precompiled tools are installed |
| `SOURCE_PATH` | `{pwd}/source` | The source code extract directory |
| `DOWNLOAD_PATH` | `{pwd}/downloads` | Downloaded file directory |
| `SPC_CONCURRENCY` | Depends on CPU cores | Number of parallel compilations |
| `SPC_SKIP_PHP_VERSION_CHECK` | empty | Skip PHP version check when set to `yes` |
For example, if you need to modify the `./configure` command for compiling PHP, you can find the `SPC_CMD_PREFIX_PHP_CONFIGURE` environment variable in the `config/env.ini` file, and then modify its value.
## OS specific variables
If your build conditions are more complex and require multiple `env.ini` files to switch,
we recommend that you use the `config/env.custom.ini` file.
In this way, you can specify your environment variables by writing additional override items
without modifying the default `config/env.ini` file.
These environment variables are system-specific and will only take effect on a specific OS.
```ini
; This is an example of `config/env.custom.ini` file,
; we modify the `SPC_CONCURRENCY` and linux default CFLAGS passing to libs and PHP
[global]
SPC_CONCURRENCY=4
### Windows
[linux]
SPC_DEFAULT_C_FLAGS="-O3"
```
| var name | default value | comment |
|----------------|------------------------------|---------------------------|
| `PHP_SDK_PATH` | `{pwd}\php-sdk-binary-tools` | PHP SDK tools path |
| `UPX_EXEC` | `$PKG_ROOT_PATH\bin\upx.exe` | UPX compression tool path |
### macOS
| var name | default value | comment |
|--------------------------------------|--------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------|
| `CC` | `clang` | C Compiler |
| `CXX` | `clang++` | C++ Compiler |
| `SPC_DEFAULT_C_FLAGS` | `--target=arm64-apple-darwin` or `--target=x86_64-apple-darwin` | Default C flags (not the same as `CFLAGS`) |
| `SPC_DEFAULT_CXX_FLAGS` | `--target=arm64-apple-darwin` or `--target=x86_64-apple-darwin` | Default C flags (not the same as `CPPFLAGS`) |
| `SPC_CMD_PREFIX_PHP_BUILDCONF` | `./buildconf --force` | PHP `buildconf` command prefix |
| `SPC_CMD_PREFIX_PHP_CONFIGURE` | `./configure --prefix= --with-valgrind=no --enable-shared=no --enable-static=yes --disable-all --disable-cgi --disable-phpdbg` | PHP `configure` command prefix |
| `SPC_CMD_PREFIX_PHP_MAKE` | `make -j$SPC_CONCURRENCY` | PHP `make` command prefix |
| `SPC_CMD_VAR_PHP_CONFIGURE_CFLAGS` | `$SPC_DEFAULT_C_FLAGS -Werror=unknown-warning-option` | `CFLAGS` variable of PHP `configure` command |
| `SPC_CMD_VAR_PHP_CONFIGURE_CPPFLAGS` | `-I$BUILD_INCLUDE_PATH` | `CPPFLAGS` variable of PHP `configure` command |
| `SPC_CMD_VAR_PHP_CONFIGURE_LDFLAGS` | `-L$BUILD_LIB_PATH` | `LDFLAGS` variable of PHP `configure` command |
| `SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS` | `-g0 -Os` or `-g -O0` (the latter when using `--no-strip`) | `EXTRA_CFLAGS` variable of PHP `make` command |
| `SPC_CMD_VAR_PHP_MAKE_EXTRA_LIBS` | `-lresolv` | Extra `EXTRA_LIBS` variables for PHP `make` command |
### Linux
| var name | default value | comment |
|----------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------|
| `UPX_EXEC` | `$PKG_ROOT_PATH/bin/upx` | UPX compression tool path |
| `GNU_ARCH` | `x86_64` or `aarch64` | CPU architecture |
| `CC` | Alpine: `gcc`, Other: `$GNU_ARCH-linux-musl-gcc` | C Compiler |
| `CXX` | Alpine: `g++`, Other: `$GNU_ARCH-linux-musl-g++` | C++ Compiler |
| `AR` | Alpine: `ar`, Other: `$GNU_ARCH-linux-musl-ar` | Static library tools |
| `LD` | `ld.gold` | Linker |
| `PATH` | `/usr/local/musl/bin:/usr/local/musl/$GNU_ARCH-linux-musl/bin:$PATH` | System PATH |
| `SPC_DEFAULT_C_FLAGS` | empty | Default C flags |
| `SPC_DEFAULT_CXX_FLAGS` | empty | Default C++ flags |
| `SPC_CMD_PREFIX_PHP_BUILDCONF` | `./buildconf --force` | PHP `buildconf` command prefix |
| `SPC_CMD_PREFIX_PHP_CONFIGURE` | `LD_LIBRARY_PATH={ld_lib_path} ./configure --prefix= --with-valgrind=no --enable-shared=no --enable-static=yes --disable-all --disable-cgi --disable-phpdbg` | PHP `configure` command prefix |
| `SPC_CMD_PREFIX_PHP_MAKE` | `make -j$SPC_CONCURRENCY` | PHP `make` command prefix |
| `SPC_CMD_VAR_PHP_CONFIGURE_CFLAGS` | `$SPC_DEFAULT_C_FLAGS` | `CFLAGS` variable of PHP `configure` command |
| `SPC_CMD_VAR_PHP_CONFIGURE_CPPFLAGS` | `-I$BUILD_INCLUDE_PATH` | `CPPFLAGS` variable of PHP `configure` command |
| `SPC_CMD_VAR_PHP_CONFIGURE_LDFLAGS` | `-L$BUILD_LIB_PATH` | `LDFLAGS` variable of PHP `configure` command |
| `SPC_CMD_VAR_PHP_CONFIGURE_LIBS` | `-ldl -lpthread` | `LIBS` variable of PHP `configure` command |
| `SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS` | `-g0 -Os -fno-ident -fPIE` or `-g -O0 -fno-ident -fPIE` (the latter when using `--no-strip`) | `EXTRA_CFLAGS` variable of PHP `make` command |
| `SPC_CMD_VAR_PHP_MAKE_EXTRA_LIBS` | empty | Extra `EXTRA_LIBS` variables for PHP `make` command |
| `SPC_CMD_VAR_PHP_MAKE_EXTRA_LDFLAGS_PROGRAM` | `-all-static` (when using `clang`: `-Xcompiler -fuse-ld=lld -all-static`) | Additional `LDFLAGS` variable for `make` command |
| `SPC_NO_MUSL_PATH` | empty | Whether to not insert the PATH of the musl toolchain (not inserted when the value is `yes`) |
> `{ld_lib_path}` value is `/usr/local/musl/$GNU_ARCH-linux-musl/lib`。
### FreeBSD
Due to the small number of users of the FreeBSD system, we do not provide environment variables for the FreeBSD system for the time being.
### Unix
For Unix systems such as macOS, Linux, FreeBSD, etc., the following environment variables are common.
| var name | default value | comment |
|-------------------|------------------------------|----------------------------|
| `PATH` | `$BUILD_BIN_PATH:$PATH` | System PATH |
| `PKG_CONFIG_PATH` | `$BUILD_LIB_PATH/pkgconfig` | pkg-config search path |
| `PKG_CONFIG` | `$BUILD_BIN_PATH/pkg-config` | pkg-config executable path |
## Library Environment variables (Unix only)
## Library environment variables (Unix only)
Starting from 2.2.0, static-php-cli supports custom environment variables for all compilation dependent library commands of macOS, Linux, FreeBSD and other Unix systems.

View File

@@ -6,6 +6,8 @@ which will be listed one by one here.
## curl
HTTP3 support is not enabled by default, compile with `--with-libs="nghttp2,nghttp3,ngtcp2"` to enable HTTP3 support for PHP >= 8.4.
When using curl to request HTTPS, there may be an `error:80000002:system library::No such file or directory` error.
For details on the solution, see [FAQ - Unable to use ssl](../faq/#unable-to-use-ssl).
@@ -44,15 +46,27 @@ If you use `swoole,swoole-hook-sqlite`, you will enable the coroutine mode of Sw
swoole-hook-sqlite conflicts with the `pdo_sqlite` extension. If you want to use Swoole and `pdo_sqlite`, please delete the pdo_sqlite extension and enable `swoole` and `swoole-hook-sqlite`.
This extension contains an implementation of the coroutine environment for `pdo_sqlite`.
## swoole-hook-odbc
swoole-hook-odbc is not an extension, it's a Hook feature of Swoole.
If you use `swoole,swoole-hook-odbc`, you will enable the coroutine mode of Swoole's `odbc` extension.
swoole-hook-odbc conflicts with the `pdo_odbc` extension. If you want to use Swoole and `pdo_odbc`, please delete the `pdo_odbc` extension and enable `swoole` and `swoole-hook-odbc`.
This extension contains an implementation of the coroutine environment for `pdo_odbc`.
## swow
1. Only PHP version >= 8.0 is supported.
1. Only PHP 8.0+ is supported.
## imagick
1. OpenMP support is disabled, this is recommended by the maintainers and also the case system packages.
## imap
1. Kerberos is not supported
2. ext-imap is not thread safe due to the underlying c-client. It's not possible to use it in --enable-zts builds.
3. Because the extension may be dropped from php, we recommend you look for an alternative implementation, such as [Webklex/php-imap](https://github.com/Webklex/php-imap)
2. ext-imap is not thread safe due to the underlying c-client. It's not possible to use it in `--enable-zts` builds.
3. The extension was dropped from php 8.4, we recommend you look for an alternative implementation, such as [Webklex/php-imap](https://github.com/Webklex/php-imap)
## gd
@@ -76,11 +90,9 @@ and this extension cannot be compiled into php by static linking, so it cannot b
## xdebug
1. Xdebug is a Zend extension. The functions of Xdebug depend on PHP's Zend engine and underlying code.
If you want to statically compile it into PHP, you may need a huge amount of patch code, which is not feasible.
2. The macOS platform can compile an xdebug extension under PHP compiled on the same platform,
extract the `xdebug.so` file, and then use the `--no-strip` parameter in static-php-cli to retain the debug symbol table and add the `ffi` extension.
The compiled `./php` binary can be configured and run by specifying the INI, eg `./php -d 'zend_extension=/path/to/xdebug.so' your-code.php`.
1. Xdebug is only buildable as a shared extension. On Linux, you'll need to use a SPC_TARGET like `native-native -dynamic` or `native-native-gnu`.
2. When using Linux/glibc or macOS, you can compile Xdebug as a shared extension using --build-shared="xdebug".
The compiled `./php` binary can be configured and run by specifying the INI, eg `./php -d 'zend_extension=/path/to/xdebug.so' your-code.php`.
## xml
@@ -118,13 +130,13 @@ For details on the solution, see [FAQ - Unable to use ssl](../faq/#unable-to-use
## password-argon2
1. password-argon2 is not a standard extension, it is an additional algorithm for the `password_hash` function.
2. On Linux systems, `password-argon2` dependency `libargon2` conflicts with the `libsodium` library.
1. password-argon2 is not a standard extension. The algorithm `PASSWORD_ARGON2ID` for the `password_hash` function needs libsodium or libargon2 to work.
2. using password-argon2 enables multithread support for this.
## ffi
1. Linux not supported yet: Due to limitations of the Linux system, although the ffi extension can be compiled successfully, it cannot be used to load other `so` extensions.
The prerequisite for Linux to support loading `so` extensions is dynamic compilation, but dynamic compilation conflicts with the purpose of this project.
1. Due to the limitation of musl libc's static linkage, you cannot use ffi because dynamic libraries cannot be loaded.
If you need to use the ffi extension, see [Compile PHP with GNU libc](./build-with-glibc).
2. macOS supports the ffi extension, but errors will occur when some kernels do not contain debugging symbols.
3. Windows x64 supports the ffi extension.
@@ -147,5 +159,10 @@ Parallel is only supported on PHP 8.0 ZTS and above.
## spx
1. The [SPX extension](https://github.com/NoiseByNorthwest/php-spx) only supports NTS mode.
2. SPX does not support Windows, and the official repository does not support static compilation. static-php-cli uses a [modified version](https://github.com/static-php/php-spx).
1. SPX does not support Windows, and the official repository does not support static compilation. static-php-cli uses a [modified version](https://github.com/static-php/php-spx).
## mimalloc
1. This is not technically an extension, but a library.
2. Building with `--with-libs="mimalloc"` on Linux or macOS will override the default allocator.
3. This is experimental for now, but is recommended in threaded environments.

View File

@@ -1,3 +1,7 @@
<script setup>
import SearchTable from "../../.vitepress/components/SearchTable.vue";
</script>
# Extensions
> - `yes`: supported
@@ -5,7 +9,7 @@
> - `no` with issue link: confirmed to be unavailable due to issue
> - `partial` with issue link: supported but not perfect due to issue
<!--@include: ../../extensions.md-->
<search-table />
::: tip
If an extension you need is missing, you can create a [Feature Request](https://github.com/crazywhalecc/static-php-cli/issues).
@@ -14,14 +18,6 @@ Some extensions or libraries that the extension depends on will have some option
For example, the gd library optionally supports libwebp, freetype, etc.
If you only use `bin/spc build gd --build-cli` they will not be included (static-php-cli defaults to the minimum dependency principle).
You can use `--with-libs=` to add these libraries when compiling.
When the dependent libraries of this compilation include them, gd will automatically use them to enable these features.
(For example: `bin/spc build gd --with-libs=libwebp,freetype --build-cli`)
Alternatively you can use `--with-suggested-exts` and `--with-suggested-libs` to enable all optional dependencies of these extensions and libraries.
(For example: `bin/spc build gd --with-suggested-libs --build-cli`)
If you don't know whether an extension has optional features,
you can check the [spc configuration file](https://github.com/crazywhalecc/static-php-cli/tree/main/config)
or use the command `bin/spc dev:extensions` (library dependency is `lib-suggests`, extension dependency is `ext-suggests`).
For more information about optional libraries, see [Extensions, Library Dependency Map](./deps-map).
For optional libraries, you can also select an extension from the [Command Generator](./cli-generator) and then select optional libraries.
:::

View File

@@ -5,14 +5,10 @@ currently supporting Linux and macOS systems.
In the guide section, you will learn how to use static php cli to build standalone PHP programs.
- [GitHub Action Build](./action-build)
- [Manual Build](./manual-build)
- [Build (local)](./manual-build)
- [Build (GitHub Actions)](./action-build)
- [Supported Extensions](./extensions)
::: tip
If you are a native English speaker, some corrections to the documentation are welcome.
:::
## Compilation Environment
The following is the architecture support situation, where :gear: represents support for GitHub Action build,
@@ -25,19 +21,30 @@ The following is the architecture support situation, where :gear: represents sup
| Windows | :gear: :computer: | |
| FreeBSD | :computer: | :computer: |
Among them, Linux is currently only tested on Ubuntu, Debian, and Alpine distributions,
and other distributions have not been tested, which cannot guarantee successful compilation.
For untested distributions, local compilation can be done using methods such as Docker to avoid environmental issues.
Current supported PHP versions for compilation:
There are two architectures for macOS: `x86_64` and `Arm`, but binaries compiled on one architecture cannot be directly used on the other architecture.
Rosetta 2 cannot guarantee that programs compiled with `Arm` architecture can fully run on `x86_64` environment.
> :warning: Partial support, there may be issues with new beta versions and old versions.
>
> :heavy_check_mark: Supported
>
> :x: Not supported
Windows currently only supports the x86_64 architecture, and does not support 32-bit x86 or arm64 architecture.
| PHP Version | Status | Comment |
|-------------|--------------------|-------------------------------------------------------------------------------------------------------------------------|
| 7.2 | :x: | |
| 7.3 | :x: | phpmicro and many extensions do not support 7.3, 7.4 versions |
| 7.4 | :x: | phpmicro and many extensions do not support 7.3, 7.4 versions |
| 8.0 | :warning: | PHP official has stopped maintaining 8.0, we no longer handle 8.0 related backport support |
| 8.1 | :warning: | PHP official only provides security updates for 8.1, we no longer handle 8.1 related backport support after 8.5 release |
| 8.2 | :heavy_check_mark: | |
| 8.3 | :heavy_check_mark: | |
| 8.4 | :heavy_check_mark: | |
| 8.5 (beta) | :warning: | PHP 8.5 is currently in beta stage |
## Supported PHP Version
> This table shows the support status of static-php-cli for building corresponding versions, not the PHP official support status for that version.
Currently, static php cli supports PHP versions 8.0 to 8.3, and theoretically supports PHP 7.4 and earlier versions.
Simply select the earlier version when downloading.
However, due to some extensions and special components that have stopped supporting earlier versions of PHP,
static-php-cli will not explicitly support earlier versions.
## PHP Support Versions
Currently, static-php-cli supports PHP versions 8.2 ~ 8.5, and theoretically supports PHP 8.1 and earlier versions, just select the earlier version when downloading.
However, due to some extensions and special components that have stopped supporting earlier versions of PHP, static-php-cli will not explicitly support earlier versions.
We recommend that you compile the latest PHP version possible for a better experience.

View File

@@ -1,3 +1,7 @@
---
outline: 'deep'
---
# Build (Linux, macOS, FreeBSD)
This section covers the build process for Linux, macOS, and FreeBSD. If you want to build on Windows,
@@ -57,56 +61,6 @@ cd static-php-cli
composer update
```
### Use System PHP
Below are some example commands for installing PHP and Composer in the system.
It is recommended to search for the specific installation method yourself or ask the AI search engine to obtain the answer,
which will not be elaborated here.
```bash
# [macOS], need install Homebrew first. See https://brew.sh/
# 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.
brew install php wget
wget https://getcomposer.org/download/latest-stable/composer.phar -O /path/to/your/bin/composer && chmod +x /path/to/your/bin/composer
# [Debian], you need to make sure your php version >= 8.1 and composer >= 2.0
sudo apt install php-cli composer php-tokenizer
# [Alpine]
apk add bash file wget xz php81 php81-common php81-pcntl php81-tokenizer php81-phar php81-posix php81-xml composer
```
::: tip
Currently, some versions of Ubuntu install older PHP versions,
so no installation commands are provided. If necessary, it is recommended to add software sources such as ppa first,
and then install the latest version of PHP and tokenizer, XML, and phar extensions.
Older versions of Debian may have an older (<= 7.4) version of PHP installed by default, it is recommended to upgrade Debian first.
:::
### Use Docker
If you don't want to install PHP and Composer runtime environment on your system, you can use the built-in Docker environment build script.
```bash
# To use directly, replace `bin/spc` with `bin/spc-alpine-docker` in all used commands
bin/spc-alpine-docker
```
The first time the command is executed, `docker build` will be used to build a Docker image.
The default built Docker image is the `x86_64` architecture, and the image name is `cwcc-spc-x86_64`.
If you want to build `aarch64` static-php-cli in `x86_64` environment,
you can use qemu to emulate the arm image to run Docker, but the speed will be very slow.
Use command: `SPC_USE_ARCH=aarch64 bin/spc-alpine-docker`.
If it prompts that sudo is required to run after running,
execute the following command once to grant static-php-cli permission to execute sudo:
```bash
export SPC_USE_SUDO=yes
```
### Use Precompiled Static PHP Binaries
If you don't want to use Docker and install PHP in the system,
@@ -133,17 +87,109 @@ This script will download two files in total: `bin/php` and `bin/composer`. Afte
it is equivalent to installing PHP in the system, you can directly Use commands such as `composer`, `php -v`, or directly use `bin/spc`.
2. Direct call, such as executing static-php-cli command: `bin/php bin/spc --help`, executing Composer: `bin/php bin/composer update`.
## Command - download
### Use Docker
If you don't want to install PHP and Composer runtime environment on your system, you can use the built-in Docker environment build script.
```bash
# To use directly, replace `bin/spc` with `bin/spc-alpine-docker` in all used commands
bin/spc-alpine-docker
```
The first time the command is executed, `docker build` will be used to build a Docker image.
The default built Docker image is the `x86_64` architecture, and the image name is `cwcc-spc-x86_64`.
If you want to build `aarch64` static-php-cli in `x86_64` environment,
you can use qemu to emulate the arm image to run Docker, but the speed will be very slow.
Use command: `SPC_USE_ARCH=aarch64 bin/spc-alpine-docker`.
If it prompts that sudo is required to run after running,
execute the following command once to grant static-php-cli permission to execute sudo:
```bash
export SPC_USE_SUDO=yes
```
### Use System PHP
Below are some example commands for installing PHP and Composer in the system.
It is recommended to search for the specific installation method yourself or ask the AI search engine to obtain the answer,
which will not be elaborated here.
```bash
# [macOS], need install Homebrew first. See https://brew.sh/
# 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.
brew install php wget
wget https://getcomposer.org/download/latest-stable/composer.phar -O /path/to/your/bin/composer && chmod +x /path/to/your/bin/composer
# [Debian], you need to make sure your php version >= 8.1 and composer >= 2.0
sudo apt install php-cli composer php-tokenizer
# [Alpine]
apk add bash file wget xz php81 php81-common php81-pcntl php81-tokenizer php81-phar php81-posix php81-xml composer
```
::: tip
Currently, some versions of Ubuntu install older PHP versions,
so no installation commands are provided. If necessary, it is recommended to add software sources such as ppa first,
and then install the latest version of PHP and tokenizer, XML, and phar extensions.
Older versions of Debian may have an older (<= 7.4) version of PHP installed by default, it is recommended to upgrade Debian first.
:::
## Build with craft (recommended)
Using `bin/spc craft`, you can use a configuration file and a command to automatically check the environment, download source code, build dependency libraries, build PHP and extensions, etc.
You need to write a `craft.yml` file and save it in the current working directory. `craft.yml` can be generated by [command generator](./cli-generator) or written manually.
For manual writing, please refer to the comments in [craft.yml configuration](../develop/craft-yml.md) to write it.
Let's assume that you compile an extension combination and choose PHP 8.4, outputting `cli` and `fpm`:
```yaml
# path/to/craft.yml
php-version: 8.4
extensions: bcmath,posix,phar,zlib,openssl,curl,fileinfo,tokenizer
sapi:
- cli
- fpm
```
Then use the `bin/spc craft` command to compile:
```bash
bin/spc craft --debug
```
If the build is successful, you will see the `buildroot/bin` directory in the current directory, which contains the compiled PHP binary file, or the corresponding SAPI.
- cli: The build result is `buildroot/bin/php.exe` on Windows and `buildroot/bin/php` on other platforms.
- fpm: The build result is `buildroot/bin/php-fpm`.
- micro: The build result is `buildroot/bin/micro.sfx`. If you need to further package it with PHP code, please refer to [Packaging micro binary](./manual-build#command-micro-combine).
- embed: See [Using embed](./manual-build#embed-usage).
- frankenphp: The build result is `buildroot/bin/frankenphp`.
If the build fails, you can use the `--debug` parameter to view detailed error information,
or use the `--with-clean` to clear the old compilation results and recompile.
If the build still fails to use the above method, please submit an issue and attach your `craft.yml` and `./log` archive.
## Step-by-step build command
If you have customized requirements, or the need to download and compile PHP and dependent libraries separately, you can use the `bin/spc` command to execute step by step.
### Command download - Download dependency packages
Use the command `bin/spc download` to download the source code required for compilation,
including php-src and the source code of various dependent libraries.
```bash
# Download all dependencies
# Download all dependencies, defaults to php 8.4
bin/spc download --all
# Download all dependent packages, and specify the main version of PHP to download, optional: 7.3, 7.4, 8.0, 8.1, 8.2, 8.3
bin/spc download --all --with-php=8.2
# Download all dependent packages, and specify the main version of PHP to download, optional: 8.1, 8.2, 8.3, 8.4
# Also supports specific version of php release: 8.3.10, 8.2.22, etc.
bin/spc download --all --with-php=8.3
# Show download progress bar while downloading (curl)
bin/spc download --all --debug
@@ -170,7 +216,7 @@ bin/spc download --for-libs=liblz4,libevent --for-extensions=pcntl,rar,xml
bin/spc download --for-libs=liblz4,libevent --without-suggestions
# When downloading sources, ignore some source caches (always force download, e.g. switching PHP version)
bin/spc download --for-extensions=curl,pcntl,xml --ignore-cache-sources=php-src --with-php=8.3
bin/spc download --for-extensions=curl,pcntl,xml --ignore-cache-sources=php-src --with-php=8.3.10
# Set retry times (default is 0)
bin/spc download --all --retry=2
@@ -196,14 +242,27 @@ Also, it is available when downloading with the `--for-extensions` option.
```bash
# Specifying to download a beta version of PHP8.3
bin/spc download --all -U "php-src:https://downloads.php.net/~eric/php-8.3.0beta1.tar.gz"
# Specifying to download a alpha version of PHP 8.5
bin/spc download --all -U "php-src:https://downloads.php.net/~edorian/php-8.5.0alpha2.tar.xz"
# Specifying to download an older version of the curl library
bin/spc download --all -U "curl:https://curl.se/download/curl-7.88.1.tar.gz"
```
## Command - doctor
If the source you download is not a link, but a git repository, you can use `-G` or `--custom-git` to rewrite the download link,
so that the downloader can force the use of the specified git repository to download packages from this source.
The usage method is `{source-name}:{branch}:{url}`, which can rewrite the download link of multiple libraries at the same time.
It is also available when downloading with the `--for-extensions` option.
```bash
# Specifying to download the source code of the PHP extension from the specified branch of the git repository
bin/spc download --for-extensions=redis -G "php-src:master:https://github.com/php/php-src.git"
# Download the latest code from the master branch of the swoole-src repository instead of PECL release version
bin/spc download --for-extensions=swoole -G "swoole:master:https://github.com/swoole/swoole-src.git"
```
### Command - doctor
If you can run `bin/spc` normally but cannot compile static PHP or dependent libraries normally,
you can run `bin/spc doctor` first to check whether the system itself lacks dependencies.
@@ -216,13 +275,13 @@ bin/spc doctor
bin/spc doctor --auto-fix
```
## Command - build
### Command - build
Use the build command to start building the static php binary.
Before executing the `bin/spc build` command, be sure to use the `download` command to download sources.
It is recommended to use `doctor` to check the environment.
### Basic build
#### Basic build
You need to go to [Extension List](./extensions) or [Command Generator](./cli-generator) to select the extension you want to add,
and then use the command `bin/spc build` to compile.
@@ -230,8 +289,10 @@ You need to specify a compilation target, choose from the following parameters:
- `--build-cli`: Build a cli sapi (command line interface, which can execute PHP code on the command line)
- `--build-fpm`: Build a fpm sapi (php-fpm, used in conjunction with other traditional fpm architecture software such as nginx)
- `--build-cgi`: Build a cgi sapi (cgi, rarely used)
- `--build-micro`: Build a micro sapi (used to build a standalone executable binary containing PHP code)
- `--build-embed`: Build an embed sapi (used to embed into other C language programs)
- `--build-frankenphp`: Build a [FrankenPHP](https://github.com/php/frankenphp) executable
- `--build-all`: build all above sapi
```bash
@@ -258,27 +319,18 @@ If you want to build multiple versions of PHP and don't want to build other depe
you can use `switch-php-version` to quickly switch to another version and compile after compiling one version:
```shell
# switch to 8.3
bin/spc switch-php-version 8.3
# switch to 8.4
bin/spc switch-php-version 8.4
# build
bin/spc build bcmath,curl,openssl,ftp,posix,pcntl --build-cli
# switch to 8.0
bin/spc switch-php-version 8.0
# switch to 8.1
bin/spc switch-php-version 8.1
# build
bin/spc build bcmath,curl,openssl,ftp,posix,pcntl --build-cli
```
:::
### Debug
If you encounter problems during the compilation process, or want to view each executing shell command,
you can use `--debug` to enable debug mode and view all terminal logs:
```bash
bin/spc build mysqlnd,pdo_mysql --build-all --debug
```
### Build Options
#### Build Options
During the compilation process, in some special cases,
the compiler and the content of the compilation directory need to be intervened.
@@ -288,8 +340,10 @@ You can try to use the following commands:
- `--cxx=XXX`: Specifies the execution command of the C++ language compiler (Linux defaults to `g++`, macOS defaults to `clang++`)
- `--with-clean`: clean up old make files before compiling PHP
- `--enable-zts`: Make compiled PHP thread-safe version (default is NTS version)
- `--no-strip`: Do not run `strip` after compiling the PHP library to trim the binary file to reduce its size (the macOS binary file without trim can use dynamically linked third-party extensions)
- `--no-strip`: Do not run `strip` after compiling the PHP library to trim the binary file to reduce its size
- `--with-libs=XXX,YYY`: Compile the specified dependent library before compiling PHP, and activate some extended optional functions (such as libavif of the gd library, etc.)
- `--with-config-file-path=XXX`: Set the path in which to look for `php.ini` (Check [here](../faq/index.html#what-is-the-path-of-php-ini) for default paths)
- `--with-config-file-scan-dir=XXX`: Set the directory to scan for `.ini` files after reading `php.ini` (Check [here](../faq/index.html#what-is-the-path-of-php-ini) for default paths)
- `-I xxx=yyy`: Hard compile INI options into PHP before compiling (support multiple options, alias is `--with-hardcoded-ini`)
- `--with-micro-fake-cli`: When compiling micro, let micro's `PHP_SAPI` pretend to be `cli` (for compatibility with some programs that check `PHP_SAPI`)
- `--disable-opcache-jit`: Disable opcache jit (enabled by default)
@@ -298,6 +352,7 @@ You can try to use the following commands:
- `--with-suggested-exts`: Add `ext-suggests` as dependencies when compiling
- `--with-suggested-libs`: Add `lib-suggests` as dependencies when compiling
- `--with-upx-pack`: Use UPX to reduce the size of the binary file after compilation (you need to use `bin/spc install-pkg upx` to install upx first)
- `--build-shared=XXX,YYY`: compile the specified extension into a shared library (the default is to compile into a static library)
For hardcoding INI options, it works for cli, micro, embed sapi. Here is a simple example where we preset a larger `memory_limit` and disable the `system` function:
@@ -305,6 +360,15 @@ For hardcoding INI options, it works for cli, micro, embed sapi. Here is a simpl
bin/spc build bcmath,pcntl,posix --build-all -I "memory_limit=4G" -I "disable_functions=system"
```
## Debug
If you encounter problems during the compilation process, or want to view each executing shell command,
you can use `--debug` to enable debug mode and view all terminal logs:
```bash
bin/spc build mysqlnd,pdo_mysql --build-all --debug
```
## Command - micro:combine
Use the `micro:combine` command to build the compiled `micro.sfx` and your code (`.php` or `.phar` file) into an executable binary.
@@ -381,6 +445,31 @@ manually unpack and copy the package to a specified location, and we can use com
bin/spc extract php-src,libxml2
```
## Command - dump-extensions
Use the command `bin/spc dump-extensions` to export required extensions of the current project.
```bash
# Print the extension list of the project, pass in the root directory of the project containing composer.json
bin/spc dump-extensions /path/to/your/project/
# Print the extension list of the project, excluding development dependencies
bin/spc dump-extensions /path-to/tour/project/ --no-dev
# Output in the extension list format acceptable to the spc command (comma separated)
bin/spc dump-extensions /path-to/tour/project/ --format=text
# Output as a JSON list
bin/spc dump-extensions /path-to/tour/project/ --format=json
# When the project does not have any extensions, output the specified extension combination instead of returning failure
bin/spc dump-extensions /path-to/your/project/ --no-ext-output=mbstring,posix,pcntl,phar
# Do not exclude extensions not supported by spc when outputting
bin/spc dump-extensions /path/to/your/project/ --no-spc-filter
```
It should be noted that the project directory must contain the `vendor/installed.json` and `composer.lock` files, otherwise they cannot be found normally.
## Dev Command - dev
Debug commands refer to a collection of commands that can assist in outputting some information
@@ -423,6 +512,8 @@ When `bin/spc doctor` automatically repairs the Windows environment, tools such
Here is an example of installing the tool:
- Download and install UPX (Linux and Windows only): `bin/spc install-pkg upx`
- Download and install nasm (Windows only): `bin/spc install-pkg nasm`
- Download and install go-xcaddy: `bin/spc install-pkg go-xcaddy`
## Command - del-download
@@ -458,22 +549,24 @@ otherwise it will be executed repeatedly in other events.
The following are the supported `patch_point` event names and corresponding locations:
| Event name | Event description |
|------------------------------|----------------------------------------------------------------------------------------------------|
| before-libs-extract | Triggered before the dependent libraries extracted |
| after-libs-extract | Triggered after the compiled dependent libraries extracted |
| before-php-extract | Triggered before PHP source code extracted |
| after-php-extract | Triggered after PHP source code extracted |
| before-micro-extract | Triggered before phpmicro extract |
| after-micro-extract | Triggered after phpmicro extracted |
| before-exts-extract | Triggered before the extension (to be compiled) extracted to the PHP source directory |
| after-exts-extract | Triggered after the extension extracted to the PHP source directory |
| before-library[*name*]-build | Triggered before the library named `name` is compiled (such as `before-library[postgresql]-build`) |
| after-library[*name*]-build | Triggered after the library named `name` is compiled |
| before-php-buildconf | Triggered before compiling PHP command `./buildconf` |
| before-php-configure | Triggered before compiling PHP command `./configure` |
| before-php-make | Triggered before compiling PHP command `make` |
| before-sanity-check | Triggered after compiling PHP but before running extended checks |
| Event name | Event description |
|---------------------------------|----------------------------------------------------------------------------------------------------|
| before-libs-extract | Triggered before the dependent libraries extracted |
| after-libs-extract | Triggered after the compiled dependent libraries extracted |
| before-php-extract | Triggered before PHP source code extracted |
| after-php-extract | Triggered after PHP source code extracted |
| before-micro-extract | Triggered before phpmicro extract |
| after-micro-extract | Triggered after phpmicro extracted |
| before-exts-extract | Triggered before the extension (to be compiled) extracted to the PHP source directory |
| after-exts-extract | Triggered after the extension extracted to the PHP source directory |
| before-library[*name*]-build | Triggered before the library named `name` is compiled (such as `before-library[postgresql]-build`) |
| after-library[*name*]-build | Triggered after the library named `name` is compiled |
| after-shared-ext[*name*]-build | Triggered after the shared extension named `name` is compiled |
| before-shared-ext[*name*]-build | Triggered before the shared extension named `name` is compiled |
| before-php-buildconf | Triggered before compiling PHP command `./buildconf` |
| before-php-configure | Triggered before compiling PHP command `./configure` |
| before-php-make | Triggered before compiling PHP command `make` |
| before-sanity-check | Triggered after compiling PHP but before running extended checks |
The following is a simple example of temporarily modifying the PHP source code.
Enable the CLI function to search for the `php.ini` configuration in the current working directory:
@@ -537,3 +630,76 @@ If you need to build multiple times locally, the following method can save you t
- If you want to rebuild once, but do not re-download the source code, you can first `rm -rf buildroot source` to delete the compilation directory and source code directory, and then rebuild.
- If you want to update a version of a dependency, you can use `bin/spc del-download <source-name>` to delete the specified source code, and then use `download <source-name>` to download it again.
- If you want to update all dependent versions, you can use `bin/spc download --clean` to delete all downloaded sources, and then download them again.
## embed usage
If you want to embed static-php into other C language programs, you can use `--build-embed` to build an embed version of PHP.
```bash
bin/spc build {your extensions} --build-embed --debug
```
Under normal circumstances, PHP embed will generate `php-config` after compilation.
For static-php, we provide `spc-config` to obtain the parameters during compilation.
In addition, when using embed SAPI (libphp.a), you need to use the same compiler as libphp, otherwise there will be a link error.
Here is the basic usage of spc-config:
```bash
# output all flags and options
bin/spc spc-config curl,zlib,phar,openssl
# output libs
bin/spc spc-config curl,zlib,phar,openssl --libs
# output includes
bin/spc spc-config curl,zlib,phar,openssl --includes
```
By default, static-php uses the following compilers on different systems:
- macOS: `clang`
- Linux (Alpine Linux): `gcc`
- Linux (glibc based distros, x86_64): `/usr/local/musl/bin/x86_64-linux-musl-gcc`
- Linux (glibc based distros, aarch64): `/usr/local/musl/bin/aarch64-linux-musl-gcc`
- FreeBSD: `clang`
Here is an example of using embed SAPI:
```c
// embed.c
#include <sapi/embed/php_embed.h>
int main(int argc,char **argv){
PHP_EMBED_START_BLOCK(argc,argv)
zend_file_handle file_handle;
zend_stream_init_filename(&file_handle,"embed.php");
if(php_execute_script(&file_handle) == FAILURE){
php_printf("Failed to execute PHP script.\n");
}
PHP_EMBED_END_BLOCK()
return 0;
}
```
```php
<?php
// embed.php
echo "Hello world!\n";
```
```bash
# compile in debian/ubuntu x86_64
/usr/local/musl/bin/x86_64-linux-musl-gcc embed.c $(bin/spc spc-config bcmath,zlib) -static -o embed
# compile in macOS/FreeBSD
clang embed.c $(bin/spc spc-config bcmath,zlib) -o embed
./embed
# out: Hello world!
```

View File

@@ -8,8 +8,15 @@ here will describe how to check the errors by yourself and report Issue.
Problems with downloading resources are one of the most common problems with spc.
The main reason is that the addresses used for SPC download resources are generally the official website of the corresponding project or GitHub, etc.,
and these websites may occasionally go down and block IP addresses.
Currently, version 2.0.0 has not added an automatic retry mechanism, so after encountering a download failure,
you can try to call the download command multiple times. If you confirm that the address is indeed inaccessible,
After encountering a download failure,
you can try to call the download command multiple times.
When downloading extensions, you may eventually see errors like `curl: (56) The requested URL returned error: 403` which are often caused by github rate limiting.
You can verify this by adding `--debug` to the command and will see something like `[DEBU] Running command (no output) : curl -sfSL "https://api.github.com/repos/openssl/openssl/releases"`.
To fix this, [create](https://github.com/settings/tokens) a personal access token on GitHub and set it as an environment variable `GITHUB_TOKEN=<XXX>`.
If you confirm that the address is indeed inaccessible,
you can submit an Issue or PR to update the url or download type.
## Doctor Can't Fix Something
@@ -31,3 +38,5 @@ and then determine the command that reported the error.
The error terminal output is very important for fixing compilation errors.
When submitting an issue, please upload the last error fragment of the terminal log (or the entire terminal log output),
and include the `spc` command and parameters used.
If you are rebuilding, please refer to the [Local Build - Multiple Builds](./manual-build#multiple-builds) section.

View File

@@ -3,11 +3,14 @@
layout: home
hero:
name: "static-php-cli"
name: "Static PHP"
tagline: "Build standalone PHP binary on Linux, macOS, FreeBSD, Windows, with PHP project together, with popular extensions included."
image:
src: /images/static-php_nobg.png
alt: Static PHP CLI Logo
actions:
- theme: brand
text: Guide
text: Get Started
link: ./guide/
features:
@@ -19,3 +22,121 @@ features:
details: static-php-cli comes with dependency management and supports installation of different types of PHP extensions.
---
<script setup>
import {VPSponsors} from "vitepress/theme";
import Contributors from '../.vitepress/components/Contributors.vue';
const sponsors = [
{ name: 'Beyond Code', img: '/images/beyondcode-seeklogo.png', url: 'https://beyondco.de/' },
{ name: 'NativePHP', img: '/images/nativephp-logo.svg', url: 'https://nativephp.com/' },
];
</script>
<div class="sponsors-section">
<div class="sponsors-header">
<h2>Special Sponsors</h2>
<p class="sponsors-description">
Thank you to our amazing sponsors for supporting this project!
</p>
</div>
<VPSponsors :data="sponsors"/>
</div>
<style scoped>
.sponsors-section {
margin: 48px auto;
padding: 32px 24px;
max-width: 1152px;
background: linear-gradient(135deg, var(--vp-c-bg-soft) 0%, var(--vp-c-bg) 100%);
border-radius: 16px;
border: 1px solid var(--vp-c-divider);
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
transition: all 0.3s ease;
}
.sponsors-section:hover {
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
transform: translateY(-2px);
}
.sponsors-header {
text-align: center;
margin-bottom: 24px;
}
.sponsors-header h2 {
font-size: 1.5rem;
font-weight: 700;
margin: 0 0 8px 0;
background: linear-gradient(120deg, var(--vp-c-brand-1), var(--vp-c-brand-2));
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}
.sponsors-description {
font-size: 0.95rem;
color: var(--vp-c-text-2);
margin: 0;
line-height: 1.5;
}
@media (max-width: 768px) {
.sponsors-section {
margin: 32px 16px;
padding: 24px 16px;
}
.sponsors-header h2 {
font-size: 1.25rem;
}
.sponsors-description {
font-size: 0.9rem;
}
}
/* Hero logo styling */
:deep(.VPImage.image-src) {
border-radius: 20px;
background: linear-gradient(135deg, var(--vp-c-bg-soft) 0%, var(--vp-c-default-soft) 100%);
padding: 40px;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
transition: all 0.3s ease;
}
:deep(.VPImage.image-src:hover) {
transform: translateY(-4px);
box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}
/* Dark mode adjustments for logo */
.dark :deep(.VPImage.image-src) {
background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
opacity: 0.9;
}
.dark :deep(.VPImage.image-src:hover) {
opacity: 1;
box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7);
}
/* Additional styling for the logo image itself */
:deep(.VPImage.image-src img) {
max-height: 280px;
width: auto;
}
@media (max-width: 768px) {
:deep(.VPImage.image-src) {
padding: 24px;
}
:deep(.VPImage.image-src img) {
max-height: 200px;
}
}
</style>
<Contributors />

View File

@@ -3,8 +3,11 @@
layout: home
hero:
name: "static-php-cli"
name: "Static PHP"
tagline: "Build standalone PHP binary on Linux, macOS, FreeBSD, Windows, with PHP project together, with popular extensions included."
image:
src: /images/static-php_nobg.png
alt: Static PHP CLI Logo
actions:
- theme: brand
text: Get Started
@@ -21,3 +24,124 @@ features:
- title: Dependency Management
details: static-php-cli comes with dependency management and supports installation of different types of PHP extensions.
---
<script setup>
import {VPSponsors} from "vitepress/theme";
import Contributors from './.vitepress/components/Contributors.vue';
const sponsors = [
{ name: 'Beyond Code', img: '/images/beyondcode-seeklogo.png', url: 'https://beyondco.de/' },
{ name: 'NativePHP', img: '/images/nativephp-logo.svg', url: 'https://nativephp.com/' },
];
</script>
<div class="sponsors-section">
<div class="sponsors-header">
<h2>Special Sponsors</h2>
<p class="sponsors-description">
Thank you to our amazing sponsors for supporting this project!
</p>
</div>
<VPSponsors :data="sponsors"/>
</div>
<style scoped>
.sponsors-section {
margin: 48px auto;
padding: 32px 24px;
max-width: 1152px;
background: linear-gradient(135deg, var(--vp-c-bg-soft) 0%, var(--vp-c-bg) 100%);
border-radius: 16px;
border: 1px solid var(--vp-c-divider);
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
transition: all 0.3s ease;
}
.sponsors-section:hover {
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
transform: translateY(-2px);
}
.sponsors-header {
text-align: center;
margin-bottom: 24px;
}
.sponsors-header h2 {
font-size: 1.5rem;
font-weight: 700;
margin: 0 0 8px 0;
background: linear-gradient(120deg, var(--vp-c-brand-1), var(--vp-c-brand-2));
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}
.sponsors-description {
font-size: 0.95rem;
color: var(--vp-c-text-2);
margin: 0;
line-height: 1.5;
}
@media (max-width: 768px) {
.sponsors-section {
margin: 32px 16px;
padding: 24px 16px;
}
.sponsors-header h2 {
font-size: 1.25rem;
}
.sponsors-description {
font-size: 0.9rem;
}
}
/* Hero logo styling */
:deep(.VPImage.image-src) {
border-radius: 20px;
background: linear-gradient(135deg, var(--vp-c-bg-soft) 0%, var(--vp-c-default-soft) 100%);
padding: 40px;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
transition: all 0.3s ease;
}
:deep(.VPImage.image-src:hover) {
transform: translateY(-4px);
box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}
/* Dark mode adjustments for logo */
.dark :deep(.VPImage.image-src) {
background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
opacity: 0.9;
}
.dark :deep(.VPImage.image-src:hover) {
opacity: 1;
box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7);
}
/* Additional styling for the logo image itself */
:deep(.VPImage.image-src img) {
max-height: 280px;
width: auto;
}
@media (max-width: 768px) {
:deep(.VPImage.image-src) {
padding: 24px;
}
:deep(.VPImage.image-src img) {
max-height: 200px;
}
}
</style>
<Contributors />

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

View File

@@ -0,0 +1,6 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 764 100">
<path fill="#505b93" d="M29.5,98.4H0V1.2h29.5V98.4z"/>
<path fill="#00aaa6" d="M96.7,98.4H67.2V1.2h29.5V98.4z"/>
<path fill="#272d48" d="M96.7,98.4H29.5V1.2L96.7,98.4z"/>
<path fill="#272d48" d="M102.6,54.5c0-6.2,1.3-11.8,4.1-16.7c2.7-5,6.7-8.8,11.9-11.6c5.2-2.8,11.4-4.2,18.6-4.2c1.1,0,2.8,0.1,5.2,0.3 c4.9,0.4,9.1,1.3,12.5,2.8c3.4,1.5,6.4,3.4,9.1,5.9v-7.2h25.8v74.7h-25.8v-7.2c-2.5,2.6-5.6,4.6-9.4,6.1c-3.8,1.5-7.9,2.4-12.1,2.6 c-0.9,0.1-2.3,0.1-4.1,0.1c-7.2,0-13.4-1.4-18.8-4.1c-5.4-2.7-9.5-6.6-12.4-11.5c-2.9-4.9-4.3-10.5-4.3-16.6V54.5z M128.4,63.9 c0,9.2,5.9,13.8,17.7,13.8c11.8,0,17.7-4.6,17.7-13.8v-5.6c0-9.3-5.9-14-17.7-14c-11.8,0-17.7,4.7-17.7,14V63.9z M208.3,98.4V47h-12.8V23.7l12.8-0.2V1.2h25.9l0.1,22.4h18.3V47h-18.4v51.4 M287.3,98.4h-25.9V23.6h25.9V98.4z M351,98.4H325l-31-74.8H320L338,68l18-44.5h25.9L351,98.4z M454.9,87.6c-4.1,4.2-8.8,7.3-14.1,9.3c-5.3,2-11.8,2.9-19.5,2.9c-8,0-15.1-1.4-21.3-4.2 c-6.2-2.8-11.1-6.7-14.7-11.6c-3.5-5-5.3-10.6-5.3-17V54.6c0-6.5,1.7-12.2,5.2-17.1c3.4-4.9,8.2-8.7,14.2-11.3c6-2.7,12.7-4,20-4 c8,0,15,1.5,21.2,4.3c6.1,2.9,10.9,7,14.4,12.4c3.4,5.4,5.2,11.6,5.2,18.7c0,1.7-0.2,4.2-0.7,7.7l-54.2,0.1v2.1 c0,4.1,1.5,7.3,4.4,9.4c2.9,2.2,6.9,3.2,11.8,3.2c4.6,0,8.5-0.6,11.8-1.8c3.2-1.2,6.4-3.5,9.4-6.8L454.9,87.6z M434.4,51.4 c0-3.1-1.4-5.5-4.2-7.1c-2.8-1.6-6.4-2.4-10.8-2.4s-7.9,0.8-10.5,2.4c-2.6,1.6-3.8,4-3.8,7.1H434.4z M466,98.4V1.2h56c9.9,0,17.8,1.9,23.7,5.6c5.9,3.7,10,8.2,12.2,13.3c2.3,5.1,3.4,10.1,3.4,15 c0,4.8-1.2,9.7-3.5,14.7c-2.3,5-6.4,9.2-12.2,12.8c-5.8,3.6-13.7,5.4-23.7,5.4h-30.2v30.5H466z M522,44.6c9,0,13.6-3.3,13.6-9.9 c0-6.9-4.6-10.3-13.7-10.3h-30.1v20.2H522z M593,98.4h-25.8V1.2H593v38h43.9v-38h25.8v97.2h-25.8V59.9H593V98.4z M668.6,98.4V1.2h56c9.9,0,17.8,1.9,23.7,5.6c5.9,3.7,10,8.2,12.2,13.3c2.3,5.1,3.4,10.1,3.4,15 c0,4.8-1.2,9.7-3.5,14.7c-2.3,5-6.4,9.2-12.2,12.8c-5.8,3.6-13.7,5.4-23.7,5.4h-30.2v30.5H668.6z M724.6,44.6c9,0,13.6-3.3,13.6-9.9 c0-6.9-4.6-10.3-13.7-10.3h-30.1v20.2H724.6z M291.1,20.2h-33.5V0h33.5V20.2z"/>
</svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 965 KiB

View File

@@ -4,45 +4,48 @@
## 贡献方法
如果你有代码或文档要贡献,需要先了解以下内容。
如果你有代码或文档要贡献,以下是你需要先了解内容。
1. 你要贡献什么类型的代码?(新扩展、修复 Bug、安全问题、项目框架优化、文档
2. 如果你贡献了新文件或新片段,你的代码是否经过 `php-cs-fixer``phpstan` 的检查?
3. 在贡献代码前是否充分阅读了 [开发指南](../develop/)
如果你可以回答以上问题,并已经对代码做出了修改,可以及时在项目 GitHub 仓库发起 Pull Request。待代码审查完毕后,可根据建议修改代码,或直接合并到主分支。
如果你能回答上述问题并对代码进行了修改,可以及时在项目 GitHub 仓库发起 Pull Request。
代码审查完成后,可以根据建议修改代码,或直接合并到主分支。
## 贡献类型
本项目主要用途是编译静态链接的 PHP 二进制基于 `symfony/console` 编写了命令行处理功能。在开发之前,如果你对它不够熟悉,
可以先查看 [symfony/console 文档](https://symfony.com/doc/current/components/console.html)。
本项目主要目的是编译静态链接的 PHP 二进制文件,命令行处理功能基于 `symfony/console` 编写
在开发之前,如果你对它不够熟悉,请先查看 [symfony/console 文档](https://symfony.com/doc/current/components/console.html)。
### 安全问题
### 安全更新
因为本项目基本上是属于本地运行的 PHP 项目,一般来说不会存在远程攻击行为。但如果你发现了此类问题,请**不要**在 GitHub 仓库提交 PR 或 Issue
你需要通过 [邮件](mailto:admin@zhamao.me) 的方式联系项目维护者crazywhalecc
因为本项目基本上是一个本地运行的 PHP 项目,一般来说不会远程攻击
但如果你发现此类问题,请**不要**在 GitHub 仓库提交 PR 或 Issue
你需要通过 [邮件](mailto:admin@zhamao.me) 联系项目维护者crazywhalecc
### 修复 Bug
修复 Bug 一般不涉及项目结构和框架的修改,所以如果你可以定位到错误代码并直接修复它,请直接提交 PR。
修复 Bug 一般不涉及项目结构和框架的修改,所以如果你定位到错误代码并直接修复它,请直接提交 PR。
### 新扩展
对于添加一个新扩展来说,你需要了解一些本项目的基本结构以及如何根据现有逻辑添加新扩展。在本页的下一章节将会详细介绍。
对于添加新扩展,你需要了解项目的一些基本结构以及如何根据现有逻辑添加新扩展。
这将在本页的下一节中详细介绍。
总的来说,你需要:
1. 评估扩展是否可以内联编译到 PHP 中。
2. 评估扩展的依赖库(如果有)是否可以静态编译。
3.出扩展的依赖库在不同平台编译命令。
4. 验证扩展及其依赖库能否与现有扩展和依赖兼容。
5. 验证扩展在 `cli``micro``fpm``embed` 几种 SAPI 中正常工作。
6. 编写文档,加入你的扩展。
3. 写不同平台的库编译命令。
4. 验证扩展及其依赖与现有扩展和依赖兼容。
5. 验证扩展在 `cli``micro``fpm``embed` SAPIs 中正常工作。
6. 编写文档并添加你的扩展。
### 项目框架优化
如果你已经熟悉 `symfony/console` 的工作原理,并同时要对项目的框架进行一些修改或优化,请先了解以下事情:
1.扩展不属于项目框架优化,但如果你在加入新的扩展时发现不得不优化框架,则需先对框架本身进行修改,然后再加扩展。
2. 对于一些大规模逻辑修改(例如涉及 LibraryBase、Extension 对象等的修改),建议先提交 Issue 或 Draft PR 进行讨论方案
3. 项目早期为纯中文开发项目,代码中存在一部分中文注释。国际化项目后你可以提交 PR 将这些注释翻译为英语。
4. 请不要在代码中提交包含较多无用的代码片段,例如大量未使用的变量、方法、类、重复写了很多次的代码。
1. 加扩展不属于项目框架优化,但如果你在添加新扩展时发现必须优化框架,则需要先修改框架本身,然后再加扩展。
2. 对于一些大规模逻辑修改(例如涉及 LibraryBase、Extension 对象等的修改),建议先提交 Issue 或 Draft PR 进行讨论。
3. 项目早期,它是一个纯私有开发项目,代码中有一些中文注释。项目国际化后你可以提交 PR 将这些注释翻译为英语。
4. 请不要在代码中提交多无用的代码片段,例如大量未使用的变量、方法、类以及多次重写的代码。

View File

@@ -0,0 +1,7 @@
---
aside: false
---
# craft.yml 配置
<!--@include: ../../deps-craft-yml.md-->

View File

@@ -2,7 +2,7 @@
开发本项目需要安装部署 PHP 环境,以及一些 PHP 项目常用的扩展和 Composer。
项目的开发环境和运行环境几乎完全一致你可以参照 **指南-本地构建** 部分安装系统 PHP 或使用本项目预构建的静态 PHP 作为环境这里不再赘述。
项目的开发环境和运行环境几乎完全一致你可以参照 **手动构建** 部分安装系统 PHP 或使用本项目预构建的静态 PHP 作为环境这里不再赘述。
抛开用途,本项目本身其实就是一个 `php-cli` 程序,你可以将它当作一个正常的 PHP 项目进行编辑和开发,同时你需要了解不同系统的 Shell 命令行。
@@ -18,10 +18,10 @@
curl,dom,filter,mbstring,openssl,pcntl,phar,posix,sodium,tokenizer,xml,xmlwriter
```
static-php-cli 项目本身不需要这么多扩展,但在开发过程中,你会用到 ComposerPHPUnit 等工具,它们需要这些扩展。
static-php-cli 项目本身不需要这么多扩展,但在开发过程中,你会用到 ComposerPHPUnit 等工具,它们需要这些扩展。
> 对于 static-php-cli 自身构建的 micro 自执行二进制,仅需要 `pcntl,posix,mbstring,tokenizer,phar`。
## 开始开发
继续向下查看项目结构文档,你可以从中了解 `static-php-cli` 是如何作的。
继续向下查看项目结构文档,你可以学习 `static-php-cli` 是如何作的。

View File

@@ -30,6 +30,7 @@ static-php-cli 的下载资源模块是一个主要的功能,它包含了所
这里最主要的字段是 `type`,目前它支持的类型有:
- `url`: 直接使用 URL 下载,例如:`https://download.libsodium.org/libsodium/releases/libsodium-1.0.18.tar.gz`
- `pie`: 使用 PIEPHP Installer for Extensions标准从 Packagist 下载 PHP 扩展。
- `ghrel`: 使用 GitHub Release API 下载,即从 GitHub 项目发布的最新版本中上传的附件下载。
- `ghtar`: 使用 GitHub Release API 下载,与 `ghrel` 不同的是,`ghtar` 是从项目的最新 Release 中找 `source code (tar.gz)` 下载的。
- `ghtagtar`: 使用 GitHub Release API 下载,与 `ghtar` 相比,`ghtagtar` 可以从 `tags` 列表找最新的,并下载 `tar.gz` 格式的源码(因为有些项目只使用了 `tag` 发布版本)。
@@ -77,6 +78,36 @@ url 类型的资源指的是从 URL 直接下载文件。
}
```
## 下载类型 - pie
PIEPHP Installer for Extensions类型的资源是从 Packagist 下载遵循 PIE 标准的 PHP 扩展。
该方法会自动从 Packagist 仓库获取扩展信息,并下载相应的分发文件。
包含的参数有:
- `repo`: Packagist 的 vendor/package 名称,如 `vendor/package-name`
例子(使用 PIE 从 Packagist 下载 PHP 扩展):
```json
{
"ext-example": {
"type": "pie",
"repo": "vendor/example-extension",
"path": "php-src/ext/example",
"license": {
"type": "file",
"path": "LICENSE"
}
}
}
```
::: tip
PIE 下载类型会自动从 Packagist 元数据中检测扩展信息,包括下载 URL、版本和分发类型。
扩展必须在其 Packagist 包定义中标记为 `type: php-ext` 或包含 `php-ext` 元数据。
:::
## 下载类型 - ghrel
ghrel 会从 GitHub Release 中上传的 Assets 下载文件。首先使用 GitHub Release API 获取最新版本,然后根据正则匹配方式下载相应的文件。
@@ -297,3 +328,23 @@ pkg.json 存放的是非源码类型的文件资源,例如 musl-toolchain、UP
}
}
```
当一个开源项目的许可证在不同版本间使用不同的文件,`path` 参数可以使用数组将可能的许可证文件列出:
```json
{
"redis": {
"type": "git",
"path": "php-src/ext/redis",
"rev": "release/6.0.2",
"url": "https://github.com/phpredis/phpredis",
"license": {
"type": "file",
"path": [
"LICENSE",
"COPYING"
]
}
}
}
```

View File

@@ -2,60 +2,95 @@
这里将会编写一些你容易遇到的问题。目前有很多,但是我需要花时间来整理一下。
## 静态编译的 PHP 可以安装扩展吗
## php.ini 的路径是什么?
因为传统架构下的 PHP 安装扩展的原理是使用 `.so` 类型的动态链接的库方式安装新扩展,而使用本项目编译的静态链接的 PHP 无法**直接**使用动态链接库安装新扩展
在 Linux、macOS 和 FreeBSD 上,`php.ini` 的路径是 `/usr/local/etc/php/php.ini`
在 Windows 中,路径是 `C:\windows\php.ini``php.exe` 所在的当前目录。
可以在 *nix 系统中使用手动构建选项 `--with-config-file-path` 来更改查找 `php.ini` 的目录。
对于 macOS 平台来说macOS 下的几乎所有二进制文件都无法真正纯静态链接,几乎所有二进制文件都会链接 macOS 的系统库:`/usr/lib/libresolv.9.dylib``/usr/lib/libSystem.B.dylib`
所以在 macOS 系统下,在特定的编译条件下可以使用静态编译的 php 二进制文件,同时使用动态链接的扩展:
此外,在 Linux、macOS 和 FreeBSD 上,`/usr/local/etc/php/conf.d` 目录中的 `.ini` 文件也会被加载
在 Windows 中,该路径默认为空。
可以使用手动构建选项 `--with-config-file-scan-dir` 更改该目录。
1. 使用 `--no-strip` 参数,将不会对二进制文件去除调试符号等信息,以供使用 `Xdebug` 等外部 Zend 扩展
2. 如果要编译某些 Zend 扩展,使用 Homebrew、MacPorts、源码编译的形式在所在的操作系统安装一个普通版本的 PHP。
3. 使用 `phpize && ./configure && make` 命令编译想要使用的扩展。
4. 将扩展文件 `xxxx.so` 拷贝到外部,使用静态编译的 PHP 二进制,例如使用 Xdebug 扩展:`cd buildroot/bin/ && ./php -d "zend_extension=/path/to/xdebug.so"`
PHP 默认也会从 [其他标准位置](https://www.php.net/manual/zh/configuration.file.php) 中搜索 `php.ini`
## 静态编译的 PHP 可以安装扩展吗?
因为传统架构下的 PHP 安装扩展的原理是使用 `.so` 类型的动态链接的库方式安装新扩展,而使用本项目编译的静态链接的 PHP。但是静态链接在不同操作系统有不同的定义。
首先,对于 Linux 系统,静态链接的二进制文件不会链接系统的动态链接库。纯静态链接的二进制文件(`-all-static`)无法加载动态库,因此无法添加新扩展。
同时,在纯静态模式下,你也不能使用 `ffi` 等扩展来加载外部 `.so` 模块。
你可以使用命令 `ldd buildroot/bin/php` 来检查你在 Linux 下构建的二进制文件是否为纯静态链接。
如果你 [构建基于 GNU libc 的 PHP](../guide/build-with-glibc),你可以使用 `ffi` 扩展来加载外部 `.so` 模块,并加载具有相同 ABI 的 `.so` 扩展。
例如,你可以使用以下命令构建一个与 glibc 动态链接的静态 PHP 二进制文件,支持 FFI 扩展并加载相同 PHP 版本和相同 TS 类型的 `xdebug.so` 扩展:
```bash
# 构建静态 php-cli
bin/spc build ffi --build-cli --no-strip
bin/spc-gnu-docker download --for-extensions=ffi,xml --with-php=8.4
bin/spc-gnu-docker build ffi,xml --build-cli --debug
buildroot/bin/php -d "zend_extension=/path/to/php{PHP_VER}-{ts/nts}/xdebug.so" --ri xdebug
```
对于 Linux 平台来说,目前的编译结果为纯静态链接的二进制文件,无法使用动态链接库安装新扩展
对于 macOS 平台macOS 下的几乎所有二进制文件都无法真正纯静态链接,几乎所有二进制文件都会链接 macOS 系统库:`/usr/lib/libresolv.9.dylib``/usr/lib/libSystem.B.dylib`
因此,在 macOS 上,你可以**直接**使用 SPC 构建具有动态链接扩展的静态编译 PHP 二进制文件:
## 可以支持 Oracle 数据库扩展吗
1. 使用 `--build-shared=XXX` 选项构建共享扩展 `xxx.so`。例如:`bin/spc build bcmath,zlib --build-shared=xdebug --build-cli`
2. 你将获得 `buildroot/modules/xdebug.so``buildroot/bin/php`
3. `xdebug.so` 文件可用于版本和线程安全相同的 php。
对于 Windows 平台,由于官方构建的扩展(如 `php_yaml.dll`)强制使用了 `php8.dll` 动态库作为链接,静态构建的 PHP 不包含任何系统库以外的动态库,
所以 Windows 下无法加载官方构建的动态扩展。 由于 static-php-cli 还暂未支持构建动态扩展,所以目前还没有让 static-php 加载动态扩展的方法。
不过Windows 可以正常使用 `FFI` 扩展加载其他的 dll 文件并调用。
## 可以支持 Oracle 数据库扩展吗?
部分依赖库闭源的扩展,如 `oci8``sourceguardian` 等,它们没有提供纯静态编译的依赖库文件(`.a`),仅提供了动态依赖库文件(`.so`
这些扩展无法使用源码的形式编译到 static-php-cli 中,所以本项目可能永远也不会支持这些扩展。不过,理论上你可以根据上面的问题在 macOS 下接入和使用这类扩展。
这些扩展无法使用源码的形式编译到 static-php-cli 中,所以本项目可能永远也不会支持这些扩展。不过,理论上你可以根据上面的问题在 macOS 和 Linux 下接入和使用这类扩展。
如果你对此类扩展有需求,或者大部分人都对这些闭源扩展使用有需求,
可以看看有关 [standalone-php-cli](https://github.com/crazywhalecc/static-php-cli/discussions/58) 的讨论。欢迎留言。
## 支持 Windows 吗
## 支持 Windows 吗
该项目目前支持 Windows但支持的扩展数量较少Windows 支持并不完美主要有以下几个问题:
该项目目前支持 Windows但支持的扩展数量较少Windows 支持并不完美主要有以下问题:
1. Windows 的编译程与 *nix 不同,使用的工具链也不同编译个扩展依赖库使用的编译工具也几乎完全不同。
2. Windows 版本的需求也会根据所有使用本项目的人的需求推进如果很多人需要,我会尽快支持相关扩展。
1. Windows 的编译程与 *nix 不同,使用的工具链也不同。用于编译个扩展依赖库的编译工具也几乎完全不同。
2. Windows 版本的需求也会根据所有使用本项目的人的需求推进如果很多人需要,我会尽快支持相关扩展。
## 使用 micro 可以保护我的源码吗
## 我可以使用 micro 保护我的源码吗
不可以。micro.sfx 本质上是将 php 和 php 代码合为一个文件,没有 PHP 代码编译或加密的过程。
首先 php-src 是 PHP 代码的官方解释器,而且现在市面上还没有一个能兼容主流分支的 PHP 编译器。
之前我在网上看到有一个项目是 BPCBinary PHP Compiler可以把 PHP 编译为二进制,但是限制也是很多很多。
不可以。micro.sfx 本质上是将 php 和 php 代码合为一个文件,没有编译或加密 PHP 代码的过程。
加密保护代码的方向和编译也不是一回事,编译过后也可以通过逆向工程等方式拿到代码,真正保护还是通过加壳、加密代码等手段进行
首先php-src 是 PHP 代码的官方解释器,市场上没有与主流分支兼容的 PHP 编译器
我在网上看到一个名为 BPCBinary PHP Compiler的项目可以将 PHP 编译为二进制,但有很多限制。
所以本项目static-php-cli、相关项目lwmbs、swoole-cli都是提供一个对 php-src 源码的便捷编译工具,
本项目和相关项目引用的 phpmicro 也仅仅是 PHP 的 sapi 接口封装,而不是 PHP 代码的编译工具。
PHP 代码的编译器是完全不同的项目,因此不会考虑额外的情况。如果你对加密感兴趣,可以考虑使用现有的加密技术,如 Swoole Compiler、Source Guardian 等
加密和保护代码的方向与编译不同。编译后,也可以通过逆向工程等方法获得代码。真正的保护仍然通过打包和加密代码等手段进行。
因此本项目static-php-cli和相关项目lwmbs、swoole-cli都提供了 php-src 源代码的便捷编译工具
本项目和相关项目引用的 phpmicro 只是 PHP 的 sapi 接口封装,而不是 PHP 代码的编译工具。
PHP 代码的编译器是一个完全不同的项目,因此不考虑额外的情况。
如果你对加密感兴趣,可以考虑使用现有的加密技术,如 Swoole Compiler、Source Guardian 等。
## 无法使用 ssl
使用 curl、pgsql 等 请求 HTTPS 网站或建立 SSL 连接时,可能存在 `error:80000002:system library::No such file or directory` 错误,
这个错误是由于静态编译的 PHP 未通过 `php.ini` 指定 `openssl.cafile` 导致的。
**更新:该问题已在最新版本的 static-php-cli 中修复,现在默认读取系统的证书文件。如果你仍然遇到问题,请尝试下面的解决方案。**
你可以在使用 PHP 前指定 `php.ini`,并在 INI 内添加 `openssl.cafile=/path/to/your-cert.pem` 来解决这个问题
使用 curl、pgsql 等请求 HTTPS 网站或建立 SSL 连接时,可能会出现 `error:80000002:system library::No such file or directory` 错误
此错误是由于静态编译的 PHP 未通过 `php.ini` 指定 `openssl.cafile` 导致的。
你可以通过在使用 PHP 前指定 `php.ini` 并在 INI 中添加 `openssl.cafile=/path/to/your-cert.pem` 来解决此问题。
对于 Linux 系统,你可以从 curl 官方网站下载 [cacert.pem](https://curl.se/docs/caextract.html) 文件,也可以使用系统自带的证书文件。
有关不同发行版的证书位置,参考 [Go 标准库](https://go.dev/src/crypto/x509/root_linux.go)。
有关不同发行版的证书位置,参考 [Golang 文档](https://go.dev/src/crypto/x509/root_linux.go)。
> INI 配置 `openssl.cafile`可以使用 `ini_set()` 函数动态设置,因为 `openssl.cafile`一个 `PHP_INI_SYSTEM` 类型的配置,只能在 `php.ini` 文件中设置。
> INI 配置 `openssl.cafile` 不使用 `ini_set()` 函数动态设置,因为 `openssl.cafile` 是 `PHP_INI_SYSTEM` 类型的配置,只能在 `php.ini` 文件中设置。
## 为什么不支持旧版本的 PHP
因为旧版本的 PHP 有很多问题,如安全问题、性能问题和功能问题。此外,许多旧版本的 PHP 与最新的依赖库不兼容,这也是不支持旧版本 PHP 的原因之一。
你可以使用 static-php-cli 早期编译的旧版本,如 PHP 8.0,但不会明确支持早期版本。

View File

@@ -5,6 +5,7 @@ Action 构建指的是直接使用 GitHub Action 进行编译。
如果你不想自行编译,可以从本项目现有的 Action 下载 Artifact也可以从自托管的服务器下载[进入](https://dl.static-php.dev/static-php-cli/common/)
> 自托管的二进制也是由 Action 构建而来,[项目仓库地址](https://github.com/static-php/static-php-cli-hosted)。
> 包含的扩展有bcmath,bz2,calendar,ctype,curl,dom,exif,fileinfo,filter,ftp,gd,gmp,iconv,xml,mbstring,mbregex,mysqlnd,openssl,pcntl,pdo,pdo_mysql,pdo_sqlite,phar,posix,redis,session,simplexml,soap,sockets,sqlite3,tokenizer,xmlwriter,xmlreader,zlib,zip
## 构建方法
@@ -13,7 +14,9 @@ Action 构建指的是直接使用 GitHub Action 进行编译。
1. Fork 本项目。
2. 进入项目的 Actions选择 CI 开头的 Workflow根据你需要的操作系统选择
3. 选择 `Run workflow`,填入你要编译的 PHP 版本、目标类型、扩展列表。(扩展列表使用英文逗号分割,例如 `bcmath,curl,mbstring`
4. 等待大约一段时间后,进入对应的任务中,获取 `Artifacts`
4. 如果需要共享扩展(例如 `xdebug`),请设置 `shared-extensions`(使用英文逗号分割,例如 `xdebug`
5. 如果需要 FrankenPHP请启用 `build-frankenphp`,同时也需要启用 `enable-zts`
6. 等待大约一段时间后,进入对应的任务中,获取 `Artifacts`
如果你选择了 `debug`,则会在构建时输出所有日志,包括编译的日志,以供排查错误。

View File

@@ -146,6 +146,7 @@ bin/spc build "openssl" --build-cli --debug
- `--with-clean`: 编译 PHP 前先清理旧的 make 产生的文件
- `--enable-zts`: 让编译的 PHP 为线程安全版本(默认为 NTS 版本)
- `--with-libs=XXX,YYY`: 编译 PHP 前先编译指定的依赖库,激活部分扩展的可选功能
- `--with-config-file-scan-dir=XXX` 读取 `php.ini` 后扫描 `.ini` 文件的目录(在 [这里](../faq/index.html#php-ini-的路径是什么) 查看默认路径)
- `-I xxx=yyy`: 编译前将 INI 选项硬编译到 PHP 内(支持多个选项,别名是 `--with-hardcoded-ini`
- `--with-micro-fake-cli`: 在编译 micro 时,让 micro 的 SAPI 伪装为 `cli`(用于兼容一些检查 `PHP_SAPI` 的程序)
- `--disable-opcache-jit`: 禁用 opcache jit默认启用

View File

@@ -0,0 +1,54 @@
# 构建 glibc 兼容的 Linux 二进制
## 为什么要构建 glibc 兼容的二进制
目前static-php-cli 在默认条件下在 Linux 系统构建的二进制都是基于 musl-libc静态链接的。
musl-libc 是一个轻量级的 libc 实现,它的目标是与 glibc 兼容,并且提供良好的纯静态链接支持。
这意味着,编译出来的静态 PHP 可执行文件在几乎任何 Linux 发行版都可以使用,而不需要考虑 libc、libstdc++ 等库的版本问题。
但是Linux 系统的纯静态链接 musl-libc 二进制文件存在以下问题:
- 无法使用 PHP 的 `dl()` 函数加载动态链接库和外部 PHP 扩展。
- 无法使用 PHP 的 FFI 扩展。
- 部分极端情况下,可能会出现性能问题,参见 [musl-libc 的性能问题](https://github.com/php/php-src/issues/13648)。
对于不同的 Linux 发行版,它们使用的默认 libc 可能不同,比如 Alpine Linux 使用 musl libc而大多数 Linux 发行版使用 glibc。
但即便如此,我们也不能直接使用任意的发行版和 glibc 构建便携的静态二进制文件,因为 glibc 有一些问题:
- 基于新版本的发行版在使用 gcc 等工具构建的二进制,无法在旧版本的发行版上运行。
- glibc 不推荐被静态链接,因为它的一些特性需要动态链接库的支持。
但是,我们可以使用 Docker 容器来解决这个问题,最终输出的结果是一个动态链接 glibc 和一些必要库的二进制,但它静态链接所有其他依赖。
1. 使用一个旧版本的 Linux 发行版(如 CentOS 7.x它的 glibc 版本比较旧,但是可以在大多数现代 Linux 发行版上运行。
2. 在这个容器中构建 PHP 的静态二进制文件,这样就可以在大多数现代 Linux 发行版上运行了。
> 使用 glibc 的静态二进制文件,可以在大多数现代 Linux 发行版上运行,但是不能在 musl libc 的发行版上运行,如 CentOS 6、Alpine Linux 等。
## 构建 glibc 兼容的 Linux 二进制
最新版的 static-php-cli 内置了 `bin/spc-gnu-docker` 脚本,可以一键创建一个 CentOS 7.x (glibc-2.17) 的 Docker 容器,并在容器中构建 glibc 兼容的 PHP 静态二进制文件。
然后,先运行一次以下命令。首次运行时时间较长,因为需要下载 CentOS 7.x 的镜像和一些编译工具。
```bash
bin/spc-gnu-docker
```
构建镜像完成后,你将看到和 `bin/spc` 一样的命令帮助菜单,这时说明容器已经准备好了。
在容器准备好后,你可以参考 [本地构建](./manual-build) 章节的内容,构建你的 PHP 静态二进制文件。仅需要把 `bin/spc``./spc` 替换为 `bin/spc-gnu-docker` 即可。
```bash
bin/spc-gnu-docker build bcmath,ctype,openssl,pdo,phar,posix,session,tokenizer,xml,zip --build-cli --debug
```
## 注意事项
极少数情况下,基于 glibc 的静态 PHP 可能会出现 segment fault 等错误,但目前例子较少,如果遇到问题请提交 issue。
glibc 构建为扩展的特性,不属于默认 static-php 的支持范围。如果有相关问题或需求,请在提交 Issue 时注明你是基于 glibc 构建的。
如果你需要不使用 Docker 构建基于 glibc 的二进制,请参考 `bin/spc-gnu-docker` 脚本,手动构建一个类似的环境。
请注意,我们仅支持使用 bin/spc-gnu-docker 构建的 glibc 版本。已在 RHEL 9 和 10 上进行了编译测试并验证其稳定性,但如果您遇到问题,我们可能不会进行修复。

View File

@@ -1,3 +1,7 @@
---
aside: false
---
<script setup lang="ts">
import CliGenerator from "../../.vitepress/components/CliGenerator.vue";
</script>

22
docs/zh/guide/deps-map.md Normal file
View File

@@ -0,0 +1,22 @@
---
outline: 'deep'
---
# 依赖关系图表
在编译 PHP 时,每个扩展、库都有依赖关系,这些依赖关系可能是必需的,也可能是可选的。在编译 PHP 时,可以选择是否包含这些可选的依赖关系。
例如,在 Linux 下编译 `gd` 扩展时,会强制编译 `zlib,libpng` 库和 `zlib` 扩展,而 `libavif,libwebp,libjpeg,freetype` 库都是可选的库,默认不会编译,除非通过 `--with-libs=avif,webp,jpeg,freetype` 选项指定。
- 对于可选扩展(扩展的可选特性),需手动在编译时指定,例如启用 Redis 的 igbinary 支持:`bin/spc build redis,igbinary`
- 对于可选库,需通过 `--with-libs=XXX` 选项编译指定。
- 如果想启用所有的可选扩展,可以使用 `bin/spc build redis --with-suggested-exts` 参数。
- 如果想启用所有的可选库,可以使用 `--with-suggested-libs` 参数。
## 扩展的依赖图
<!--@include: ../../deps-map-ext.md-->
## 库的依赖表
<!--@include: ../../deps-map-lib.md-->

View File

@@ -1,11 +1,21 @@
---
aside: false
---
# 环境变量列表
# 环境变量
本页面的环境变量列表中所提到的所有环境变量都具有默认值,除非另有说明。你可以通过设置这些环境变量来覆盖默认值。
## 环境变量列表
在 2.3.5 版本之后,我们将环境变量集中到了 `config/env.ini` 文件中,你可以通过修改这个文件来设置环境变量。
我们将 static-php-cli 支持的环境变量分为三种:
- 全局内部环境变量:在 static-php-cli 启动后即声明,你可以在 static-php-cli 的内部使用 `getenv()` 来获取他们,也可以在启动 static-php-cli 前覆盖。
- 固定环境变量:在 static-php-cli 启动后声明,你仅可使用 `getenv()` 获取,但无法通过 shell 脚本对其覆盖。
- 配置文件环境变量:在 static-php-cli 构建前声明,你可以通过修改 `config/env.ini` 文件或通过 shell 脚本来设置这些环境变量。
你可以阅读 [config/env.ini](https://github.com/crazywhalecc/static-php-cli/blob/main/config/env.ini) 中每项参数的注释来了解其作用(仅限英文版)。
## 自定义环境变量
一般情况下,你不需要修改任何以下环境变量,因为它们已经被设置为最佳值。
但是,如果你有特殊需求,你可以通过设置这些环境变量来满足你的需求(比如你需要调试不同编译参数下的 PHP 性能表现)。
@@ -20,89 +30,24 @@ bin/spc build mbstring,pcntl --build-cli
SPC_CONCURRENCY=4 bin/spc build mbstring,pcntl --build-cli
```
## 通用环境变量
或者,如果你需要长期修改某个环境变量,你可以通过修改 `config/env.ini` 文件来实现。
通用环境变量是所有构建目标都可以使用的环境变量
`config/env.ini` 分为三段,其中 `[global]` 全局有效,`[windows]``[macos]``[linux]` 仅对应的操作系统有效
| var name | default value | comment |
|------------------------------|---------------------------|-----------------------------|
| `BUILD_ROOT_PATH` | `{pwd}/buildroot` | 编译目标的根目录 |
| `BUILD_LIB_PATH` | `{pwd}/buildroot/lib` | 编译依赖库的根目录 |
| `BUILD_INCLUDE_PATH` | `{pwd}/buildroot/include` | 编译依赖库的头文件目录 |
| `BUILD_BIN_PATH` | `{pwd}/buildroot/bin` | 编译依赖库的二进制文件目录 |
| `PKG_ROOT_PATH` | `{pwd}/pkgroot` | 闭源或预编译工具下载后安装的目录 |
| `SOURCE_PATH` | `{pwd}/source` | 编译项目的源码解压缩目录 |
| `DOWNLOAD_PATH` | `{pwd}/downloads` | 下载的文件存放目录 |
| `SPC_CONCURRENCY` | 取决于当前 CPU 核心数量 | 并行编译的数量 |
| `SPC_SKIP_PHP_VERSION_CHECK` | 空 | 设置为 `yes` 时,跳过扩展对 PHP 版本的检查 |
例如,你需要修改编译 PHP 的 `./configure` 命令,你可以在 `config/env.ini` 文件中找到 `SPC_CMD_PREFIX_PHP_CONFIGURE` 环境变量,然后修改其值即可。
## 系统特定变量
但如果你的构建条件比较复杂,需要多种 env.ini 进行切换,我们推荐你使用 `config/env.custom.ini` 文件,这样你可以在不修改默认的 `config/env.ini` 文件的情况下,
通过写入额外的重载项目指定你的环境变量。
这些环境变量是特定于系统的,它们只在特定的系统上才会生效。
```ini
; This is an example of `config/env.custom.ini` file,
; we modify the `SPC_CONCURRENCY` and linux default CFLAGS passing to libs and PHP
[global]
SPC_CONCURRENCY=4
### Windows
| var name | default value | comment |
|----------------|------------------------------|-----------------|
| `PHP_SDK_PATH` | `{pwd}\php-sdk-binary-tools` | PHP SDK 工具的安装目录 |
| `UPX_EXEC` | `$PKG_ROOT_PATH\bin\upx.exe` | UPX 压缩工具的路径 |
### macOS
| var name | default value | comment |
|--------------------------------------|--------------------------------------------------------------------------------------------------------------------------------|-----------------------------------|
| `CC` | `clang` | C 编译器 |
| `CXX` | `clang++` | C++ 编译器 |
| `SPC_DEFAULT_C_FLAGS` | `--target=arm64-apple-darwin``--target=x86_64-apple-darwin` | 默认 C 编译标志(与 `CFLAGS` 不同) |
| `SPC_DEFAULT_CXX_FLAGS` | `--target=arm64-apple-darwin``--target=x86_64-apple-darwin` | 默认 C++ 编译标志(与 `CXXFLAGS` 不同) |
| `SPC_CMD_PREFIX_PHP_BUILDCONF` | `./buildconf --force` | 编译 PHP `buildconf` 命令前缀 |
| `SPC_CMD_PREFIX_PHP_CONFIGURE` | `./configure --prefix= --with-valgrind=no --enable-shared=no --enable-static=yes --disable-all --disable-cgi --disable-phpdbg` | 编译 PHP `configure` 命令前缀 |
| `SPC_CMD_PREFIX_PHP_MAKE` | `make -j$SPC_CONCURRENCY` | 编译 PHP `make` 命令前缀 |
| `SPC_CMD_VAR_PHP_CONFIGURE_CFLAGS` | `$SPC_DEFAULT_C_FLAGS -Werror=unknown-warning-option` | PHP `configure` 命令的 `CFLAGS` 变量 |
| `SPC_CMD_VAR_PHP_CONFIGURE_CPPFLAGS` | `-I$BUILD_INCLUDE_PATH` | PHP `configure` 命令的 `CPPFLAGS` 变量 |
| `SPC_CMD_VAR_PHP_CONFIGURE_LDFLAGS` | `-L$BUILD_LIB_PATH` | PHP `configure` 命令的 `LDFLAGS` 变量 |
| `SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS` | `-g0 -Os``-g -O0`(当使用 `--no-strip` 时为后者) | PHP `make` 命令的 `EXTRA_CFLAGS` 变量 |
| `SPC_CMD_VAR_PHP_MAKE_EXTRA_LIBS` | `-lresolv` | PHP `make` 命令的额外 `EXTRA_LIBS` 变量 |
### Linux
| var name | default value | comment |
|----------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------|
| `UPX_EXEC` | `$PKG_ROOT_PATH/bin/upx` | UPX 压缩工具的路径 |
| `GNU_ARCH` | `x86_64``aarch64` | 当前环境的 CPU 架构 |
| `CC` | Alpine: `gcc`, Other: `$GNU_ARCH-linux-musl-gcc` | C 编译器 |
| `CXX` | Alpine: `g++`, Other: `$GNU_ARCH-linux-musl-g++` | C++ 编译器 |
| `AR` | Alpine: `ar`, Other: `$GNU_ARCH-linux-musl-ar` | 静态库工具 |
| `LD` | `ld.gold` | 链接器 |
| `PATH` | `/usr/local/musl/bin:/usr/local/musl/$GNU_ARCH-linux-musl/bin:$PATH` | 系统 PATH |
| `SPC_DEFAULT_C_FLAGS` | empty | 默认 C 编译标志 |
| `SPC_DEFAULT_CXX_FLAGS` | empty | 默认 C++ 编译标志 |
| `SPC_CMD_PREFIX_PHP_BUILDCONF` | `./buildconf --force` | 编译 PHP `buildconf` 命令前缀 |
| `SPC_CMD_PREFIX_PHP_CONFIGURE` | `LD_LIBRARY_PATH={ld_lib_path} ./configure --prefix= --with-valgrind=no --enable-shared=no --enable-static=yes --disable-all --disable-cgi --disable-phpdbg` | 编译 PHP `configure` 命令前缀 |
| `SPC_CMD_PREFIX_PHP_MAKE` | `make -j$SPC_CONCURRENCY` | 编译 PHP `make` 命令前缀 |
| `SPC_CMD_VAR_PHP_CONFIGURE_CFLAGS` | `$SPC_DEFAULT_C_FLAGS` | PHP `configure` 命令的 `CFLAGS` 变量 |
| `SPC_CMD_VAR_PHP_CONFIGURE_CPPFLAGS` | `-I$BUILD_INCLUDE_PATH` | PHP `configure` 命令的 `CPPFLAGS` 变量 |
| `SPC_CMD_VAR_PHP_CONFIGURE_LDFLAGS` | `-L$BUILD_LIB_PATH` | PHP `configure` 命令的 `LDFLAGS` 变量 |
| `SPC_CMD_VAR_PHP_CONFIGURE_LIBS` | `-ldl -lpthread` | PHP `configure` 命令的 `LIBS` 变量 |
| `SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS` | `-g0 -Os -fno-ident -fPIE``-g -O0 -fno-ident -fPIE`(当使用 `--no-strip` 时为后者) | PHP `make` 命令的 `EXTRA_CFLAGS` 变量 |
| `SPC_CMD_VAR_PHP_MAKE_EXTRA_LIBS` | empty | PHP `make` 命令的额外 `EXTRA_LIBS` 变量 |
| `SPC_CMD_VAR_PHP_MAKE_EXTRA_LDFLAGS_PROGRAM` | `-all-static`(当使用 `clang` 时:`-Xcompiler -fuse-ld=lld -all-static` | `make` 命令的额外 `LDFLAGS` 变量(用于编译程序) |
| `SPC_NO_MUSL_PATH` | empty | 是否不插入 musl 工具链的 PATH值为 `yes` 时不插入) |
> `{ld_lib_path}` 值为 `/usr/local/musl/$GNU_ARCH-linux-musl/lib`。
### FreeBSD
因 FreeBSD 系统的用户较少,我们暂时不提供 FreeBSD 系统的环境变量。
### Unix
对于 macOS、Linux、FreeBSD 等 Unix 系统,以下环境变量是通用的。
| var name | default value | comment |
|-------------------|------------------------------|------------------|
| `PATH` | `$BUILD_BIN_PATH:$PATH` | 系统 PATH |
| `PKG_CONFIG_PATH` | `$BUILD_LIB_PATH/pkgconfig` | pkg-config 的搜索路径 |
| `PKG_CONFIG` | `$BUILD_BIN_PATH/pkg-config` | pkg-config 命令路径 |
[linux]
SPC_DEFAULT_C_FLAGS="-O3"
```
## 编译依赖库的环境变量(仅限 Unix 系统)
@@ -138,6 +83,7 @@ openssl_CFLAGS="-O0"
| `ldap_LDFLAGS` | `-L$BUILD_LIB_PATH` |
| `openssl_CFLAGS` | Linux: `$SPC_DEFAULT_C_FLAGS`, Other: empty |
| others... | empty |
:::
下表是支持自定义以上三种变量的依赖库名称列表:
@@ -161,5 +107,6 @@ openssl_CFLAGS="-O0"
::: tip
因为给每个库适配自定义环境变量是一项特别繁琐的工作,且大部分情况下你都不需要这些库的自定义环境变量,所以我们目前只支持了部分库的自定义环境变量。
如果你需要自定义环境变量的库不在上方列表,可以通过 [GitHub Issue](https://github.com/crazywhalecc/static-php-cli/issues) 来提出需求。
如果你需要自定义环境变量的库不在上方列表,可以通过 [GitHub Issue](https://github.com/crazywhalecc/static-php-cli/issues)
来提出需求。
:::

View File

@@ -4,6 +4,8 @@
## curl
HTTP3 支持默认未启用,需在编译时添加 `--with-libs="nghttp2,nghttp3,ngtcp2"` 以启用 PHP 8.4 及以上版本的 HTTP3 支持。
使用 curl 请求 HTTPS 时,可能存在 `error:80000002:system library::No such file or directory` 错误,
解决办法详见 [FAQ - 无法使用 ssl](../faq/#无法使用-ssl)。
@@ -41,15 +43,27 @@ swoole-hook-sqlite 不是一个扩展,而是 Swoole 的 Hook 特性。
swoole-hook-sqlite 与 `pdo_sqlite` 扩展冲突。如需使用 Swoole 和 `pdo_sqlite`,请删除 pdo_sqlite 扩展,启用 `swoole``swoole-hook-sqlite` 即可。
该扩展包含了 `pdo_sqlite` 的协程环境的实现。
## swoole-hook-odbc
swoole-hook-odbc 不是一个扩展,而是 Swoole 的 Hook 特性。
如果你在编译时添加了 `swoole,swoole-hook-odbc`,你将启用 Swoole 的 `odbc` 扩展的协程模式。
swoole-hook-odbc 与 `pdo_odbc` 扩展冲突。如需使用 Swoole 和 `pdo_odbc`,请删除 `pdo_odbc` 扩展,启用 `swoole``swoole-hook-odbc` 即可。
该扩展包含了 `pdo_odbc` 的协程环境的实现。
## swow
1. swow 仅支持 PHP >= 8.0 版本。
1. swow 仅支持 PHP 8.0+ 版本。
## imagick
1. OpenMP 支持已被禁用,这是维护者推荐的做法,系统软件包也是如此配置。
## imap
1. 该扩展目前不支持 Kerberos。
2. 由于底层的 c-client、ext-imap 不是线程安全的。 无法在 `--enable-zts` 构建中使用它。
3. 由于该扩展可能会从未来的 PHP 中删除,因此我们建议您寻找替代实现,例如 [Webklex/php-imap](https://github.com/Webklex/php-imap)。
3. 该扩展已在 PHP 8.4 中被移除,因此我们建议您寻找替代实现,例如 [Webklex/php-imap](https://github.com/Webklex/php-imap)。
## gd
@@ -70,9 +84,9 @@ bin/spc build gd --with-libs=freetype,libjpeg,libavif,libwebp --build-cli
## xdebug
1. Xdebug 是一个 Zend 扩展Xdebug 的功能依赖于 PHP 的 Zend 引擎和底层代码,如果要将其静态编译到 PHP 中,可能需要巨量的 patch 代码,这是不可行的
2. macOS 平台可以通过在相同平台编译的 PHP 下编译一个 xdebug 扩展,并提取其中的 `xdebug.so` 文件,再在 static-php-cli 中使用 `--no-strip` 参数保留调试符号表,同时加入 `ffi` 扩展。
编译的 `./php` 二进制可以通过指定 INI 配置运行,例如`./php -d 'zend_extension=xdebug.so' your-code.php`
1. Xdebug 只能作为共享扩展进行构建。您需要使用除了 `musl-static` 外的其他 `SPC_TARGET` 构建目标
2. 使用 Linux/glibc 或 macOS 时,您可以使用 `--build-shared=xdebug` 将 Xdebug 编译为共享扩展。
编译`./php` 二进制文件可以通过指定 INI 文件进行配置运行,例如 `./php -d 'zend_extension=/path/to/xdebug.so' your-code.php`
## xml
@@ -108,14 +122,15 @@ pgsql 16.2 修复了这个 Bug现在正常工作了。
## password-argon2
1. password-argon2不是一个标准的扩展,它是 `password_hash` 函数的额外算法
2. 在Linux系统password-argon2 的依赖库 `libargon2``libsodium` 库冲突
1. password-argon2不是一个标准的扩展`password_hash` 函数的 `PASSWORD_ARGON2ID` 算法需要 libsodium 或 libargon2 才能工作
2. 使用 password-argon2 可以为此启用多线程支持
## ffi
1. 因为 Linux 系统的限制,虽然可以成功编译 ffi 扩展,但无法使用它加载其他 `so` 扩展。Linux 支持加载 so 扩展的前提是非静态编译,但动态编译和本项目的目的冲突
2. macOS 支持 ffi 扩展,但是部分内核下不包含调试符号时会出现错误
3. Windows 支持 ffi 扩展。
1. 由于 musl libc 静态链接的限制,无法加载动态库,因此无法使用 ffi
如果您需要使用 ffi 扩展,请参阅 [使用 GNU libc 编译 PHP](./build-with-glibc)
2. macOS 支持 ffi 扩展,但某些内核不包含调试符号时会出现错误
3. Windows x64 支持 ffi 扩展。
## xhprof
@@ -132,7 +147,12 @@ event 扩展在 macOS 系统下编译后暂无法使用 `openpty` 特性。相
parallel 扩展只支持 PHP 8.0 及以上版本,并只支持 ZTS 构建(`--enable-zts`)。
# spx
## spx
1. [SPX 扩展](https://github.com/NoiseByNorthwest/php-spx) 只支持非线程模式
2. SPX 目前不支持 Windows且官方仓库也不支持静态编译static-php-cli 使用了 [修改版本](https://github.com/static-php/php-spx)。
1. SPX 目前不支持 Windows且官方仓库也不支持静态编译static-php-cli 使用了 [修改版本](https://github.com/static-php/php-spx)。
## mimalloc
1. 从技术上讲,这不是扩展,而是一个库。
2. 在 Linux 或 macOS 上使用 `--with-libs="mimalloc"` 进行构建将覆盖默认分配器。
3. 目前,这还处于实验阶段,但建议在线程环境中使用。

View File

@@ -1,3 +1,7 @@
<script setup>
import SearchTable from "../../.vitepress/components/SearchTable.vue";
</script>
# 扩展列表
> - `yes`: 已支持
@@ -5,7 +9,8 @@
> - `no` with issue link: 确定不支持或无法支持
> - `partial` with issue link: 已支持,但是无法完美工作
<!--@include: ../../extensions.md-->
<search-table />
::: tip
如果缺少您需要的扩展,您可以创建 [功能请求](https://github.com/crazywhalecc/static-php-cli/issues)。
@@ -13,12 +18,5 @@
有些扩展或扩展依赖的库会有一些可选的特性,例如 gd 库可选支持 libwebp、freetype 等。
如果你只使用 `bin/spc build gd --build-cli` 是不会包含它们static-php-cli 默认为最小依赖原则)。
你可以在编译时使用 `--with-libs=` 加入这些库当本次编译的依赖库中包含它们gd 会自动依赖它们启用这些特性
(如:`bin/spc build gd --with-libs=libwebp,freetype --build-cli`
或者你也可以使用 `--with-suggested-exts``--with-suggested-libs` 启用这些扩展和库所有可选的依赖。
(如:`bin/spc build gd --with-suggested-libs --build-cli`
如果你不知道某个扩展是否有可选特性,可以通过查看 [spc 配置文件](https://github.com/crazywhalecc/static-php-cli/tree/main/config)
或使用命令 `bin/spc dev:extensions` 查看(库依赖为 `lib-suggests`,扩展依赖为 `ext-suggests`)。
有关编译可选库,请参考 [扩展、库的依赖关系图表](./deps-map)。对于可选的库,你也可以从 [编译命令生成器](./cli-generator) 中选择扩展后展开选择可选库
:::

View File

@@ -4,8 +4,8 @@ static-php-cli 是一个用于构建静态编译的 PHP 二进制的工具,目
在指南章节中,你将了解到如何使用 static-php-cli 构建独立的 php 程序。
- [Action 构建](./action-build)
- [本地构建](./manual-build)
- [Action 构建](./action-build)
- [扩展列表](./extensions)
## 编译环境
@@ -19,16 +19,30 @@ static-php-cli 是一个用于构建静态编译的 PHP 二进制的工具,目
| Windows | :gear: :computer: | |
| FreeBSD | :computer: | :computer: |
其中Linux 目前仅在 Ubuntu、Debian、Alpine 发行版测试通过,其他发行版未进行测试,不能保证编译成功。
对于未经过测试的发行版,可以使用 Docker 等方式本地编译,避免环境导致的问题。
当前支持编译的 PHP 版本:
macOS 下支持 x86_64 和 Arm 两种架构,但在其中一个架构上编译的二进制无法直接在另一个架构上使用
Rosetta 2 不能保证 Arm 架构编译的程序可以完全运行在 x86_64 环境下。
> :warning: 部分支持,对于新的测试版和旧版本可能存在问题
>
> :heavy_check_mark: 支持
>
> :x: 不支持
Windows 目前只支持 x86_64 架构,不支持 32 位 x86、不支持 arm64 架构。
| PHP Version | Status | Comment |
|-------------|--------------------|---------------------------------------------------------|
| 7.2 | :x: | |
| 7.3 | :x: | phpmicro 和许多扩展不支持 7.3、7.4 版本 |
| 7.4 | :x: | phpmicro 和许多扩展不支持 7.3、7.4 版本 |
| 8.0 | :warning: | PHP 官方已停止 8.0 的维护,我们不再处理 8.0 相关的 backport 支持 |
| 8.1 | :warning: | PHP 官方仅对 8.1 提供安全更新,在 8.5 发布后我们不再处理 8.1 相关的 backport 支持 |
| 8.2 | :heavy_check_mark: | |
| 8.3 | :heavy_check_mark: | |
| 8.4 | :heavy_check_mark: | |
| 8.5 (beta) | :warning: | PHP 8.5 目前处于 beta 阶段 |
> 这个表格的支持状态是 static-php-cli 对构建对应版本的支持情况,不是 PHP 官方对该版本的支持情况。
## PHP 支持版本
目前static-php-cli 对 PHP 7.4 ~ 8.3 版本是支持的,对于 PHP 7.4 及更早版本理论上支持,只需下载时选择早期版本即可。
目前static-php-cli 对 PHP 8.2 ~ 8.5 版本是支持的,对于 PHP 8.1 及更早版本理论上支持,只需下载时选择早期版本即可。
但由于部分扩展和特殊组件已对早期版本的 PHP 停止了支持,所以 static-php-cli 不会明确支持早期版本。
我们推荐你编译尽可能新的 PHP 版本,以获得更好的体验。

View File

@@ -1,3 +1,7 @@
---
outline: 'deep'
---
# 本地构建Linux、macOS、FreeBSD
本章节为 Linux、macOS、FreeBSD 的构建过程,如果你要在 Windows 上构建,请到 [在 Windows 上构建](./build-on-windows)。
@@ -50,29 +54,29 @@ cd static-php-cli
composer update
```
### 使用系统 PHP 环境
### 使用预编译静态 PHP 二进制运行 static-php-cli
下面是系统安装 PHP、Composer 的一些示例命令。具体安装方式建议自行搜索或询问 AI 搜索引擎获取答案,这里不多赘述。
如果你不想使用 Docker、在系统安装 PHP,可以直接下载本项目自身编译好的 php 二进制 cli 程序。使用流程如下:
```bash
# [macOS], 需要先安装 Homebrew. See https://brew.sh/
# 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.
brew install php wget
wget https://getcomposer.org/download/latest-stable/composer.phar -O /path/to/your/bin/composer && chmod +x /path/to/your/bin/composer
# [Debian], you need to make sure your php version >= 8.1 and composer >= 2.0
sudo apt install php-cli composer php-tokenizer
# [Alpine]
apk add bash file wget xz php81 php81-common php81-pcntl php81-tokenizer php81-phar php81-posix php81-xml composer
```
使用命令部署环境,此脚本会从 [自托管的服务器](https://dl.static-php.dev/static-php-cli/) 下载一个当前操作系统的 php-cli 包,
并从 [getcomposer](https://getcomposer.org/download/latest-stable/composer.phar) 或 [Aliyun镜像](https://mirrors.aliyun.com/composer/composer.phar) 下载 Composer。
::: tip
目前 Ubuntu 部分版本的 apt 安装的 php 版本较旧,故不提供安装命令。如有需要,建议先添加 ppa 等软件源后,安装最新版的 PHP 以及 tokenizer、xml、phar 扩展
较老版本的 Debian 默认安装的可能为旧版本(<= 7.4)版本的 PHP建议先升级 Debian。
使用预编译静态 PHP 二进制目前仅支持 Linux 和 macOS。FreeBSD 环境因为缺少自动化构建环境,所以暂不支持
:::
```bash
bin/setup-runtime
# 对于中国大陆地区等网络环境特殊的用户,可使用镜像站加快下载速度
bin/setup-runtime --mirror china
```
此脚本总共会下载两个文件:`bin/php``bin/composer`,下载完成后,有两种使用方式:
1.`bin/` 目录添加到 PATH 路径中:`export PATH="/path/to/your/static-php-cli/bin:$PATH"`,添加路径后,相当于系统安装了 PHP可直接使用 `composer``php -v` 等命令,也可以直接使用 `bin/spc`
2. 直接调用,比如执行 static-php-cli 命令:`bin/php bin/spc --help`,执行 Composer`bin/php bin/composer update`
### 使用 Docker 环境
如果你不愿意在系统安装 PHP 和 Composer 运行环境,可以使用内置的 Docker 环境构建脚本。
@@ -92,30 +96,66 @@ bin/spc-alpine-docker
export SPC_USE_SUDO=yes
```
### 使用预编译静态 PHP 二进制
### 使用系统 PHP 环境
如果你不想使用 Docker、在系统安装 PHP,可以直接下载本项目自身编译好的 php 二进制 cli 程序。使用流程如下:
使用命令部署环境,此脚本会从 [自托管的服务器](https://dl.static-php.dev/static-php-cli/) 下载一个当前操作系统的 php-cli 包,
并从 [getcomposer](https://getcomposer.org/download/latest-stable/composer.phar) 或 [Aliyun镜像](https://mirrors.aliyun.com/composer/composer.phar) 下载 Composer。
::: tip
使用预编译静态 PHP 二进制目前仅支持 Linux 和 macOS。FreeBSD 环境因为缺少自动化构建环境,所以暂不支持。
:::
下面是系统安装 PHP、Composer 的一些示例命令。具体安装方式建议自行搜索或询问 AI 搜索引擎获取答案,这里不多赘述。
```bash
bin/setup-runtime
# [macOS], 需要先安装 Homebrew. See https://brew.sh/
# 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.
brew install php wget
wget https://getcomposer.org/download/latest-stable/composer.phar -O /path/to/your/bin/composer && chmod +x /path/to/your/bin/composer
# 对于中国大陆地区等网络环境特殊的用户,可使用镜像站加快下载速度
bin/setup-runtime --mirror china
# [Debian], you need to make sure your php version >= 8.4 and composer >= 2.0
sudo apt install php-cli composer php-tokenizer
```
此脚本总共会下载两个文件:`bin/php``bin/composer`,下载完成后,有两种使用方式:
::: tip
目前 Ubuntu 部分版本的 apt 安装的 php 版本较旧,故不提供安装命令。如有需要,建议先添加 ppa 等软件源后,安装最新版的 PHP 以及 tokenizer、xml、phar 扩展。
1.`bin/` 目录添加到 PATH 路径中:`export PATH="/path/to/your/static-php-cli/bin:$PATH"`,添加路径后,相当于系统安装了 PHP可直接使用 `composer``php -v` 等命令,也可以直接使用 `bin/spc`
2. 直接调用,比如执行 static-php-cli 命令:`bin/php bin/spc --help`,执行 Composer`bin/php bin/composer update`
较老版本的 Debian 默认安装的可能为旧版本(<= 8.3)版本的 PHP建议先升级 Debian 或使用 Docker 或自带的静态二进制环境
:::
## 命令 download - 下载依赖包
## 使用 craft 构建(推荐)
使用 `bin/spc craft` 可以使用一个配置文件,一个命令实现自动检查环境、下载源代码、构建依赖库、构建 PHP 及扩展等。
你需要编写一个 `craft.yml` 文件,存放在当前工作目录下。`craft.yml` 可以由 [命令生成器](./cli-generator) 生成,或者手动编写。
手动编写可参考 [craft.yml 配置](../develop/craft-yml.md) 中的注释来编写。我们下面假设你编译一个扩展组合,并选用 PHP 8.4,输出 `cli``fpm`
```yaml
# path/to/craft.yml
php-version: 8.4
extensions: bcmath,posix,phar,zlib,openssl,curl,fileinfo,tokenizer
sapi:
- cli
- fpm
```
然后使用 `bin/spc craft` 命令来编译:
```bash
bin/spc craft --debug
```
如果构建成功,你会在当前目录下看到 `buildroot/bin` 目录,里面包含了编译好的 PHP 二进制文件,或相应的 SAPI。
- cli: Windows 下构建结果为 `buildroot/bin/php.exe`,其他平台为 `buildroot/bin/php`
- fpm: 构建结果为 `buildroot/bin/php-fpm`
- micro: 构建结果为 `buildroot/bin/micro.sfx`,如需进一步与 PHP 代码打包,请查看 [打包 micro 二进制](./manual-build#命令-micro-combine-打包-micro-二进制)。
- embed: 参见 [embed 使用](./manual-build#embed-使用)。
- frankenphp: 构建结果为 `buildroot/bin/frankenphp`
如果中途构建出错,你可以使用 `--debug` 参数查看详细的错误信息,或者使用 `--with-clean` 参数清除旧的编译结果,重新编译。
如使用以上方式仍构建失败,请提交一个 issue附上你的 `craft.yml` 文件、`log/` 目录的压缩包。
## 分步构建命令
如果你有定制化需求,或分开下载、编译 PHP 和依赖库的需求,可以使用 `bin/spc` 命令分步执行。
### 命令 download - 下载依赖包
使用命令 `bin/spc download` 可以下载编译需要的源代码,包括 php-src 以及依赖的各种库的源码。
@@ -132,8 +172,8 @@ bin/spc download --for-libs=liblz4,libevent --for-extensions=pcntl,rar,xml
# 仅下载要编译的库(包括其依赖,使用库名,不包含可选库)
bin/spc download --for-libs=liblz4,libevent --without-suggestions
# 下载资源时,忽略部分资源的缓存,强制下载(如切换 PHP 版本)
bin/spc download --for-extensions=curl,pcntl,xml --ignore-cache-sources=php-src --with-php=8.3
# 下载资源时,忽略部分资源的缓存,强制下载(如切换特定 PHP 版本)
bin/spc download --for-extensions=curl,pcntl,xml --ignore-cache-sources=php-src --with-php=8.3.10
# 下载资源时,优先下载有预编译包的依赖库(减少编译依赖的时间)
bin/spc download --for-extensions="curl,pcntl,xml,mbstring" --prefer-pre-built
@@ -141,8 +181,8 @@ bin/spc download --for-extensions="curl,pcntl,xml,mbstring" --prefer-pre-built
# 下载所有依赖包
bin/spc download --all
# 下载所有依赖包,并指定下载的 PHP 主版本,可选:7.37.48.08.18.28.3
bin/spc download --all --with-php=8.2
# 下载所有依赖包,并指定下载的 PHP 主版本,可选:8.18.28.38.4也可以使用特定的版本如 8.3.10
bin/spc download --all --with-php=8.3
# 下载时显示下载进度条curl
bin/spc download --all --debug
@@ -169,14 +209,25 @@ bin/spc download --from-zip=/path/to/your/download.zip
让下载器强制使用你指定的链接下载此 source 的包。使用方法为 `{source-name}:{url}` 即可,可同时重写多个库的下载地址。在使用 `--for-extensions` 选项下载时同样可用。
```bash
# 例如:指定下载测试版的 PHP8.3
bin/spc download --all -U "php-src:https://downloads.php.net/~eric/php-8.3.0beta1.tar.gz"
# 例如:指定下载 Alpha 版的 PHP8.5
bin/spc download --all -U "php-src:https://downloads.php.net/~edorian/php-8.5.0alpha2.tar.xz"
# 指定下载旧版本的 curl 库
bin/spc download --all -U "curl:https://curl.se/download/curl-7.88.1.tar.gz"
```
## 命令 doctor - 环境检查
如果你下载的资源不是链接,而是一个 Git 仓库,你可以使用 `-G``--custom-git` 重写下载链接,让下载器强制使用你指定的 Git 仓库下载此 source 的包。
使用方法为 `{source-name}:{branch}:{url}` 即可,可同时重写多个库的下载地址。在使用 `--for-extensions` 选项下载时同样可用。
```bash
# 例如:下载 master 分支的 php-src
bin/spc download --for-extensions=redis,phar -G "php-src:master:https://github.com/php/php-src.git"
# 从 swoole-src 仓库下载 master 分支的最新代码,而不是发行版
bin/spc download --for-extensions=swoole -G "swoole:master:https://github.com/swoole/swoole-src.git"
```
### 命令 doctor - 环境检查
如果你可以正常运行 `bin/spc` 但无法正常编译静态的 PHP 或依赖库,可以先运行 `bin/spc doctor` 检查系统自身是否缺少依赖。
@@ -188,18 +239,20 @@ bin/spc doctor
bin/spc doctor --auto-fix
```
## 命令 build - 编译 PHP
### 命令 build - 编译 PHP
使用 build 命令可以开始构建静态 php 二进制,在执行 `bin/spc build` 命令前,务必先使用 `download` 命令下载资源,建议使用 `doctor` 检查环境。
### 基本用法
#### 基本用法
你需要先到 [扩展列表](./extensions) 或 [命令生成器](./cli-generator) 选择你要加入的扩展,然后使用命令 `bin/spc build` 进行编译。你需要指定一个编译目标,从如下参数中选择:
- `--build-cli`: 构建一个 cli sapi命令行界面可在命令行执行 PHP 代码)
- `--build-fpm`: 构建一个 fpm sapiphp-fpm用于和其他传统的 fpm 架构的软件如 nginx 配合使用)
- `--build-cgi`: 构建一个 cgi sapicgi可用于传统的 cgi 架构的软件如 apache 配合使用)
- `--build-micro`: 构建一个 micro sapi用于构建一个包含 PHP 代码的独立可执行二进制)
- `--build-embed`: 构建一个 embed sapi用于嵌入到其他 C 语言程序中)
- `--build-frankenphp`: 构建一个 [frankenphp](https://github.com/php/frankenphp) 二进制
- `--build-all`: 构建以上所有 sapi
```bash
@@ -225,26 +278,18 @@ bin/spc build bcmath,curl,openssl,ftp,posix,pcntl --build-cli
如果你想构建多个版本的 PHP且不想每次都重复构建其他依赖库可以使用 `switch-php-version` 在编译好一个版本后快速切换至另一个版本并编译:
```shell
# switch to 8.3
bin/spc switch-php-version 8.3
# switch to 8.4
bin/spc switch-php-version 8.4
# build
bin/spc build bcmath,curl,openssl,ftp,posix,pcntl --build-cli
# switch to 8.0
bin/spc switch-php-version 8.0
# switch to 8.1
bin/spc switch-php-version 8.1
# build
bin/spc build bcmath,curl,openssl,ftp,posix,pcntl --build-cli
```
:::
### 调试
如果你在编译过程中遇到了问题,或者想查看每个执行的 shell 命令,可以使用 `--debug` 开启 debug 模式,查看所有终端日志:
```bash
bin/spc build mysqlnd,pdo_mysql --build-all --debug
```
### 编译运行选项
#### 编译运行选项
在编译过程中,有些特殊情况需要对编译器、编译目录的内容进行干预,可以尝试使用以下命令:
@@ -252,8 +297,10 @@ bin/spc build mysqlnd,pdo_mysql --build-all --debug
- `--cxx=XXX`: 指定 C++ 语言编译器的执行命令Linux 默认 `g++`macOS 默认 `clang++`
- `--with-clean`: 编译 PHP 前先清理旧的 make 产生的文件
- `--enable-zts`: 让编译的 PHP 为线程安全版本(默认为 NTS 版本)
- `--no-strip`: 编译 PHP 库后不运行 `strip` 裁剪二进制文件缩小体积(不裁剪的 macOS 二进制文件可使用动态链接的第三方扩展)
- `--no-strip`: 编译 PHP 库后不运行 `strip` 裁剪二进制文件缩小体积
- `--with-libs=XXX,YYY`: 编译 PHP 前先编译指定的依赖库,激活部分扩展的可选功能(例如 gd 库的 libavif 等)
- `--with-config-file-path=XXX` 查找 `php.ini` 的路径(在 [这里](../faq/index.html#php-ini-的路径是什么) 查看默认路径)
- `--with-config-file-scan-dir=XXX` 读取 `php.ini` 后扫描 `.ini` 文件的目录(在 [这里](../faq/index.html#php-ini-的路径是什么) 查看默认路径)
- `-I xxx=yyy`: 编译前将 INI 选项硬编译到 PHP 内(支持多个选项,别名是 `--with-hardcoded-ini`
- `--with-micro-fake-cli`: 在编译 micro 时,让 micro 的 SAPI 伪装为 `cli`(用于兼容一些检查 `PHP_SAPI` 的程序)
- `--disable-opcache-jit`: 禁用 opcache jit默认启用
@@ -262,6 +309,7 @@ bin/spc build mysqlnd,pdo_mysql --build-all --debug
- `--with-suggested-exts`: 编译时将 `ext-suggests` 也作为编译依赖加入
- `--with-suggested-libs`: 编译时将 `lib-suggests` 也作为编译依赖加入
- `--with-upx-pack`: 编译后使用 UPX 减小二进制文件体积(需先使用 `bin/spc install-pkg upx` 安装 upx
- `--build-shared=XXX,YYY`: 编译时将指定的扩展编译为共享库(默认编译为静态库)
硬编码 INI 选项适用于 cli、micro、embed。有关硬编码 INI 选项,下面是一个简单的例子,我们预设一个更大的 `memory_limit`,并且禁用 `system` 函数:
@@ -329,6 +377,14 @@ memory_limit=1G
如果要打包 phar只需要将 `a.php` 替换为打包好的 phar 文件即可。但要注意phar 下的 micro.sfx 需要额外注意路径问题,见 [Developing - Phar 路径问题](../develop/structure#phar-应用目录问题)
## 调试
如果你在编译过程中遇到了问题,或者想查看每个执行的 shell 命令,可以使用 `--debug` 开启 debug 模式,查看所有终端日志:
```bash
bin/spc build mysqlnd,pdo_mysql --build-all --debug
```
## 命令 extract - 手动解压某个库
使用命令 `bin/spc extract` 可以解包和拷贝编译需要的源代码,包括 php-src 以及依赖的各种库的源码(需要自己指定要解包的库名)。
@@ -340,6 +396,32 @@ memory_limit=1G
bin/spc extract php-src,libxml2
```
## 命令 dump-extensions - 导出项目扩展依赖
使用命令 `bin/spc dump-extensions` 可以导出当前项目的扩展依赖。
```bash
# 打印项目的扩展列表传入项目包含composer.json的根目录
bin/spc dump-extensions /path/to/your/project/
# 打印项目的扩展列表,不包含开发依赖
bin/spc dump-extensions /path-to/tour/project/ --no-dev
# 输出为 spc 命令可接受的扩展列表格式(逗号分割)
bin/spc dump-extensions /path-to/tour/project/ --format=text
# 输出为 JSON 列表
bin/spc dump-extensions /path-to/tour/project/ --format=json
# 当项目没有任何扩展时,输出指定扩展组合,而不是返回失败
bin/spc dump-extensions /path-to/your/project/ --no-ext-output=mbstring,posix,pcntl,phar
# 输出时不排除 spc 不支持的扩展
bin/spc dump-extensions /path/to/your/project/ --no-spc-filter
```
需要注意的是,项目的目录下必须包含 `vendor/installed.json``composer.lock` 文件,否则无法正常获取。
## 调试命令 dev - 调试命令集合
调试命令指的是你在使用 static-php-cli 构建 PHP 或改造、增强 static-php-cli 项目本身的时候,可以辅助输出一些信息的命令集合。
@@ -378,6 +460,8 @@ bin/spc dev:sort-config ext
下面是安装工具的示例:
- 下载安装 UPX仅限 Linux 和 Windows: `bin/spc install-pkg upx`
- 下载安装 nasm仅限 Windows: `bin/spc install-pkg nasm`
- 下载安装 go-xcaddy: `bin/spc install-pkg go-xcaddy`
## 命令 del-download - 删除已下载的资源
@@ -416,6 +500,8 @@ bin/spc dev:sort-config ext
| after-exts-extract | 在要编译的扩展解压到 PHP 源码目录后触发 |
| before-library[*name*]-build | 在名称为 `name` 的库编译前触发(如 `before-library[postgresql]-build` |
| after-library[*name*]-build | 在名称为 `name` 的库编译后触发 |
| after-shared-ext[*name*]-build | 在名称为 `name` 的共享扩展编译后触发(如 `after-shared-ext[redis]-build` |
| before-shared-ext[*name*]-build | 在名称为 `name` 的共享扩展编译前触发 |
| before-php-buildconf | 在编译 PHP 命令 `./buildconf` 前触发 |
| before-php-configure | 在编译 PHP 命令 `./configure` 前触发 |
| before-php-make | 在编译 PHP 命令 `make` 前触发 |
@@ -480,3 +566,75 @@ static-php-cli 开放的方法非常多,文档中无法一一列举,但只
- 如果你想重新构建一次,但不重新下载源码,可以先 `rm -rf buildroot source` 删除编译目录和源码目录,然后重新构建。
- 如果你想更新某个依赖的版本,可以使用 `bin/spc del-download <source-name>` 删除指定的源码,然后使用 `download <source-name>` 重新下载。
- 如果你想更新所有依赖的版本,可以使用 `bin/spc download --clean` 删除所有下载的源码,然后重新下载。
## embed 使用
如果你想将 static-php 嵌入到其他 C 语言程序中,可以使用 `--build-embed` 构建一个 embed 版本的 PHP。
```bash
bin/spc build {your extensions} --build-embed --debug
```
在通常的情况下PHP embed 编译后会生成 `php-config`。对于 static-php我们提供了 `spc-config`,用于获取编译时的参数。
另外,在使用 embed SAPIlibphp.a你需要使用和编译 libphp 相同的编译器,否则会出现链接错误。
下面是 spc-config 的基本用法:
```bash
# output all flags and options
bin/spc spc-config curl,zlib,phar,openssl
# output libs
bin/spc spc-config curl,zlib,phar,openssl --libs
# output includes
bin/spc spc-config curl,zlib,phar,openssl --includes
```
默认情况下static-php 在不同系统使用的编译器分别是:
- macOS: `clang`
- Linux (Alpine Linux): `gcc`
- Linux (glibc based distros, x86_64): `/usr/local/musl/bin/x86_64-linux-musl-gcc`
- Linux (glibc based distros, aarch64): `/usr/local/musl/bin/aarch64-linux-musl-gcc`
- FreeBSD: `clang`
下面是一个使用 embed SAPI 的例子:
```c
// embed.c
#include <sapi/embed/php_embed.h>
int main(int argc,char **argv){
PHP_EMBED_START_BLOCK(argc,argv)
zend_file_handle file_handle;
zend_stream_init_filename(&file_handle,"embed.php");
if(php_execute_script(&file_handle) == FAILURE){
php_printf("Failed to execute PHP script.\n");
}
PHP_EMBED_END_BLOCK()
return 0;
}
```
```php
<?php
// embed.php
echo "Hello world!\n";
```
```bash
# compile in debian/ubuntu x86_64
/usr/local/musl/bin/x86_64-linux-musl-gcc embed.c $(bin/spc spc-config bcmath,zlib) -static -o embed
# compile in macOS/FreeBSD
clang embed.c $(bin/spc spc-config bcmath,zlib) -o embed
./embed
# out: Hello world!
```

View File

@@ -5,16 +5,27 @@
## 下载失败问题
下载资源问题是 spc 最常见的问题之一。主要是由于 spc 下载资源使用的地址一般均为对应项目的官方网站或 GitHub 等,而这些网站可能偶尔会宕机、屏蔽 IP 地址。
目前 2.0.0 版本还没有加入自动重试机制,所以在遇到下载失败后,可以多次尝试调用下载命令。如果确认地址确实无法正常访问,可以提交 Issue 或 PR 更新地址
在遇到下载失败后,可以多次尝试调用下载命令
## doctor 无法修复
当下载资源时,你可能最终会看到类似 `curl: (56) The requested URL returned error: 403` 的错误,这通常是由于 GitHub 限制导致的。
你可以通过在命令中添加 `--debug` 来验证,会看到类似 `[DEBU] Running command (no output) : curl -sfSL "https://api.github.com/repos/openssl/openssl/releases"` 的输出。
要解决这个问题,可以在 GitHub 上 [创建](https://github.com/settings/tokens) 一个个人访问令牌,并将其设置为环境变量 `GITHUB_TOKEN=<XXX>`
如果确认地址确实无法正常访问,可以提交 Issue 或 PR 更新地址或下载类型。
## Doctor 无法修复某些问题
在绝大部分情况下doctor 模块都可以对缺失的系统环境进行自动修复和安装,但也存在特殊的环境无法正常使用自动修复功能。
部分项目由于系统局限(如 Windows 下无法自动安装 Visual Studio 等软件),无法使用自动修复功能。
在遇到无法自动修复功能时,如果遇到 `Some check items can not be fixed` 字样,则表明无法自动修复,请根据终端显示的方法提交 Issue 或自行修复环境
由于系统限制(例如,Windows 下无法自动安装 Visual Studio 等软件),自动修复功能无法用于某些项目
在遇到无法自动修复功能时,如果遇到 `Some check items can not be fixed` 字样,则表明无法自动修复。
请根据终端显示的方法提交 Issue 或自行修复环境。
## 编译错误
遇到编译错误时,如果没有开启 `--debug` 日志,请先开启调试日志,然后确定报错的命令。
报错的终端输出对于修复编译错误非常重要,请在提交 Issue 时一并将终端日志的最后报错片段(或整个终端日志输出)上传,并且包含使用的 `spc` 命令和参数
报错的终端输出对于修复编译错误非常重要。
在提交 Issue 时,请上传终端日志的最后报错片段(或整个终端日志输出),并且包含使用的 `spc` 命令和参数。
如果你是重复构建,请参考 [本地构建 - 多次构建](./manual-build#多次构建) 章节。

View File

@@ -3,18 +3,140 @@
layout: home
hero:
name: "static-php-cli"
name: "Static PHP"
tagline: "在 Linux、macOS、FreeBSD、Windows 上与 PHP 项目一起构建独立的 PHP 二进制文件,并包含流行的扩展。"
image:
src: /images/static-php_nobg.png
alt: Static PHP CLI Logo
actions:
- theme: brand
text: 指南
text: 开始使用
link: ./guide/
features:
- title: 静态二进制
details: 您可以轻松地编译一个独立的 PHP 二进制文件以供嵌入程序使用包括 cli、fpm、micro
- title: phpmicro 自执行二进制
details: 您可以使用 micro SAPI 编译一个自解压的可执行文件,并将 PHP 代码与二进制文件打包为一个文件
- title: 依赖管理
details: static-php-cli 附带依赖项管理,支持安装不同类型的 PHP 扩展和不同的依赖库
- title: 静态 CLI 二进制
details: 您可以轻松地编译一个独立的 PHP 二进制文件以供通用使用包括 CLI、FPM SAPI
- title: Micro 自解压可执行文件
details: 您可以编译一个自解压的可执行文件,并将 PHP 代码与二进制文件打包在一起
- title: 依赖管理
details: static-php-cli 附带依赖项管理,支持安装不同类型的 PHP 扩展。
---
<script setup>
import {VPSponsors} from "vitepress/theme";
import Contributors from '../.vitepress/components/Contributors.vue';
const sponsors = [
{ name: 'Beyond Code', img: '/images/beyondcode-seeklogo.png', url: 'https://beyondco.de/' },
{ name: 'NativePHP', img: '/images/nativephp-logo.svg', url: 'https://nativephp.com/' },
];
</script>
<div class="sponsors-section">
<div class="sponsors-header">
<h2>特别赞助商</h2>
<p class="sponsors-description">
感谢我们出色的赞助商对本项目的支持!
</p>
</div>
<VPSponsors :data="sponsors"/>
</div>
<style scoped>
.sponsors-section {
margin: 48px auto;
padding: 32px 24px;
max-width: 1152px;
background: linear-gradient(135deg, var(--vp-c-bg-soft) 0%, var(--vp-c-bg) 100%);
border-radius: 16px;
border: 1px solid var(--vp-c-divider);
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
transition: all 0.3s ease;
}
.sponsors-section:hover {
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
transform: translateY(-2px);
}
.sponsors-header {
text-align: center;
margin-bottom: 24px;
}
.sponsors-header h2 {
font-size: 1.5rem;
font-weight: 700;
margin: 0 0 8px 0;
background: linear-gradient(120deg, var(--vp-c-brand-1), var(--vp-c-brand-2));
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}
.sponsors-description {
font-size: 0.95rem;
color: var(--vp-c-text-2);
margin: 0;
line-height: 1.5;
}
@media (max-width: 768px) {
.sponsors-section {
margin: 32px 16px;
padding: 24px 16px;
}
.sponsors-header h2 {
font-size: 1.25rem;
}
.sponsors-description {
font-size: 0.9rem;
}
}
/* Hero logo styling */
:deep(.VPImage.image-src) {
border-radius: 20px;
background: linear-gradient(135deg, var(--vp-c-bg-soft) 0%, var(--vp-c-default-soft) 100%);
padding: 40px;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
transition: all 0.3s ease;
}
:deep(.VPImage.image-src:hover) {
transform: translateY(-4px);
box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}
/* Dark mode adjustments for logo */
.dark :deep(.VPImage.image-src) {
background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
opacity: 0.9;
}
.dark :deep(.VPImage.image-src:hover) {
opacity: 1;
box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7);
}
/* Additional styling for the logo image itself */
:deep(.VPImage.image-src img) {
max-height: 280px;
width: auto;
}
@media (max-width: 768px) {
:deep(.VPImage.image-src) {
padding: 24px;
}
:deep(.VPImage.image-src img) {
max-height: 200px;
}
}
</style>
<Contributors />

View File

@@ -5,7 +5,7 @@
"docs:preview": "vitepress preview docs"
},
"devDependencies": {
"vitepress": "^1.0.0-rc.35",
"vitepress": "^2.0.0-alpha.5",
"vue": "^3.2.47"
}
}

View File

@@ -4,15 +4,17 @@ parameters:
paths:
- ./src/
ignoreErrors:
- '#Constant .* not found#'
- '#Unsafe usage of new static#'
- '#class Fiber#'
- '#Attribute class JetBrains\\PhpStorm\\ArrayShape does not exist#'
- '#Function Swoole\\Coroutine\\run not found.#'
- '#Static call to instance method ZM\\Logger\\ConsoleColor#'
- '#Constant GNU_ARCH not found#'
dynamicConstantNames:
- PHP_OS_FAMILY
excludePaths:
analyseAndScan:
- ./src/globals/ext-tests/decimal.php
- ./src/globals/ext-tests/swoole.php
- ./src/globals/ext-tests/swoole.phpt
- ./src/globals/test-extensions.php
- ./src/globals/test-extensions.php

9
phpunit.xml.dist Normal file
View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8" ?>
<phpunit
bootstrap="tests/bootstrap.php"
>
<php>
<env name="SPC_IGNORE_BAD_HASH" value="yes" force="true" />
<env name="SPC_SKIP_TOOLCHAIN_CHECK" value="yes" force="true" />
</php>
</phpunit>

View File

@@ -4,22 +4,28 @@ declare(strict_types=1);
namespace SPC;
use SPC\command\BuildCliCommand;
use SPC\command\BuildLibsCommand;
use SPC\command\BuildPHPCommand;
use SPC\command\CraftCommand;
use SPC\command\DeleteDownloadCommand;
use SPC\command\dev\AllExtCommand;
use SPC\command\dev\EnvCommand;
use SPC\command\dev\ExtVerCommand;
use SPC\command\dev\GenerateExtDepDocsCommand;
use SPC\command\dev\GenerateExtDocCommand;
use SPC\command\dev\GenerateLibDepDocsCommand;
use SPC\command\dev\LibVerCommand;
use SPC\command\dev\PackLibCommand;
use SPC\command\dev\PhpVerCommand;
use SPC\command\dev\SortConfigCommand;
use SPC\command\DoctorCommand;
use SPC\command\DownloadCommand;
use SPC\command\DumpExtensionsCommand;
use SPC\command\DumpLicenseCommand;
use SPC\command\ExtractCommand;
use SPC\command\InstallPkgCommand;
use SPC\command\MicroCombineCommand;
use SPC\command\SPCConfigCommand;
use SPC\command\SwitchPhpVersionCommand;
use Symfony\Component\Console\Application;
@@ -28,16 +34,21 @@ use Symfony\Component\Console\Application;
*/
final class ConsoleApplication extends Application
{
public const VERSION = '2.3.2';
public const string VERSION = '2.8.6';
public function __construct()
{
parent::__construct('static-php-cli', self::VERSION);
// Define internal env vars and constants
require_once ROOT_DIR . '/src/globals/internal-env.php';
$this->addCommands(
[
// Craft command
new CraftCommand(),
// Common commands
new BuildCliCommand(),
new BuildPHPCommand(),
new BuildLibsCommand(),
new DoctorCommand(),
new DownloadCommand(),
@@ -47,6 +58,8 @@ final class ConsoleApplication extends Application
new ExtractCommand(),
new MicroCombineCommand(),
new SwitchPhpVersionCommand(),
new SPCConfigCommand(),
new DumpExtensionsCommand(),
// Dev commands
new AllExtCommand(),
@@ -55,7 +68,10 @@ final class ConsoleApplication extends Application
new ExtVerCommand(),
new SortConfigCommand(),
new GenerateExtDocCommand(),
new GenerateExtDepDocsCommand(),
new GenerateLibDepDocsCommand(),
new PackLibCommand(),
new EnvCommand(),
]
);
}

View File

@@ -4,14 +4,16 @@ declare(strict_types=1);
namespace SPC\builder;
use SPC\exception\ExceptionHandler;
use SPC\exception\FileSystemException;
use SPC\exception\RuntimeException;
use SPC\exception\BuildFailureException;
use SPC\exception\InterruptException;
use SPC\exception\WrongUsageException;
use SPC\store\Config;
use SPC\store\FileSystem;
use SPC\store\LockFile;
use SPC\store\pkg\GoXcaddy;
use SPC\store\SourceManager;
use SPC\util\CustomExt;
use SPC\store\SourcePatcher;
use SPC\util\AttributeMapper;
abstract class BuilderBase
{
@@ -24,6 +26,12 @@ abstract class BuilderBase
/** @var array<string, Extension> extensions */
protected array $exts = [];
/** @var array<int, string> extension names */
protected array $ext_list = [];
/** @var array<int, string> all libraries being built (resolved dep list) */
protected array $lib_list = [];
/** @var bool compile libs only (just mark it) */
protected bool $libs_only = false;
@@ -36,33 +44,30 @@ abstract class BuilderBase
/**
* Convert libraries to class
*
* @param array<string> $sorted_libraries Libraries to build (if not empty, must sort first)
* @throws FileSystemException
* @throws RuntimeException
* @throws WrongUsageException
* @param array<string> $sorted_libraries Libraries to build (if not empty, must sort first)
*
* @internal
*/
abstract public function proveLibs(array $sorted_libraries);
/**
* Set-Up libraries
*
* @throws FileSystemException
* @throws RuntimeException
* @throws WrongUsageException
*/
public function setupLibs(): void
{
// build all libs
foreach ($this->libs as $lib) {
$starttime = microtime(true);
match ($lib->setup($this->getOption('rebuild', false))) {
$status = $lib->setup($this->getOption('rebuild', false));
match ($status) {
LIB_STATUS_OK => logger()->info('lib [' . $lib::NAME . '] setup success, took ' . round(microtime(true) - $starttime, 2) . ' s'),
LIB_STATUS_ALREADY => logger()->notice('lib [' . $lib::NAME . '] already built'),
LIB_STATUS_BUILD_FAILED => logger()->error('lib [' . $lib::NAME . '] build failed'),
LIB_STATUS_INSTALL_FAILED => logger()->error('lib [' . $lib::NAME . '] install failed'),
default => logger()->warning('lib [' . $lib::NAME . '] build status unknown'),
};
if (in_array($status, [LIB_STATUS_BUILD_FAILED, LIB_STATUS_INSTALL_FAILED])) {
throw new BuildFailureException('Library [' . $lib::NAME . '] setup failed.');
}
}
}
@@ -115,33 +120,12 @@ abstract class BuilderBase
*
* @return Extension[]
*/
public function getExts(): array
public function getExts(bool $including_shared = true): array
{
return $this->exts;
}
/**
* Check if there is a cpp extensions or libraries.
*
* @throws FileSystemException
* @throws WrongUsageException
*/
public function hasCpp(): bool
{
// judge cpp-extension
$exts = array_keys($this->getExts());
foreach ($exts as $ext) {
if (Config::getExt($ext, 'cpp-extension', false) === true) {
return true;
}
if ($including_shared) {
return $this->exts;
}
$libs = array_keys($this->getLibs());
foreach ($libs as $lib) {
if (Config::getLib($lib, 'cpp-library', false) === true) {
return true;
}
}
return false;
return array_filter($this->exts, fn ($ext) => $ext->isBuildStatic());
}
/**
@@ -157,29 +141,51 @@ abstract class BuilderBase
/**
* Verify the list of "ext" extensions for validity and declare an Extension object to check the dependencies of the extensions.
*
* @throws FileSystemException
* @throws RuntimeException
* @throws \ReflectionException
* @throws WrongUsageException
* @internal
*/
public function proveExts(array $extensions, bool $skip_check_deps = false): void
public function proveExts(array $static_extensions, array $shared_extensions = [], bool $skip_check_deps = false, bool $skip_extract = false, int $build_target = BUILD_TARGET_NONE): void
{
CustomExt::loadCustomExt();
$this->emitPatchPoint('before-php-extract');
SourceManager::initSource(sources: ['php-src']);
$this->emitPatchPoint('after-php-extract');
if ($this->getPHPVersionID() >= 80000) {
$this->emitPatchPoint('before-micro-extract');
SourceManager::initSource(sources: ['micro']);
$this->emitPatchPoint('after-micro-extract');
// judge ext
foreach ($static_extensions as $ext) {
// if extension does not support static build, throw exception
if (!in_array('static', Config::getExtTarget($ext))) {
throw new WrongUsageException('Extension [' . $ext . '] does not support static build!');
}
}
$this->emitPatchPoint('before-exts-extract');
SourceManager::initSource(exts: $extensions);
$this->emitPatchPoint('after-exts-extract');
foreach ($extensions as $extension) {
$class = CustomExt::getExtClass($extension);
foreach ($shared_extensions as $ext) {
// if extension does not support shared build, throw exception
if (!in_array('shared', Config::getExtTarget($ext)) && !in_array($ext, $shared_extensions)) {
throw new WrongUsageException('Extension [' . $ext . '] does not support shared build!');
}
}
if (!$skip_extract) {
$this->emitPatchPoint('before-php-extract');
SourceManager::initSource(sources: ['php-src'], source_only: true);
$this->emitPatchPoint('after-php-extract');
if ($this->getPHPVersionID() >= 80000) {
$this->emitPatchPoint('before-micro-extract');
SourceManager::initSource(sources: ['micro'], source_only: true);
$this->emitPatchPoint('after-micro-extract');
}
$this->emitPatchPoint('before-exts-extract');
SourceManager::initSource(exts: [...$static_extensions, ...$shared_extensions]);
$this->emitPatchPoint('after-exts-extract');
// patch micro
if (($build_target & BUILD_TARGET_MICRO) === BUILD_TARGET_MICRO) {
SourcePatcher::patchMicro();
}
}
foreach ([...$static_extensions, ...$shared_extensions] as $extension) {
$class = AttributeMapper::getExtensionClassByName($extension) ?? Extension::class;
/** @var Extension $ext */
$ext = new $class($extension, $this);
if (in_array($extension, $static_extensions)) {
$ext->setBuildStatic();
}
if (in_array($extension, $shared_extensions)) {
$ext->setBuildShared();
}
$this->addExt($ext);
}
@@ -187,9 +193,10 @@ abstract class BuilderBase
return;
}
foreach ($this->exts as $ext) {
foreach ($this->getExts() as $ext) {
$ext->checkDependency();
}
$this->ext_list = [...$static_extensions, ...$shared_extensions];
}
/**
@@ -199,19 +206,65 @@ abstract class BuilderBase
*/
abstract public function buildPHP(int $build_target = BUILD_TARGET_NONE);
/**
* Test PHP
*/
abstract public function testPHP(int $build_target = BUILD_TARGET_NONE);
/**
* Build shared extensions.
*/
public function buildSharedExts(): void
{
$lines = file(BUILD_BIN_PATH . '/php-config');
$extension_dir_line = null;
foreach ($lines as $key => $value) {
if (str_starts_with($value, 'extension_dir=')) {
$lines[$key] = 'extension_dir="' . BUILD_MODULES_PATH . '"' . PHP_EOL;
$extension_dir_line = $value;
break;
}
}
file_put_contents(BUILD_BIN_PATH . '/php-config', implode('', $lines));
FileSystem::replaceFileStr(BUILD_LIB_PATH . '/php/build/phpize.m4', 'test "[$]$1" = "no" && $1=yes', '# test "[$]$1" = "no" && $1=yes');
FileSystem::createDir(BUILD_MODULES_PATH);
try {
foreach ($this->getExts() as $ext) {
if (!$ext->isBuildShared()) {
continue;
}
$ext->buildShared();
}
} finally {
FileSystem::replaceFileLineContainsString(BUILD_BIN_PATH . '/php-config', 'extension_dir=', $extension_dir_line);
}
FileSystem::replaceFileLineContainsString(BUILD_BIN_PATH . '/php-config', 'extension_dir=', $extension_dir_line);
FileSystem::replaceFileStr(BUILD_LIB_PATH . '/php/build/phpize.m4', '# test "[$]$1" = "no" && $1=yes', 'test "[$]$1" = "no" && $1=yes');
}
/**
* Generate extension enable arguments for configure.
* e.g. --enable-mbstring
*
* @throws FileSystemException
* @throws WrongUsageException
*/
public function makeExtensionArgs(): string
public function makeStaticExtensionArgs(): string
{
$ret = [];
foreach ($this->exts as $ext) {
logger()->info($ext->getName() . ' is using ' . $ext->getConfigureArg());
$ret[] = trim($ext->getConfigureArg());
foreach ($this->getExts() as $ext) {
$arg = null;
if ($ext->isBuildShared() && !$ext->isBuildStatic()) {
if (
(Config::getExt($ext->getName(), 'type') === 'builtin' &&
!file_exists(SOURCE_PATH . '/php-src/ext/' . $ext->getName() . '/config.m4')) ||
Config::getExt($ext->getName(), 'build-with-php') === true
) {
$arg = $ext->getConfigureArg(true);
} else {
continue;
}
}
$arg ??= $ext->getConfigureArg();
logger()->info($ext->getName() . ' is using ' . $arg);
$ret[] = trim($arg);
}
logger()->debug('Using configure: ' . implode(' ', $ret));
return implode(' ', $ret);
@@ -227,9 +280,6 @@ abstract class BuilderBase
/**
* Get PHP Version ID from php-src/main/php_version.h
*
* @throws RuntimeException
* @throws WrongUsageException
*/
public function getPHPVersionID(): int
{
@@ -242,20 +292,25 @@ abstract class BuilderBase
return intval($match[1]);
}
throw new RuntimeException('PHP version file format is malformed, please remove it and download again');
throw new WrongUsageException('PHP version file format is malformed, please remove "./source/php-src" dir and download/extract again');
}
public function getPHPVersion(): string
public function getPHPVersion(bool $exception_on_failure = true): string
{
if (!file_exists(SOURCE_PATH . '/php-src/main/php_version.h')) {
if (!$exception_on_failure) {
return 'unknown';
}
throw new WrongUsageException('PHP source files are not available, you need to download them first');
}
$file = file_get_contents(SOURCE_PATH . '/php-src/main/php_version.h');
if (preg_match('/PHP_VERSION "(.*)"/', $file, $match) !== 0) {
return $match[1];
}
throw new RuntimeException('PHP version file format is malformed, please remove it and download again');
if (!$exception_on_failure) {
return 'unknown';
}
throw new WrongUsageException('PHP version file format is malformed, please remove it and download again');
}
/**
@@ -266,17 +321,13 @@ abstract class BuilderBase
public function getPHPVersionFromArchive(?string $file = null): false|string
{
if ($file === null) {
$lock = file_exists(DOWNLOAD_PATH . '/.lock.json') ? file_get_contents(DOWNLOAD_PATH . '/.lock.json') : false;
if ($lock === false) {
return false;
}
$lock = json_decode($lock, true);
$file = $lock['php-src']['filename'] ?? null;
if ($file === null) {
$lock = LockFile::get('php-src');
if ($lock === null) {
return false;
}
$file = LockFile::getLockFullPath($lock);
}
if (preg_match('/php-(\d+\.\d+\.\d+)/', $file, $match)) {
if (preg_match('/php-(\d+\.\d+\.\d+(?:RC\d+|alpha\d+|beta\d+)?)\.tar\.(?:gz|bz2|xz)/', $file, $match)) {
return $match[1];
}
return false;
@@ -320,6 +371,12 @@ abstract class BuilderBase
if (($type & BUILD_TARGET_EMBED) === BUILD_TARGET_EMBED) {
$ls[] = 'embed';
}
if (($type & BUILD_TARGET_FRANKENPHP) === BUILD_TARGET_FRANKENPHP) {
$ls[] = 'frankenphp';
}
if (($type & BUILD_TARGET_CGI) === BUILD_TARGET_CGI) {
$ls[] = 'cgi';
}
return implode(', ', $ls);
}
@@ -388,7 +445,7 @@ abstract class BuilderBase
foreach ($this->libs as $lib) {
$lib->validate();
}
foreach ($this->exts as $ext) {
foreach ($this->getExts() as $ext) {
$ext->validate();
}
}
@@ -403,42 +460,43 @@ abstract class BuilderBase
foreach ($patches as $patch) {
try {
if (!file_exists($patch)) {
throw new RuntimeException("Additional patch script file {$patch} not found!");
throw new WrongUsageException("Additional patch script file {$patch} not found!");
}
logger()->debug('Running additional patch script: ' . $patch);
require $patch;
} catch (InterruptException $e) {
if ($e->getCode() === 0) {
logger()->notice('Patch script ' . $patch . ' interrupted' . ($e->getMessage() ? (': ' . $e->getMessage()) : '.'));
} else {
logger()->error('Patch script ' . $patch . ' interrupted with error code [' . $e->getCode() . ']' . ($e->getMessage() ? (': ' . $e->getMessage()) : '.'));
}
exit($e->getCode());
} catch (\Throwable $e) {
logger()->critical('Patch script ' . $patch . ' failed to run.');
if ($this->getOption('debug')) {
ExceptionHandler::getInstance()->handle($e);
} else {
logger()->critical('Please check with --debug option to see more details.');
}
throw $e;
}
}
}
/**
* Check if all libs are downloaded.
* If not, throw exception.
*
* @throws RuntimeException
*/
protected function checkLibsSource(): void
public function checkBeforeBuildPHP(int $rule): void
{
$not_downloaded = [];
foreach ($this->libs as $lib) {
if (!file_exists($lib->getSourceDir())) {
$not_downloaded[] = $lib::NAME;
if (($rule & BUILD_TARGET_FRANKENPHP) === BUILD_TARGET_FRANKENPHP) {
if (!$this->getOption('enable-zts')) {
throw new WrongUsageException('FrankenPHP SAPI requires ZTS enabled PHP, build with `--enable-zts`!');
}
// frankenphp doesn't support windows, BSD is currently not supported by static-php-cli
if (!in_array(PHP_OS_FAMILY, ['Linux', 'Darwin'])) {
throw new WrongUsageException('FrankenPHP SAPI is only available on Linux and macOS!');
}
// frankenphp needs package go-xcaddy installed
if (!GoXcaddy::isInstalled()) {
global $argv;
throw new WrongUsageException("FrankenPHP SAPI requires the go-xcaddy package, please install it first: {$argv[0]} install-pkg go-xcaddy");
}
// frankenphp needs libxml2 lib on macos, see: https://github.com/php/frankenphp/blob/main/frankenphp.go#L17
if (PHP_OS_FAMILY === 'Darwin' && !$this->getLib('libxml2')) {
throw new WrongUsageException('FrankenPHP SAPI for macOS requires libxml2 library, please include the `xml` extension in your build.');
}
}
if ($not_downloaded !== []) {
throw new RuntimeException(
'"' . implode(', ', $not_downloaded) .
'" totally ' . count($not_downloaded) .
' source' . (count($not_downloaded) === 1 ? '' : 's') .
' not downloaded, maybe you need to "fetch" ' . (count($not_downloaded) === 1 ? 'it' : 'them') . ' first?'
);
}
}
@@ -449,7 +507,7 @@ abstract class BuilderBase
{
$php = "<?php\n\necho '[micro-test-start]' . PHP_EOL;\n";
foreach ($this->getExts() as $ext) {
foreach ($this->getExts(false) as $ext) {
$ext_name = $ext->getDistName();
if (!empty($ext_name)) {
$php .= "echo 'Running micro with {$ext_name} test' . PHP_EOL;\n";

View File

@@ -8,8 +8,7 @@ use SPC\builder\freebsd\BSDBuilder;
use SPC\builder\linux\LinuxBuilder;
use SPC\builder\macos\MacOSBuilder;
use SPC\builder\windows\WindowsBuilder;
use SPC\exception\FileSystemException;
use SPC\exception\RuntimeException;
use SPC\exception\ExceptionHandler;
use SPC\exception\WrongUsageException;
use Symfony\Component\Console\Input\InputInterface;
@@ -20,11 +19,6 @@ class BuilderProvider
{
private static ?BuilderBase $builder = null;
/**
* @throws FileSystemException
* @throws RuntimeException
* @throws WrongUsageException
*/
public static function makeBuilderByInput(InputInterface $input): BuilderBase
{
ini_set('memory_limit', '4G');
@@ -36,12 +30,13 @@ class BuilderProvider
'BSD' => new BSDBuilder($input->getOptions()),
default => throw new WrongUsageException('Current OS "' . PHP_OS_FAMILY . '" is not supported yet'),
};
// bind the builder to ExceptionHandler
ExceptionHandler::bindBuilder(self::$builder);
return self::$builder;
}
/**
* @throws WrongUsageException
*/
public static function getBuilder(): BuilderBase
{
if (self::$builder === null) {

View File

@@ -4,71 +4,88 @@ declare(strict_types=1);
namespace SPC\builder;
use SPC\exception\FileSystemException;
use SPC\exception\RuntimeException;
use SPC\builder\unix\UnixBuilderBase;
use SPC\exception\EnvironmentException;
use SPC\exception\SPCException;
use SPC\exception\ValidationException;
use SPC\exception\WrongUsageException;
use SPC\store\Config;
use SPC\store\FileSystem;
use SPC\toolchain\ToolchainManager;
use SPC\toolchain\ZigToolchain;
use SPC\util\GlobalEnvManager;
use SPC\util\SPCConfigUtil;
class Extension
{
protected array $dependencies = [];
/**
* @throws FileSystemException
* @throws RuntimeException
* @throws WrongUsageException
*/
protected bool $build_shared = false;
protected bool $build_static = false;
protected string $source_dir;
public function __construct(protected string $name, protected BuilderBase $builder)
{
$ext_type = Config::getExt($this->name, 'type');
$unix_only = Config::getExt($this->name, 'unix-only', false);
$windows_only = Config::getExt($this->name, 'windows-only', false);
if (PHP_OS_FAMILY !== 'Windows' && $windows_only) {
throw new RuntimeException("{$ext_type} extension {$name} is not supported on Linux and macOS platform");
throw new EnvironmentException("{$ext_type} extension {$name} is not supported on Linux and macOS platform");
}
if (PHP_OS_FAMILY === 'Windows' && $unix_only) {
throw new RuntimeException("{$ext_type} extension {$name} is not supported on Windows platform");
throw new EnvironmentException("{$ext_type} extension {$name} is not supported on Windows platform");
}
// set source_dir for builtin
if ($ext_type === 'builtin') {
$this->source_dir = SOURCE_PATH . '/php-src/ext/' . $this->name;
} elseif ($ext_type === 'external') {
$source = Config::getExt($this->name, 'source');
if ($source === null) {
throw new ValidationException("{$ext_type} extension {$name} source not found", validation_module: "Extension [{$name}] loader");
}
$source_path = Config::getSource($source)['path'] ?? null;
$source_path = $source_path === null ? SOURCE_PATH . '/' . $source : SOURCE_PATH . '/' . $source_path;
$this->source_dir = $source_path;
} else {
$this->source_dir = SOURCE_PATH . '/php-src';
}
}
public function getFrameworks(): array
{
return Config::getExt($this->getName(), 'frameworks', []);
}
/**
* 获取开启该扩展的 PHP 编译添加的参数
*
* @throws FileSystemException
* @throws WrongUsageException
*/
public function getConfigureArg(): string
public function getConfigureArg(bool $shared = false): string
{
$arg = $this->getEnableArg();
switch (PHP_OS_FAMILY) {
case 'Windows':
$arg .= $this->getWindowsConfigureArg();
break;
case 'Darwin':
case 'Linux':
case 'BSD':
$arg .= $this->getUnixConfigureArg();
break;
}
return $arg;
return match (PHP_OS_FAMILY) {
'Windows' => $this->getWindowsConfigureArg($shared),
'Darwin',
'Linux',
'BSD' => $this->getUnixConfigureArg($shared),
default => throw new WrongUsageException(PHP_OS_FAMILY . ' build is not supported yet'),
};
}
/**
* 根据 ext 的 arg-type 获取对应开启的参数,一般都是 --enable-xxx 和 --with-xxx
*
* @throws FileSystemException
* @throws WrongUsageException
*/
public function getEnableArg(): string
public function getEnableArg(bool $shared = false): string
{
$escapedPath = str_replace("'", '', escapeshellarg(BUILD_ROOT_PATH)) !== BUILD_ROOT_PATH || str_contains(BUILD_ROOT_PATH, ' ') ? escapeshellarg(BUILD_ROOT_PATH) : BUILD_ROOT_PATH;
$_name = str_replace('_', '-', $this->name);
return match ($arg_type = Config::getExt($this->name, 'arg-type', 'enable')) {
'enable' => '--enable-' . $_name . ' ',
'with' => '--with-' . $_name . ' ',
'with-prefix' => '--with-' . $_name . '="' . BUILD_ROOT_PATH . '" ',
'enable' => '--enable-' . $_name . ($shared ? '=shared' : '') . ' ',
'enable-path' => '--enable-' . $_name . '=' . ($shared ? 'shared,' : '') . $escapedPath . ' ',
'with' => '--with-' . $_name . ($shared ? '=shared' : '') . ' ',
'with-path' => '--with-' . $_name . '=' . ($shared ? 'shared,' : '') . $escapedPath . ' ',
'none', 'custom' => '',
default => throw new WrongUsageException("argType does not accept {$arg_type}, use [enable/with/with-prefix] ."),
default => throw new WrongUsageException("argType does not accept {$arg_type}, use [enable/with/with-path] ."),
};
}
@@ -81,15 +98,12 @@ class Extension
fn ($x) => $x->getStaticLibFiles(),
$this->getLibraryDependencies(recursive: true)
);
return implode(' ', $ret);
$libs = implode(' ', $ret);
return deduplicate_flags($libs);
}
/**
* 检查下依赖就行了,作用是导入依赖给 Extension 对象,今后可以对库依赖进行选择性处理
*
* @throws RuntimeException
* @throws FileSystemException
* @throws WrongUsageException
*/
public function checkDependency(): static
{
@@ -126,20 +140,21 @@ class Extension
return $this->name;
}
public function getWindowsConfigureArg(): string
public function getWindowsConfigureArg(bool $shared = false): string
{
return '';
return $this->getEnableArg();
// Windows is not supported yet
}
public function getUnixConfigureArg(): string
public function getUnixConfigureArg(bool $shared = false): string
{
return '';
return $this->getEnableArg($shared);
}
/**
* Patch code before ./buildconf
* If you need to patch some code, overwrite this and return true
* If you need to patch some code, overwrite this
* return true if you patched something, false if not
*/
public function patchBeforeBuildconf(): bool
{
@@ -148,16 +163,26 @@ class Extension
/**
* Patch code before ./configure
* If you need to patch some code, overwrite this and return true
* If you need to patch some code, overwrite this
* return true if you patched something, false if not
*/
public function patchBeforeConfigure(): bool
{
return false;
}
/**
* Patch code before ./configure.bat for Windows
*/
public function patchBeforeWindowsConfigure(): bool
{
return false;
}
/**
* Patch code before make
* If you need to patch some code, overwrite this and return true
* If you need to patch some code, overwrite this
* return true if you patched something, false if not
*/
public function patchBeforeMake(): bool
{
@@ -165,16 +190,116 @@ class Extension
}
/**
* @throws RuntimeException
* Patch code before shared extension phpize
* If you need to patch some code, overwrite this
* return true if you patched something, false if not
*/
public function patchBeforeSharedPhpize(): bool
{
return false;
}
/**
* Patch code before shared extension ./configure
* If you need to patch some code, overwrite this
* return true if you patched something, false if not
*/
public function patchBeforeSharedConfigure(): bool
{
return false;
}
/**
* Patch code before shared extension make
* If you need to patch some code, overwrite this
* return true if you patched something, false if not
*/
public function patchBeforeSharedMake(): bool
{
$config = (new SPCConfigUtil($this->builder))->getExtensionConfig($this);
[$staticLibs, $sharedLibs] = $this->splitLibsIntoStaticAndShared($config['libs']);
$lstdcpp = str_contains($sharedLibs, '-l:libstdc++.a') ? '-l:libstdc++.a' : null;
$lstdcpp ??= str_contains($sharedLibs, '-lstdc++') ? '-lstdc++' : '';
$makefileContent = file_get_contents($this->source_dir . '/Makefile');
if (preg_match('/^(.*_SHARED_LIBADD\s*=\s*)(.*)$/m', $makefileContent, $matches)) {
$prefix = $matches[1];
$currentLibs = trim($matches[2]);
$newLibs = clean_spaces("{$currentLibs} {$staticLibs} {$lstdcpp}");
$deduplicatedLibs = deduplicate_flags($newLibs);
FileSystem::replaceFileRegex(
$this->source_dir . '/Makefile',
'/^(.*_SHARED_LIBADD\s*=.*)$/m',
$prefix . $deduplicatedLibs
);
}
return true;
}
/**
* @return string
* returns a command line string with all required shared extensions to load
* i.e.; pdo_pgsql would return:
*
* `-d "extension=pgsql" -d "extension=pdo_pgsql"`
*/
public function getSharedExtensionLoadString(): string
{
$loaded = [];
$order = [];
$resolve = function ($extension) use (&$resolve, &$loaded, &$order) {
if (!$extension instanceof Extension) {
return;
}
if (isset($loaded[$extension->getName()])) {
return;
}
$loaded[$extension->getName()] = true;
foreach ($extension->dependencies as $dependency) {
$resolve($dependency);
}
$order[] = $extension;
};
$resolve($this);
$ret = '';
foreach ($order as $ext) {
if ($ext instanceof self && $ext->isBuildShared()) {
if (Config::getExt($ext->getName(), 'type', false) === 'addon') {
continue;
}
if (Config::getExt($ext->getName(), 'zend-extension', false) === true) {
$ret .= " -d \"zend_extension={$ext->getName()}\"";
} else {
$ret .= " -d \"extension={$ext->getName()}\"";
}
}
}
if ($ret !== '') {
$ret = ' -d "extension_dir=' . BUILD_MODULES_PATH . '"' . $ret;
}
return $ret;
}
public function runCliCheckUnix(): void
{
// Run compile check if build target is cli
// If you need to run some check, overwrite this or add your assert in src/globals/ext-tests/{extension_name}.php
// If check failed, throw RuntimeException
[$ret] = shell()->execWithResult(BUILD_ROOT_PATH . '/bin/php --ri "' . $this->getDistName() . '"', false);
$sharedExtensions = $this->getSharedExtensionLoadString();
[$ret] = shell()->execWithResult(BUILD_BIN_PATH . '/php -n' . $sharedExtensions . ' --ri "' . $this->getDistName() . '"');
if ($ret !== 0) {
throw new RuntimeException('extension ' . $this->getName() . ' failed compile check: php-cli returned ' . $ret);
throw new ValidationException(
"extension {$this->getName()} failed compile check: php-cli returned {$ret}",
validation_module: 'Extension ' . $this->getName() . ' sanity check'
);
}
if (file_exists(ROOT_DIR . '/src/globals/ext-tests/' . $this->getName() . '.php')) {
@@ -185,27 +310,23 @@ class Extension
file_get_contents(ROOT_DIR . '/src/globals/ext-tests/' . $this->getName() . '.php')
);
[$ret, $out] = shell()->execWithResult(BUILD_ROOT_PATH . '/bin/php -r "' . trim($test) . '"');
[$ret, $out] = shell()->execWithResult(BUILD_BIN_PATH . '/php -n' . $sharedExtensions . ' -r "' . trim($test) . '"');
if ($ret !== 0) {
if ($this->builder->getOption('debug')) {
var_dump($out);
}
throw new RuntimeException('extension ' . $this->getName() . ' failed sanity check');
throw new ValidationException(
"extension {$this->getName()} failed sanity check. Code: {$ret}, output: " . implode("\n", $out),
validation_module: 'Extension ' . $this->getName() . ' function check'
);
}
}
}
/**
* @throws RuntimeException
*/
public function runCliCheckWindows(): void
{
// Run compile check if build target is cli
// If you need to run some check, overwrite this or add your assert in src/globals/ext-tests/{extension_name}.php
// If check failed, throw RuntimeException
[$ret] = cmd()->execWithResult(BUILD_ROOT_PATH . '/bin/php.exe --ri "' . $this->getDistName() . '"', false);
[$ret] = cmd()->execWithResult(BUILD_BIN_PATH . '/php.exe -n --ri "' . $this->getDistName() . '"', false);
if ($ret !== 0) {
throw new RuntimeException('extension ' . $this->getName() . ' failed compile check: php-cli returned ' . $ret);
throw new ValidationException("extension {$this->getName()} failed compile check: php-cli returned {$ret}", validation_module: "Extension {$this->getName()} sanity check");
}
if (file_exists(FileSystem::convertPath(ROOT_DIR . '/src/globals/ext-tests/' . $this->getName() . '.php'))) {
@@ -216,9 +337,12 @@ class Extension
file_get_contents(FileSystem::convertPath(ROOT_DIR . '/src/globals/ext-tests/' . $this->getName() . '.php'))
);
[$ret] = cmd()->execWithResult(BUILD_ROOT_PATH . '/bin/php.exe -r "' . trim($test) . '"');
[$ret] = cmd()->execWithResult(BUILD_ROOT_PATH . '/bin/php.exe -n -r "' . trim($test) . '"');
if ($ret !== 0) {
throw new RuntimeException('extension ' . $this->getName() . ' failed sanity check');
throw new ValidationException(
"extension {$this->getName()} failed function check",
validation_module: "Extension {$this->getName()} function check"
);
}
}
}
@@ -228,6 +352,109 @@ class Extension
// do nothing, just throw wrong usage exception if not valid
}
/**
* Build shared extension
*/
public function buildShared(array $visited = []): void
{
try {
if (Config::getExt($this->getName(), 'type') === 'builtin' || Config::getExt($this->getName(), 'build-with-php') === true) {
if (file_exists(BUILD_MODULES_PATH . '/' . $this->getName() . '.so')) {
logger()->info('Shared extension [' . $this->getName() . '] was already built by php-src/configure (' . $this->getName() . '.so)');
return;
}
if (Config::getExt($this->getName(), 'build-with-php') === true) {
logger()->warning('Shared extension [' . $this->getName() . '] did not build with php-src/configure (' . $this->getName() . '.so)');
logger()->warning('Try deleting your build and source folders and running `spc build`` again.');
return;
}
}
if (file_exists(BUILD_MODULES_PATH . '/' . $this->getName() . '.so')) {
logger()->info('Shared extension [' . $this->getName() . '] was already built, skipping (' . $this->getName() . '.so)');
return;
}
if ((string) Config::getExt($this->getName(), 'type') === 'addon') {
return;
}
logger()->info('Building extension [' . $this->getName() . '] as shared extension (' . $this->getName() . '.so)');
foreach ($this->dependencies as $dependency) {
if (!$dependency instanceof Extension) {
continue;
}
if (!$dependency->isBuildStatic() && !in_array($dependency->getName(), $visited)) {
logger()->info('extension ' . $this->getName() . ' requires extension ' . $dependency->getName());
$dependency->buildShared([...$visited, $this->getName()]);
}
}
$this->builder->emitPatchPoint('before-shared-ext[' . $this->getName() . ']-build');
match (PHP_OS_FAMILY) {
'Darwin', 'Linux' => $this->buildUnixShared(),
default => throw new WrongUsageException(PHP_OS_FAMILY . ' build shared extensions is not supported yet'),
};
$this->builder->emitPatchPoint('after-shared-ext[' . $this->getName() . ']-build');
} catch (SPCException $e) {
$e->bindExtensionInfo(['extension_name' => $this->getName()]);
throw $e;
}
}
/**
* Build shared extension for Unix
*/
public function buildUnixShared(): void
{
$env = $this->getSharedExtensionEnv();
if ($this->patchBeforeSharedPhpize()) {
logger()->info("Extension [{$this->getName()}] patched before shared phpize");
}
// prepare configure args
shell()->cd($this->source_dir)
->setEnv($env)
->appendEnv($this->getExtraEnv())
->exec(BUILD_BIN_PATH . '/phpize');
if ($this->patchBeforeSharedConfigure()) {
logger()->info("Extension [{$this->getName()}] patched before shared configure");
}
$phpvars = getenv('SPC_EXTRA_PHP_VARS') ?: '';
shell()->cd($this->source_dir)
->setEnv($env)
->appendEnv($this->getExtraEnv())
->exec(
'./configure ' . $this->getUnixConfigureArg(true) .
' --with-php-config=' . BUILD_BIN_PATH . '/php-config ' .
"--enable-shared --disable-static {$phpvars}"
);
if ($this->patchBeforeSharedMake()) {
logger()->info("Extension [{$this->getName()}] patched before shared make");
}
shell()->cd($this->source_dir)
->setEnv($env)
->appendEnv($this->getExtraEnv())
->exec('make clean')
->exec('make -j' . $this->builder->concurrency)
->exec('make install');
// process *.so file
$soFile = BUILD_MODULES_PATH . '/' . $this->getName() . '.so';
$soDest = $soFile;
preg_match('/-release\s+(\S*)/', getenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_LDFLAGS'), $matches);
if (!empty($matches[1])) {
$soDest = str_replace('.so', '-' . $matches[1] . '.so', $soFile);
}
if (!file_exists($soFile)) {
throw new ValidationException("extension {$this->getName()} build failed: {$soFile} not found", validation_module: "Extension {$this->getName()} build");
}
/** @var UnixBuilderBase $builder */
$builder = $this->builder;
$builder->deployBinary($soFile, $soDest, false);
}
/**
* Get current extension version
*
@@ -238,39 +465,38 @@ class Extension
return null;
}
/**
* @throws RuntimeException
*/
protected function addLibraryDependency(string $name, bool $optional = false): void
public function setBuildStatic(): void
{
$depLib = $this->builder->getLib($name);
if (!$depLib) {
if (!$optional) {
throw new RuntimeException("extension {$this->name} requires library {$name}");
}
logger()->info("enabling {$this->name} without library {$name}");
} else {
$this->dependencies[] = $depLib;
if (!in_array('static', Config::getExtTarget($this->name))) {
throw new WrongUsageException("Extension [{$this->name}] does not support static build!");
}
$this->build_static = true;
}
public function setBuildShared(): void
{
if (!in_array('shared', Config::getExtTarget($this->name))) {
throw new WrongUsageException("Extension [{$this->name}] does not support shared build!");
}
$this->build_shared = true;
}
public function isBuildShared(): bool
{
return $this->build_shared;
}
public function isBuildStatic(): bool
{
return $this->build_static;
}
/**
* @throws RuntimeException
* Get the library dependencies that current extension depends on.
*
* @param bool $recursive Whether it includes dependencies recursively
*/
protected function addExtensionDependency(string $name, bool $optional = false): void
{
$depExt = $this->builder->getExt($name);
if (!$depExt) {
if (!$optional) {
throw new RuntimeException("{$this->name} requires extension {$name}");
}
logger()->info("enabling {$this->name} without extension {$name}");
} else {
$this->dependencies[] = $depExt;
}
}
private function getLibraryDependencies(bool $recursive = false): array
public function getLibraryDependencies(bool $recursive = false): array
{
$ret = array_filter($this->dependencies, fn ($x) => $x instanceof LibraryBase);
if (!$recursive) {
@@ -284,12 +510,12 @@ class Extension
$added = 0;
foreach ($ret as $depName => $dep) {
foreach ($dep->getDependencies(true) as $depdepName => $depdep) {
if (!in_array($depdepName, array_keys($deps), true)) {
if (!array_key_exists($depdepName, $deps)) {
$deps[$depdepName] = $depdep;
++$added;
}
}
if (!in_array($depName, array_keys($deps), true)) {
if (!array_key_exists($depName, $deps)) {
$deps[$depName] = $dep;
}
}
@@ -297,4 +523,91 @@ class Extension
return $deps;
}
/**
* Returns the environment variables a shared extension needs to be built.
* CFLAGS, CXXFLAGS, LDFLAGS and so on.
*/
protected function getSharedExtensionEnv(): array
{
$compiler_extra = getenv('SPC_COMPILER_EXTRA') ?: '';
if (!str_contains($compiler_extra, '-lcompiler_rt') && ToolchainManager::getToolchainClass() === ZigToolchain::class) {
$compiler_extra = trim($compiler_extra . ' -lcompiler_rt');
GlobalEnvManager::putenv("SPC_COMPILER_EXTRA={$compiler_extra}");
}
$config = (new SPCConfigUtil($this->builder, ['no_php' => true]))->getExtensionConfig($this);
[$staticLibs, $sharedLibs] = $this->splitLibsIntoStaticAndShared($config['libs']);
$preStatic = PHP_OS_FAMILY === 'Darwin' ? '' : '-Wl,--start-group ';
$postStatic = PHP_OS_FAMILY === 'Darwin' ? '' : ' -Wl,--end-group ';
$extraLd = trim((string) getenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_LDFLAGS'));
if (PHP_OS_FAMILY !== 'Darwin') {
$extraLd = trim($extraLd . ' -Wl,-Bsymbolic');
}
return [
'CFLAGS' => $config['cflags'],
'CXXFLAGS' => $config['cflags'],
'LDFLAGS' => $config['ldflags'],
'EXTRA_LDFLAGS' => $extraLd,
'LIBS' => clean_spaces("{$preStatic} {$staticLibs} {$postStatic} {$sharedLibs}"),
'LD_LIBRARY_PATH' => BUILD_LIB_PATH,
];
}
protected function addLibraryDependency(string $name, bool $optional = false): void
{
$depLib = $this->builder->getLib($name);
if (!$depLib) {
if (!$optional) {
throw new WrongUsageException("extension {$this->name} requires library {$name}");
}
logger()->info("enabling {$this->name} without library {$name}");
} else {
$this->dependencies[$name] = $depLib;
}
}
protected function addExtensionDependency(string $name, bool $optional = false): void
{
$depExt = $this->builder->getExt($name);
if (!$depExt) {
if (!$optional) {
throw new WrongUsageException("{$this->name} requires extension {$name} which is not included");
}
logger()->info("enabling {$this->name} without extension {$name}");
} else {
$this->dependencies[$name] = $depExt;
}
}
protected function getExtraEnv(): array
{
return [];
}
/**
* Splits a given string of library flags into static and shared libraries.
*
* @param string $allLibs A space-separated string of library flags (e.g., -lxyz).
* @return array an array containing two elements: the first is a space-separated string
* of static library flags, and the second is a space-separated string
* of shared library flags
*/
protected function splitLibsIntoStaticAndShared(string $allLibs): array
{
$staticLibString = '';
$sharedLibString = '';
$libs = explode(' ', $allLibs);
foreach ($libs as $lib) {
$staticLib = BUILD_LIB_PATH . '/lib' . str_replace('-l', '', $lib) . '.a';
if (str_starts_with($lib, BUILD_LIB_PATH . '/lib') && str_ends_with($lib, '.a')) {
$staticLib = $lib;
}
if ($lib === '-lphp' || !file_exists($staticLib)) {
$sharedLibString .= " {$lib}";
} else {
$staticLibString .= " {$lib}";
}
}
return [trim($staticLibString), trim($sharedLibString)];
}
}

View File

@@ -4,15 +4,20 @@ declare(strict_types=1);
namespace SPC\builder;
use SPC\exception\FileSystemException;
use SPC\exception\RuntimeException;
use SPC\exception\SPCException;
use SPC\exception\SPCInternalException;
use SPC\exception\WrongUsageException;
use SPC\store\Config;
use SPC\store\Downloader;
use SPC\store\FileSystem;
use SPC\store\LockFile;
use SPC\store\SourceManager;
use SPC\util\GlobalValueTrait;
abstract class LibraryBase
{
use GlobalValueTrait;
/** @var string */
public const NAME = 'unknown';
@@ -22,31 +27,25 @@ abstract class LibraryBase
protected bool $patched = false;
/**
* @throws RuntimeException
*/
public function __construct(?string $source_dir = null)
{
if (static::NAME === 'unknown') {
throw new RuntimeException('no unknown!!!!!');
throw new SPCInternalException('Please set the NAME constant in ' . static::class);
}
$this->source_dir = $source_dir ?? (SOURCE_PATH . '/' . static::NAME);
$this->source_dir = $source_dir ?? (SOURCE_PATH . DIRECTORY_SEPARATOR . Config::getLib(static::NAME, 'source'));
}
/**
* Try to install or build this library.
* @param bool $force If true, force install or build
* @throws FileSystemException
* @throws RuntimeException
* @throws WrongUsageException
* @param bool $force If true, force install or build
*/
public function setup(bool $force = false): int
{
$lock = json_decode(FileSystem::readFile(DOWNLOAD_PATH . '/.lock.json'), true) ?? [];
$source = Config::getLib(static::NAME, 'source');
// if source is locked as pre-built, we just tryInstall it
if (isset($lock[$source]) && ($lock[$source]['lock_as'] ?? SPC_LOCK_SOURCE) === SPC_LOCK_PRE_BUILT) {
return $this->tryInstall($lock[$source]['filename'], $force);
$pre_built_name = Downloader::getPreBuiltLockName($source);
if (($lock = LockFile::get($pre_built_name)) && $lock['lock_as'] === SPC_DOWNLOAD_PRE_BUILT) {
return $this->tryInstall($lock, $force);
}
return $this->tryBuild($force);
}
@@ -102,10 +101,6 @@ abstract class LibraryBase
/**
* Calculate dependencies for current library.
*
* @throws RuntimeException
* @throws FileSystemException
* @throws WrongUsageException
*/
public function calcDependency(): void
{
@@ -113,7 +108,7 @@ abstract class LibraryBase
/*
Rules:
If it is a Windows system, try the following dependencies in order: lib-depends-windows, lib-depends-win, lib-depends.
If it is a macOS system, try the following dependencies in order: lib-depends-darwin, lib-depends-unix, lib-depends.
If it is a macOS system, try the following dependencies in order: lib-depends-macos, lib-depends-unix, lib-depends.
If it is a Linux system, try the following dependencies in order: lib-depends-linux, lib-depends-unix, lib-depends.
*/
foreach (Config::getLib(static::NAME, 'lib-depends', []) as $dep_name) {
@@ -126,9 +121,6 @@ abstract class LibraryBase
/**
* Get config static libs.
*
* @throws FileSystemException
* @throws WrongUsageException
*/
public function getStaticLibs(): array
{
@@ -137,9 +129,6 @@ abstract class LibraryBase
/**
* Get config headers.
*
* @throws FileSystemException
* @throws WrongUsageException
*/
public function getHeaders(): array
{
@@ -147,40 +136,31 @@ abstract class LibraryBase
}
/**
* @throws WrongUsageException
* @throws FileSystemException
* Get binary files.
*/
public function tryInstall(string $install_file, bool $force_install = false): int
public function getBinaryFiles(): array
{
return Config::getLib(static::NAME, 'bin', []);
}
public function tryInstall(array $lock, bool $force_install = false): int
{
$install_file = $lock['filename'];
if ($force_install) {
logger()->info('Installing required library [' . static::NAME . '] from pre-built binaries');
// Extract files
try {
FileSystem::extractPackage($install_file, DOWNLOAD_PATH . '/' . $install_file, BUILD_ROOT_PATH);
FileSystem::extractPackage($install_file, $lock['source_type'], DOWNLOAD_PATH . '/' . $install_file, BUILD_ROOT_PATH);
$this->install();
return LIB_STATUS_OK;
} catch (FileSystemException|RuntimeException $e) {
} catch (SPCException $e) {
logger()->error('Failed to extract pre-built library [' . static::NAME . ']: ' . $e->getMessage());
return LIB_STATUS_INSTALL_FAILED;
}
}
foreach ($this->getStaticLibs() as $name) {
if (!file_exists(BUILD_LIB_PATH . "/{$name}")) {
$this->tryInstall($install_file, true);
return LIB_STATUS_OK;
}
}
foreach ($this->getHeaders() as $name) {
if (!file_exists(BUILD_INCLUDE_PATH . "/{$name}")) {
$this->tryInstall($install_file, true);
return LIB_STATUS_OK;
}
}
// pkg-config is treated specially. If it is pkg-config, check if the pkg-config binary exists
if (static::NAME === 'pkg-config' && !file_exists(BUILD_ROOT_PATH . '/bin/pkg-config')) {
$this->tryInstall($install_file, true);
return LIB_STATUS_OK;
if (!$this->isLibraryInstalled()) {
return $this->tryInstall($lock, true);
}
return LIB_STATUS_ALREADY;
}
@@ -191,10 +171,6 @@ abstract class LibraryBase
* BUILD_STATUS_OK if build success
* BUILD_STATUS_ALREADY if already built
* BUILD_STATUS_FAILED if build failed
*
* @throws RuntimeException
* @throws FileSystemException
* @throws WrongUsageException
*/
public function tryBuild(bool $force_build = false): int
{
@@ -203,56 +179,33 @@ abstract class LibraryBase
}
// force means just build
if ($force_build) {
logger()->info('Building required library [' . static::NAME . ']');
$type = Config::getLib(static::NAME, 'type', 'lib');
logger()->info('Building required ' . $type . ' [' . static::NAME . ']');
// extract first if not exists
if (!is_dir($this->source_dir)) {
$this->getBuilder()->emitPatchPoint('before-library[ ' . static::NAME . ']-extract');
SourceManager::initSource(libs: [static::NAME]);
$this->getBuilder()->emitPatchPoint('after-library[ ' . static::NAME . ']-extract');
$this->getBuilder()->emitPatchPoint('before-library[' . static::NAME . ']-extract');
SourceManager::initSource(libs: [static::NAME], source_only: true);
$this->getBuilder()->emitPatchPoint('after-library[' . static::NAME . ']-extract');
}
if (!$this->patched && $this->patchBeforeBuild()) {
file_put_contents($this->source_dir . '/.spc.patched', 'PATCHED!!!');
}
$this->getBuilder()->emitPatchPoint('before-library[ ' . static::NAME . ']-build');
$this->getBuilder()->emitPatchPoint('before-library[' . static::NAME . ']-build');
$this->build();
$this->installLicense();
$this->getBuilder()->emitPatchPoint('after-library[ ' . static::NAME . ']-build');
$this->getBuilder()->emitPatchPoint('after-library[' . static::NAME . ']-build');
return LIB_STATUS_OK;
}
// check if these libraries exist, if not, invoke compilation and return the result status
foreach ($this->getStaticLibs() as $name) {
if (!file_exists(BUILD_LIB_PATH . "/{$name}")) {
$this->tryBuild(true);
return LIB_STATUS_OK;
}
}
// header files the same
foreach ($this->getHeaders() as $name) {
if (!file_exists(BUILD_INCLUDE_PATH . "/{$name}")) {
$this->tryBuild(true);
return LIB_STATUS_OK;
}
}
// pkg-config is treated specially. If it is pkg-config, check if the pkg-config binary exists
if (static::NAME === 'pkg-config' && !file_exists(BUILD_ROOT_PATH . '/bin/pkg-config')) {
$this->tryBuild(true);
return LIB_STATUS_OK;
if (!$this->isLibraryInstalled()) {
return $this->tryBuild(true);
}
// if all the files exist at this point, skip the compilation process
return LIB_STATUS_ALREADY;
}
/**
* Patch before build, overwrite this and return true to patch libs.
*/
public function patchBeforeBuild(): bool
{
return false;
}
public function validate(): void
{
// do nothing, just throw wrong usage exception if not valid
@@ -278,22 +231,97 @@ abstract class LibraryBase
// do something before pack, default do nothing. overwrite this method to do something (e.g. modify pkg-config file)
}
/**
* Patch code before build
* If you need to patch some code, overwrite this
* return true if you patched something, false if not
*/
public function patchBeforeBuild(): bool
{
return false;
}
/**
* Patch code before ./buildconf
* If you need to patch some code, overwrite this
* return true if you patched something, false if not
*/
public function patchBeforeBuildconf(): bool
{
return false;
}
/**
* Patch code before ./configure
* If you need to patch some code, overwrite this
* return true if you patched something, false if not
*/
public function patchBeforeConfigure(): bool
{
return false;
}
/**
* Patch code before windows configure.bat
* If you need to patch some code, overwrite this
* return true if you patched something, false if not
*/
public function patchBeforeWindowsConfigure(): bool
{
return false;
}
/**
* Patch code before make
* If you need to patch some code, overwrite this
* return true if you patched something, false if not
*/
public function patchBeforeMake(): bool
{
return false;
}
/**
* Patch php-config after embed was built
* Example: imap requires -lcrypt
*/
public function patchPhpConfig(): bool
{
return false;
}
/**
* Build this library.
*
* @throws RuntimeException
*/
abstract protected function build();
protected function install(): void
{
// do something after extracting pre-built files, default do nothing. overwrite this method to do something
// replace placeholders if BUILD_ROOT_PATH/.spc-extract-placeholder.json exists
$replace_item_file = BUILD_ROOT_PATH . '/.spc-extract-placeholder.json';
if (!file_exists($replace_item_file)) {
return;
}
$replace_items = json_decode(file_get_contents($replace_item_file), true);
if (!is_array($replace_items)) {
throw new SPCInternalException("Invalid placeholder file: {$replace_item_file}");
}
$placeholders = get_pack_replace();
// replace placeholders in BUILD_ROOT_PATH
foreach ($replace_items as $item) {
$filepath = BUILD_ROOT_PATH . "/{$item}";
FileSystem::replaceFileStr(
$filepath,
array_values($placeholders),
array_keys($placeholders),
);
}
// remove placeholder file
unlink($replace_item_file);
}
/**
* Add lib dependency
*
* @throws RuntimeException
*/
protected function addLibraryDependency(string $name, bool $optional = false): void
{
@@ -303,7 +331,7 @@ abstract class LibraryBase
return;
}
if (!$optional) {
throw new RuntimeException(static::NAME . " requires library {$name}");
throw new WrongUsageException(static::NAME . " requires library {$name} but it is not included");
}
logger()->debug('enabling ' . static::NAME . " without {$name}");
}
@@ -318,20 +346,75 @@ abstract class LibraryBase
*/
protected function installLicense(): void
{
FileSystem::createDir(BUILD_ROOT_PATH . '/source-licenses/' . $this->getName());
$source = Config::getLib($this->getName(), 'source');
FileSystem::createDir(BUILD_ROOT_PATH . "/source-licenses/{$source}");
$license_files = Config::getSource($source)['license'] ?? [];
if (is_assoc_array($license_files)) {
$license_files = [$license_files];
}
foreach ($license_files as $index => $license) {
if ($license['type'] === 'text') {
FileSystem::writeFile(BUILD_ROOT_PATH . '/source-licenses/' . $this->getName() . "/{$index}.txt", $license['text']);
FileSystem::writeFile(BUILD_ROOT_PATH . "/source-licenses/{$source}/{$index}.txt", $license['text']);
continue;
}
if ($license['type'] === 'file') {
copy($this->source_dir . '/' . $license['path'], BUILD_ROOT_PATH . '/source-licenses/' . $this->getName() . "/{$index}.txt");
copy($this->source_dir . '/' . $license['path'], BUILD_ROOT_PATH . "/source-licenses/{$source}/{$index}.txt");
}
}
}
protected function isLibraryInstalled(): bool
{
if ($pkg_configs = Config::getLib(static::NAME, 'pkg-configs', [])) {
$pkg_config_path = getenv('PKG_CONFIG_PATH') ?: '';
$search_paths = array_unique(array_filter(explode(is_unix() ? ':' : ';', $pkg_config_path)));
foreach ($pkg_configs as $name) {
$found = false;
foreach ($search_paths as $path) {
if (file_exists($path . "/{$name}.pc")) {
$found = true;
break;
}
}
if (!$found) {
return false;
}
}
// allow using system dependencies if pkg_config_path is explicitly defined
if (count($search_paths) > 1) {
return true;
}
}
foreach (Config::getLib(static::NAME, 'static-libs', []) as $name) {
if (!file_exists(BUILD_LIB_PATH . "/{$name}")) {
return false;
}
}
foreach (Config::getLib(static::NAME, 'headers', []) as $name) {
if (!file_exists(BUILD_INCLUDE_PATH . "/{$name}")) {
return false;
}
}
$pkg_config_path = getenv('PKG_CONFIG_PATH') ?: '';
$search_paths = array_filter(explode(is_unix() ? ':' : ';', $pkg_config_path));
foreach (Config::getLib(static::NAME, 'pkg-configs', []) as $name) {
$found = false;
foreach ($search_paths as $path) {
if (file_exists($path . "/{$name}.pc")) {
$found = true;
break;
}
}
if (!$found) {
return false;
}
}
foreach (Config::getLib(static::NAME, 'bin', []) as $name) {
if (!file_exists(BUILD_BIN_PATH . "/{$name}")) {
return false;
}
}
return true;
}
}

View File

@@ -4,7 +4,18 @@ declare(strict_types=1);
namespace SPC\builder;
/**
* Interface for library implementations
*
* This interface defines the basic contract that all library classes must implement.
* It provides a common way to identify and work with different library types.
*/
interface LibraryInterface
{
/**
* Get the name of the library
*
* @return string The library name
*/
public function getName(): string;
}

View File

@@ -13,6 +13,7 @@ class amqp extends Extension
{
public function patchBeforeMake(): bool
{
$patched = parent::patchBeforeMake();
if (PHP_OS_FAMILY === 'Windows') {
FileSystem::replaceFileRegex(BUILD_INCLUDE_PATH . '\amqp.h', '/^#warning.*/m', '');
FileSystem::replaceFileRegex(BUILD_INCLUDE_PATH . '\amqp_framing.h', '/^#warning.*/m', '');
@@ -20,15 +21,15 @@ class amqp extends Extension
FileSystem::replaceFileRegex(BUILD_INCLUDE_PATH . '\amqp_tcp_socket.h', '/^#warning.*/m', '');
return true;
}
return false;
return $patched;
}
public function getUnixConfigureArg(): string
public function getUnixConfigureArg(bool $shared = false): string
{
return '--with-amqp --with-librabbitmq-dir=' . BUILD_ROOT_PATH;
return '--with-amqp' . ($shared ? '=shared' : '') . ' --with-librabbitmq-dir=' . BUILD_ROOT_PATH;
}
public function getWindowsConfigureArg(): string
public function getWindowsConfigureArg($shared = false): string
{
return '--with-amqp';
}

View File

@@ -6,18 +6,12 @@ namespace SPC\builder\extension;
use SPC\builder\Extension;
use SPC\builder\macos\MacOSBuilder;
use SPC\exception\FileSystemException;
use SPC\exception\WrongUsageException;
use SPC\store\FileSystem;
use SPC\util\CustomExt;
#[CustomExt('bz2')]
class bz2 extends Extension
{
/**
* @throws FileSystemException
* @throws WrongUsageException
*/
public function patchBeforeConfigure(): bool
{
$frameworks = $this->builder instanceof MacOSBuilder ? ' ' . $this->builder->getFrameworks(true) . ' ' : '';

View File

@@ -0,0 +1,21 @@
<?php
declare(strict_types=1);
namespace SPC\builder\extension;
use SPC\builder\Extension;
use SPC\util\CustomExt;
#[CustomExt('clickhouse')]
class clickhouse extends Extension
{
public function getUnixConfigureArg(bool $shared = false): string
{
$arg = '--enable-clickhouse' . ($shared ? '=shared' : '');
if ($this->builder->getLib('openssl')) {
$arg .= ' --enable-clickhouse-openssl';
}
return $arg;
}
}

View File

@@ -0,0 +1,17 @@
<?php
declare(strict_types=1);
namespace SPC\builder\extension;
use SPC\builder\Extension;
use SPC\util\CustomExt;
#[CustomExt('com_dotnet')]
class com_dotnet extends Extension
{
public function getWindowsConfigureArg(bool $shared = false): string
{
return '--enable-com-dotnet=yes';
}
}

View File

@@ -5,23 +5,21 @@ declare(strict_types=1);
namespace SPC\builder\extension;
use SPC\builder\Extension;
use SPC\builder\linux\LinuxBuilder;
use SPC\builder\macos\MacOSBuilder;
use SPC\exception\FileSystemException;
use SPC\exception\WrongUsageException;
use SPC\builder\windows\WindowsBuilder;
use SPC\exception\PatchException;
use SPC\store\FileSystem;
use SPC\util\CustomExt;
#[CustomExt('curl')]
class curl extends Extension
{
/**
* @throws FileSystemException
*/
public function patchBeforeBuildconf(): bool
{
logger()->info('patching before-configure for curl checks');
$file1 = "AC_DEFUN([PHP_CHECK_LIBRARY], [\n $3\n])";
$files = FileSystem::readFile(SOURCE_PATH . '/php-src/ext/curl/config.m4');
$files = FileSystem::readFile($this->source_dir . '/config.m4');
$file2 = 'AC_DEFUN([PHP_CHECK_LIBRARY], [
save_old_LDFLAGS=$LDFLAGS
ac_stuff="$5"
@@ -40,18 +38,92 @@ class curl extends Extension
$4
])dnl
])';
file_put_contents(SOURCE_PATH . '/php-src/ext/curl/config.m4', $file1 . "\n" . $files . "\n" . $file2);
file_put_contents($this->source_dir . '/config.m4', $file1 . "\n" . $files . "\n" . $file2);
return true;
}
/**
* @throws FileSystemException
* @throws WrongUsageException
*/
public function patchBeforeConfigure(): bool
{
$frameworks = $this->builder instanceof MacOSBuilder ? ' ' . $this->builder->getFrameworks(true) . ' ' : '';
FileSystem::replaceFileRegex(SOURCE_PATH . '/php-src/configure', '/-lcurl/', $this->getLibFilesString() . $frameworks);
$this->patchBeforeSharedConfigure();
return true;
}
public function patchBeforeMake(): bool
{
$patched = parent::patchBeforeMake();
$extra_libs = getenv('SPC_EXTRA_LIBS') ?: '';
if ($this->builder instanceof WindowsBuilder && !str_contains($extra_libs, 'secur32.lib')) {
$extra_libs .= ' secur32.lib';
putenv('SPC_EXTRA_LIBS=' . trim($extra_libs));
return true;
}
return $patched;
}
public function patchBeforeSharedConfigure(): bool
{
$file = $this->source_dir . '/config.m4';
$content = FileSystem::readFile($file);
// Inject patch before it
$patch = ' save_LIBS="$LIBS"
LIBS="$LIBS $CURL_LIBS"
';
// Check if already patched
if (str_contains($content, $patch)) {
return false; // Already patched
}
// Match the line containing PHP_CHECK_LIBRARY for curl
$pattern = '/(PHP_CHECK_LIBRARY\(\[curl],\s*\[curl_easy_perform],)/';
// Restore LIBS after the check — append this just after the macro block
$restore = '
LIBS="$save_LIBS"';
// Apply patch
$patched = preg_replace_callback($pattern, function ($matches) use ($patch) {
return $patch . $matches[1];
}, $content, 1);
// Inject restore after the matching PHP_CHECK_LIBRARY block
$patched = preg_replace(
'/(PHP_CHECK_LIBRARY\(\[curl],\s*\[curl_easy_perform],.*?\)\n)/s',
"$1{$restore}\n",
$patched,
1
);
if ($patched === null) {
throw new PatchException('shared extension curl patcher', 'Failed to patch config.m4 due to a regex error');
}
FileSystem::writeFile($file, $patched);
return true;
}
public function buildUnixShared(): void
{
if (!$this->builder instanceof LinuxBuilder) {
parent::buildUnixShared();
return;
}
FileSystem::replaceFileStr(
$this->source_dir . '/config.m4',
['$ext_dir/phar.1', '$ext_dir/phar.phar.1'],
['${ext_dir}phar.1', '${ext_dir}phar.phar.1']
);
try {
parent::buildUnixShared();
} finally {
FileSystem::replaceFileStr(
$this->source_dir . '/config.m4',
['${ext_dir}phar.1', '${ext_dir}phar.phar.1'],
['$ext_dir/phar.1', '$ext_dir/phar.phar.1']
);
}
}
}

View File

@@ -10,13 +10,13 @@ use SPC\util\CustomExt;
#[CustomExt('dba')]
class dba extends Extension
{
public function getUnixConfigureArg(): string
public function getUnixConfigureArg(bool $shared = false): string
{
$qdbm = $this->builder->getLib('qdbm') ? (' --with-qdbm=' . BUILD_ROOT_PATH) : '';
return '--enable-dba' . $qdbm;
return '--enable-dba' . ($shared ? '=shared' : '') . $qdbm;
}
public function getWindowsConfigureArg(): string
public function getWindowsConfigureArg(bool $shared = false): string
{
$qdbm = $this->builder->getLib('qdbm') ? ' --with-qdbm' : '';
return '--with-dba' . $qdbm;

View File

@@ -0,0 +1,46 @@
<?php
declare(strict_types=1);
namespace SPC\builder\extension;
use SPC\builder\Extension;
use SPC\store\FileSystem;
use SPC\util\CustomExt;
#[CustomExt('decimal')]
class decimal extends Extension
{
// TODO: remove this when https://github.com/php-decimal/ext-decimal/issues/92 is merged
public function patchBeforeBuildconf(): bool
{
FileSystem::replaceFileStr(
$this->source_dir . '/php_decimal.c',
[
'zend_module_entry decimal_module_entry',
'ZEND_GET_MODULE(decimal)',
],
[
'zend_module_entry php_decimal_module_entry',
'ZEND_GET_MODULE(php_decimal)',
]
);
FileSystem::replaceFileStr(
$this->source_dir . '/config.w32',
'ARG_WITH("decimal", "for decimal support", "no");',
'ARG_WITH("decimal", "for decimal support", "no");' . "\n" .
'ADD_EXTENSION_DEP("decimal", "json");'
);
return true;
}
public function getUnixConfigureArg(bool $shared = false): string
{
return '--enable-decimal --with-libmpdec-path="' . BUILD_ROOT_PATH . '"';
}
public function getWindowsConfigureArg(bool $shared = false): string
{
return '--with-decimal';
}
}

View File

@@ -0,0 +1,22 @@
<?php
declare(strict_types=1);
namespace SPC\builder\extension;
use SPC\builder\Extension;
use SPC\store\FileSystem;
use SPC\util\CustomExt;
#[CustomExt('dio')]
class dio extends Extension
{
public function patchBeforeBuildconf(): bool
{
if (!file_exists(SOURCE_PATH . '/php-src/ext/dio/php_dio.h')) {
FileSystem::writeFile(SOURCE_PATH . '/php-src/ext/dio/php_dio.h', FileSystem::readFile(SOURCE_PATH . '/php-src/ext/dio/src/php_dio.h'));
return true;
}
return false;
}
}

View File

@@ -0,0 +1,31 @@
<?php
declare(strict_types=1);
namespace SPC\builder\extension;
use SPC\builder\Extension;
use SPC\store\FileSystem;
use SPC\util\CustomExt;
#[CustomExt('dom')]
class dom extends Extension
{
public function getUnixConfigureArg(bool $shared = false): string
{
$arg = '--enable-dom' . ($shared ? '=shared' : '');
$arg .= ' --with-libxml="' . BUILD_ROOT_PATH . '"';
return $arg;
}
public function patchBeforeBuildconf(): bool
{
FileSystem::replaceFileStr(SOURCE_PATH . '/php-src/win32/build/config.w32', 'dllmain.c ', '');
return true;
}
public function getWindowsConfigureArg($shared = false): string
{
return '--with-dom';
}
}

View File

@@ -10,7 +10,7 @@ use SPC\util\CustomExt;
#[CustomExt('enchant')]
class enchant extends Extension
{
public function getUnixConfigureArg(): string
public function getUnixConfigureArg(bool $shared = false): string
{
$glibs = [
'/Users/jerry/project/git-project/static-php-cli/buildroot/lib/libgio-2.0.a',

Some files were not shown because too many files have changed in this diff Show More