Skip to content

Commit e4e0162

Browse files
committed
chore: wip
1 parent 050fa3d commit e4e0162

File tree

2 files changed

+49
-8
lines changed

2 files changed

+49
-8
lines changed

.github/workflows/precompile-php.yml

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -248,11 +248,14 @@ jobs:
248248
REQUIRED_EXTENSIONS=(
249249
"Core" "date" "hash" "json" "pcre" "Reflection" "SPL" "standard"
250250
"mbstring" "iconv" "filter" "ctype" "tokenizer" "session" "fileinfo"
251-
"opcache" "phar" "dom" "xml" "xmlreader" "xmlwriter" "simplexml"
251+
"phar" "dom" "xml" "xmlreader" "xmlwriter" "simplexml"
252252
"curl" "openssl" "zip" "zlib" "calendar" "ftp" "pcntl" "posix"
253253
"shmop" "sockets" "exif" "bcmath" "bz2" "gettext" "readline"
254254
)
255255
256+
# Define Zend extensions that need special checking
257+
ZEND_EXTENSIONS=("opcache")
258+
256259
# Test each required extension
257260
echo "🧪 Testing essential extensions..."
258261
MISSING_EXTENSIONS=()
@@ -266,6 +269,17 @@ jobs:
266269
fi
267270
done
268271
272+
# Test Zend extensions separately
273+
for ext in "${ZEND_EXTENSIONS[@]}"; do
274+
EXT_LOADED=$(binaries/$BINARY_NAME/bin/php -r "echo function_exists('opcache_get_status') ? '1' : '0';")
275+
if [ "$EXT_LOADED" = "1" ]; then
276+
echo "✅ $ext: LOADED"
277+
else
278+
echo "❌ $ext: MISSING"
279+
MISSING_EXTENSIONS+=("$ext")
280+
fi
281+
done
282+
269283
# Check if any essential extensions are missing
270284
if [ ${#MISSING_EXTENSIONS[@]} -gt 0 ]; then
271285
echo "❌ Critical extensions missing: ${MISSING_EXTENSIONS[*]}"
@@ -374,11 +388,14 @@ jobs:
374388
$REQUIRED_EXTENSIONS = @(
375389
"Core", "date", "hash", "json", "pcre", "Reflection", "SPL", "standard",
376390
"mbstring", "iconv", "filter", "ctype", "tokenizer", "session", "fileinfo",
377-
"opcache", "phar", "dom", "xml", "xmlreader", "xmlwriter", "simplexml",
378-
"curl", "openssl", "zip", "zlib", "calendar", "ftp", "pcntl", "posix",
391+
"phar", "dom", "xml", "xmlreader", "xmlwriter", "simplexml",
392+
"curl", "openssl", "zip", "zlib", "calendar", "ftp",
379393
"shmop", "sockets", "exif", "bcmath", "bz2", "gettext", "readline"
380394
)
381395
396+
# Define Zend extensions that need special checking
397+
$ZEND_EXTENSIONS = @("opcache")
398+
382399
# Test each required extension
383400
Write-Host "🧪 Testing essential extensions..."
384401
$MISSING_EXTENSIONS = @()
@@ -392,6 +409,17 @@ jobs:
392409
}
393410
}
394411
412+
# Test Zend extensions separately
413+
foreach ($ext in $ZEND_EXTENSIONS) {
414+
$extLoaded = & $PHP -r "echo function_exists('opcache_get_status') ? '1' : '0';"
415+
if ($extLoaded -eq "1") {
416+
Write-Host "✅ $ext`: LOADED"
417+
} else {
418+
Write-Host "❌ $ext`: MISSING"
419+
$MISSING_EXTENSIONS += $ext
420+
}
421+
}
422+
395423
# Check if any essential extensions are missing
396424
if ($MISSING_EXTENSIONS.Count -gt 0) {
397425
Write-Host "❌ Critical extensions missing: $($MISSING_EXTENSIONS -join ', ')"

scripts/build-php.ts

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -286,15 +286,16 @@ function generateConfigureArgs(config: BuildConfig, installPrefix: string): stri
286286
`--with-xsl=${launchpadPath}/gnome.org/libxslt/v1.1.43`,
287287
`--with-zlib=${launchpadPath}/zlib.net/v1.3.1`,
288288
`--with-bz2=${launchpadPath}/sourceware.org/bzip2/v1.0.8`,
289-
`--with-iconv=${launchpadPath}/gnu.org/libiconv/v1.18.0`
289+
`--with-iconv=${launchpadPath}/gnu.org/libiconv/v1.18.0`,
290+
`--with-libzip=${launchpadPath}/libzip.org/v1.11.4`
290291
]
291292

292293
// Platform-specific arguments
293294
if (config.platform === 'darwin') {
294295
return [
295296
...baseArgs,
296297
...dependencyArgs,
297-
'--enable-opcache',
298+
'--enable-opcache=shared',
298299
'--with-kerberos',
299300
'--with-libedit',
300301
'--with-zip',
@@ -305,7 +306,7 @@ function generateConfigureArgs(config: BuildConfig, installPrefix: string): stri
305306
return [
306307
...baseArgs,
307308
...dependencyArgs,
308-
'--enable-opcache',
309+
'--enable-opcache=shared',
309310
'--with-kerberos',
310311
'--with-readline',
311312
'--with-zip',
@@ -648,13 +649,25 @@ ldap.max_links = -1
648649
[dba]
649650
650651
[opcache]
652+
; Basic OPcache settings
651653
opcache.enable = 1
652654
opcache.enable_cli = 1
653655
opcache.memory_consumption = 128
654656
opcache.interned_strings_buffer = 8
655657
opcache.max_accelerated_files = 4000
656-
opcache.revalidate_freq = 2
657-
opcache.fast_shutdown = 1
658+
opcache.revalidate_freq = 60
659+
opcache.validate_timestamps = 1
660+
opcache.save_comments = 1
661+
opcache.enable_file_override = 0
662+
663+
; JIT settings for PHP 8.0+
664+
opcache.jit = tracing
665+
opcache.jit_buffer_size = 64M
666+
667+
; Performance optimizations
668+
opcache.max_wasted_percentage = 5
669+
opcache.use_cwd = 1
670+
opcache.optimization_level = 0x7FFEBFFF
658671
659672
[curl]
660673
curl.cainfo =

0 commit comments

Comments
 (0)