From a8a851659f7ef80a7d6920d47f3c277eaec580d4 Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Fri, 8 May 2026 19:07:06 +0800 Subject: [PATCH] Fix memcache build on PHP 8.5 --- src/Package/Extension/memcache.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/Package/Extension/memcache.php b/src/Package/Extension/memcache.php index a9c58b76..3fac4022 100644 --- a/src/Package/Extension/memcache.php +++ b/src/Package/Extension/memcache.php @@ -17,6 +17,20 @@ class memcache extends PhpExtensionPackage #[BeforeStage('php', [php::class, 'buildconfForUnix'], 'ext-memcache')] public function patchBeforeBuildconf(): bool { + // PHP 8.5 moved php_smart_string*.h from ext/standard/ to Zend/ + foreach (['src/memcache_pool.h', 'src/memcache_pool.c', 'src/memcache_session.c', 'src/memcache_ascii_protocol.c', 'src/memcache_binary_protocol.c'] as $file) { + FileSystem::replaceFileStr( + "{$this->getSourceDir()}/{$file}", + '#include "ext/standard/php_smart_string_public.h"', + '#include "Zend/zend_smart_string_public.h"', + ); + FileSystem::replaceFileStr( + "{$this->getSourceDir()}/{$file}", + '#include "ext/standard/php_smart_string.h"', + '#include "Zend/zend_smart_string.h"', + ); + } + if (!$this->isBuildStatic()) { return false; }