From a15a817ef832ef557ae55f82c7c8978a2c6e127f Mon Sep 17 00:00:00 2001 From: Luther Monson Date: Sun, 11 Oct 2026 22:28:32 -0700 Subject: [PATCH 1/2] feat(windows): add the sockets extension to the Windows SDK sets Linux and macOS already build sockets (added in #40). Add it to both Windows extension lists (MSVC and clang) and to the windows-shared preload set. PHP's ext/sockets/config.w32 needs only ws2_32.lib and Iphlpapi.lib, both already linked by ext/standard and by ephpm's Windows link line. Needed by phpIPAM, which refuses to run without it (ephpm/recipes issues/phpipam.md). --- .github/workflows/build.yml | 16 +++++++++------- README.md | 2 +- tools/windows-shared/package.ps1 | 4 ++-- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7c24660..a3a2c19 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -93,11 +93,13 @@ env: # `mbregex` in BOTH lists alongside `mbstring`. # # NOTE on shmop/sockets: added for downstream consumers that ship them - # (PAM's reviewed extension surface). They are NOT in WIN_PHP_EXTENSIONS — - # PHP supports both on Windows, but neither has ever been through spc's - # Windows toolchain here and the Windows leg is the longest and most - # fragile in this workflow. Validate with a `release_tag_suffix` dispatch - # before adding them there. + # (PAM's reviewed extension surface); sockets is also required by phpIPAM and + # other apps that call socket_*(). `sockets` IS in WIN_PHP_EXTENSIONS: PHP's + # ext/sockets/config.w32 needs only ws2_32.lib + Iphlpapi.lib, both already + # linked by ext/standard and by ephpm's Windows link line. `shmop` is NOT — + # PHP supports it on Windows, but it has never been through spc's Windows + # toolchain here and the Windows leg is the longest and most fragile in this + # workflow. Validate with a `release_tag_suffix` dispatch before adding it. # # NOTE on ffi: deliberately absent. spc's ext-ffi passes # `--enable-zend-signals`, and its extension args land AFTER the target @@ -1053,7 +1055,7 @@ jobs: # (links against LIBPQ.DLL) instead of a static build # Re-add as spc grows Windows support for its underlying library. env: - WIN_PHP_EXTENSIONS: "bcmath,bz2,calendar,ctype,curl,dom,exif,fileinfo,filter,ftp,gd,gettext,hash,iconv,intl,mbregex,mbstring,mysqli,mysqlnd,opcache,openssl,pcre,pdo,pdo_mysql,pdo_sqlite,phar,session,simplexml,soap,sodium,sqlite3,tokenizer,xml,xmlreader,xmlwriter,xsl,zip,zlib" + WIN_PHP_EXTENSIONS: "bcmath,bz2,calendar,ctype,curl,dom,exif,fileinfo,filter,ftp,gd,gettext,hash,iconv,intl,mbregex,mbstring,mysqli,mysqlnd,opcache,openssl,pcre,pdo,pdo_mysql,pdo_sqlite,phar,session,simplexml,soap,sockets,sodium,sqlite3,tokenizer,xml,xmlreader,xmlwriter,xsl,zip,zlib" steps: - name: Clean up previous builds shell: powershell @@ -1606,7 +1608,7 @@ jobs: # Same extension set as the MSVC lane — the artifact must differ ONLY in # the compiler and VM kind. env: - WIN_PHP_EXTENSIONS: "bcmath,bz2,calendar,ctype,curl,dom,exif,fileinfo,filter,ftp,gd,gettext,hash,iconv,intl,mbregex,mbstring,mysqli,mysqlnd,opcache,openssl,pcre,pdo,pdo_mysql,pdo_sqlite,phar,session,simplexml,soap,sodium,sqlite3,tokenizer,xml,xmlreader,xmlwriter,xsl,zip,zlib" + WIN_PHP_EXTENSIONS: "bcmath,bz2,calendar,ctype,curl,dom,exif,fileinfo,filter,ftp,gd,gettext,hash,iconv,intl,mbregex,mbstring,mysqli,mysqlnd,opcache,openssl,pcre,pdo,pdo_mysql,pdo_sqlite,phar,session,simplexml,soap,sockets,sodium,sqlite3,tokenizer,xml,xmlreader,xmlwriter,xsl,zip,zlib" # Pinned LLVM toolchain (see job comment: VS-bundled clang 19 is slower # than MSVC; 22.1.8 is the measured-good floor). LLVM_VERSION: "22.1.8" diff --git a/README.md b/README.md index c0458a4..cad5670 100644 --- a/README.md +++ b/README.md @@ -197,7 +197,7 @@ sysvsem, sysvshm, tokenizer, xml, xmlreader, xmlwriter, xsl, zip, zlib The NTS variants additionally include `ffi`. -Windows drops the Unix-only entries (`pcntl`, `posix`, `sysv*`), plus `gmp`, `pgsql` and `pdo_pgsql`, which static-php-cli cannot build statically on Windows today. It also does not yet carry `shmop` or `sockets` — PHP supports both there, but neither has been validated through spc's Windows toolchain from this repo. +Windows drops the Unix-only entries (`pcntl`, `posix`, `sysv*`), plus `gmp`, `pgsql` and `pdo_pgsql`, which static-php-cli cannot build statically on Windows today. It also does not yet carry `shmop` — PHP supports it there, but it has not been validated through spc's Windows toolchain from this repo. `sockets` is carried on Windows too (it needs only `ws2_32` and `Iphlpapi`, both already linked). `ffi` is not in the shared extension set on purpose. static-php-cli's `ext-ffi` passes `--enable-zend-signals`, and extension arguments land after the target arguments on the configure line, so it would override the `--disable-zend-signals` that spc emits for ZTS builds — silently changing signal behavior in the SDK ePHPm links. NTS builds emit no `--disable-zend-signals`, so `ffi` rides along there. diff --git a/tools/windows-shared/package.ps1 b/tools/windows-shared/package.ps1 index b3ee9b4..12bbe84 100644 --- a/tools/windows-shared/package.ps1 +++ b/tools/windows-shared/package.ps1 @@ -80,8 +80,8 @@ $WantedExtensions = @( 'bcmath', 'bz2', 'calendar', 'ctype', 'curl', 'dom', 'mbstring', 'exif', 'fileinfo', 'filter', 'ftp', 'gd', 'gettext', 'hash', 'iconv', 'intl', 'mysqlnd', 'mysqli', 'opcache', 'openssl', 'pcre', 'pdo', 'pdo_mysql', - 'pdo_sqlite', 'phar', 'session', 'simplexml', 'soap', 'sodium', 'sqlite3', - 'tokenizer', 'xml', 'xmlreader', 'xmlwriter', 'xsl', 'zip', 'zlib' + 'pdo_sqlite', 'phar', 'session', 'simplexml', 'soap', 'sockets', 'sodium', + 'sqlite3', 'tokenizer', 'xml', 'xmlreader', 'xmlwriter', 'xsl', 'zip', 'zlib' ) # Loaded with zend_extension= rather than extension= when shipped as a DLL # (PHP 8.3/8.4; 8.5 compiles OPcache into php8ts.dll). From 4d40ab94bc63fb34269e1081dfa1258d06ec48ea Mon Sep 17 00:00:00 2001 From: Luther Monson Date: Sun, 11 Oct 2026 22:30:48 -0700 Subject: [PATCH 2/2] docs: correct the sockets link-library note --- .github/workflows/build.yml | 4 ++-- README.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a3a2c19..ee9250a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -95,8 +95,8 @@ env: # NOTE on shmop/sockets: added for downstream consumers that ship them # (PAM's reviewed extension surface); sockets is also required by phpIPAM and # other apps that call socket_*(). `sockets` IS in WIN_PHP_EXTENSIONS: PHP's - # ext/sockets/config.w32 needs only ws2_32.lib + Iphlpapi.lib, both already - # linked by ext/standard and by ephpm's Windows link line. `shmop` is NOT — + # ext/sockets/config.w32 needs only ws2_32.lib + Iphlpapi.lib; ext/standard + # already links iphlpapi and ephpm links ws2_32. `shmop` is NOT — # PHP supports it on Windows, but it has never been through spc's Windows # toolchain here and the Windows leg is the longest and most fragile in this # workflow. Validate with a `release_tag_suffix` dispatch before adding it. diff --git a/README.md b/README.md index cad5670..4ed7bcf 100644 --- a/README.md +++ b/README.md @@ -197,7 +197,7 @@ sysvsem, sysvshm, tokenizer, xml, xmlreader, xmlwriter, xsl, zip, zlib The NTS variants additionally include `ffi`. -Windows drops the Unix-only entries (`pcntl`, `posix`, `sysv*`), plus `gmp`, `pgsql` and `pdo_pgsql`, which static-php-cli cannot build statically on Windows today. It also does not yet carry `shmop` — PHP supports it there, but it has not been validated through spc's Windows toolchain from this repo. `sockets` is carried on Windows too (it needs only `ws2_32` and `Iphlpapi`, both already linked). +Windows drops the Unix-only entries (`pcntl`, `posix`, `sysv*`), plus `gmp`, `pgsql` and `pdo_pgsql`, which static-php-cli cannot build statically on Windows today. It also does not yet carry `shmop` — PHP supports it there, but it has not been validated through spc's Windows toolchain from this repo. `sockets` is carried on Windows too (it needs only `ws2_32` and `Iphlpapi`). `ffi` is not in the shared extension set on purpose. static-php-cli's `ext-ffi` passes `--enable-zend-signals`, and extension arguments land after the target arguments on the configure line, so it would override the `--disable-zend-signals` that spc emits for ZTS builds — silently changing signal behavior in the SDK ePHPm links. NTS builds emit no `--disable-zend-signals`, so `ffi` rides along there.