Hi, Attached are two new ports: - www/frankenphp: FrankenPHP, a PHP app server built on Caddy. Supports classic mode and a worker mode that keeps the app booted between requests. https://frankenphp.dev - lang/php-zts: PHP built as a thread-safe (ZTS) embed library, which FrankenPHP links against. lang/php has no ZTS or embed build. When php -embed was dropped (dd3553de0c) the note said that if it came back it should "probably be a separate port", and now this is one. This port takes the distfile checksum and patches from lang/php/8.5 (CHECKSUM_FILE, PATCHDIR), builds only the embed SAPI, and installs under its own names to not conflict with php-8.5: lib/libphp-zts-8.5.so.0.0 (versioned via SHARED_LIBS, like libpython3.x), share/php-zts-8.5/include, php-config-zts-8.5 and /etc/php-zts-8.5.ini. Since it shares the distfile, it has to be updated together with lang/php/8.5. Extensions are built in, because existing php-* packages are not ZTS and can't be loaded into it. On top of the lang/php defaults it has curl, intl, mysqli/pdo_mysql, pgsql/pdo_pgsql, sqlite3/pdo_sqlite, zip, bz2, gmp, soap and xsl. I left out gd, which would need the X sets. If you'd rather prefer extensions to be subpackages like lang/php, let me know and I can rework it that way. Please find these two small diffs to go with it, inlined below: - lang/php/8.5: two new patches, used by php-zts. patch-TSRM_TSRM_h: OpenBSD uses emulated TLS, so there is no _tsrm_ls_cache symbol and the initial-exec asm in TSRM.c fails to link on aarch64. https://github.com/php/php-src/pull/25557 patch-Zend_zend_call_stack_c: pthread_stackseg_np() returns the top of the stack, but PHP took it as the bottom, so on any thread but the main one the stack limit was never reached. Deep recursion in a FrankenPHP request killed the whole server with SIGILL instead of throwing an Error. https://github.com/php/php-src/pull/25635 Neither changes anything for the php packages in practice (the TSRM.h part only applies to ZTS, and php runs PHP on the main thread), so I didn't bump REVISION. - infrastructure/db/user.list: 906 _frankenphp FrankenPHP's caddy/go.mod has "replace github.com/dunglas/frankenphp => ../", which lang/go can't resolve, therefore this port drops replace and gets the root module from the proxy like any other dependency. make modgo-gen-modules trips over the replace too, so I generated modules.inc with a small wrapper around modgo-gen-modules-helper that drops it first. I can send it, or a diff to the helper, if useful. Tested on -current/arm64: both build and package, portcheck and port-lib-depends-check are clean, and frankenphp runs from the rc.d script (start, reload, stop), serving PHP 8.5 over HTTPS, and in worker mode under 400 concurrent requests. A shared extension built with phpize-zts-8.5 loads from lib/php-zts-8.5/modules via an .ini in /etc/php-zts-8.5, so a later split into subpackages is possible. I have no amd64 machine, so tests there would be very welcome. I'm happy to maintain both. sthen, php-zts is tied closely to lang/php, so if you'd rather maintain it yourself or put it somewhere else, that's fine with me. Comments and OKs welcome. Thanks, Ostap Index: lang/php/8.5/patches/patch-TSRM_TSRM_h --- lang/php/8.5/patches/patch-TSRM_TSRM_h 1 Jan 1970 00:00:00 -0000 +++ lang/php/8.5/patches/patch-TSRM_TSRM_h 18 Nov 2026 00:00:00 -0000 @@ -0,0 +1,16 @@ +Use the default TLS model: OpenBSD has emulated TLS, making the +initial-exec asm fail to link on aarch64 (undefined _tsrm_ls_cache). +https://github.com/php/php-src/pull/25557 + +Index: TSRM/TSRM.h +--- TSRM/TSRM.h.orig ++++ TSRM/TSRM.h +@@ -152,7 +152,7 @@ TSRM_API bool tsrm_is_managed_thread(void); + # define __has_attribute(x) 0 +
No comments:
Post a Comment