Skip to content

Commit 9f823c1

Browse files
committed
chore: wip
1 parent cf61c96 commit 9f823c1

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

scripts/build-php.ts

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2386,6 +2386,31 @@ exec ./configure "$@"
23862386

23872387
log(`✅ PHP ${config.phpVersion} built successfully at ${installPrefix}`)
23882388

2389+
// Verify that the binary was actually installed
2390+
const phpBinaryPath = join(installPrefix, 'bin', 'php')
2391+
if (existsSync(phpBinaryPath)) {
2392+
log(`✅ PHP binary verified at: ${phpBinaryPath}`)
2393+
} else {
2394+
log(`❌ PHP binary not found at expected location: ${phpBinaryPath}`)
2395+
log(`🔍 Contents of ${installPrefix}:`)
2396+
if (existsSync(installPrefix)) {
2397+
const contents = readdirSync(installPrefix)
2398+
log(` ${contents.join(', ')}`)
2399+
2400+
// Check if bin directory exists
2401+
const binDir = join(installPrefix, 'bin')
2402+
if (existsSync(binDir)) {
2403+
log(`🔍 Contents of ${binDir}:`)
2404+
const binContents = readdirSync(binDir)
2405+
log(` ${binContents.join(', ')}`)
2406+
} else {
2407+
log(`❌ bin directory does not exist at ${binDir}`)
2408+
}
2409+
} else {
2410+
log(`❌ Install prefix directory does not exist: ${installPrefix}`)
2411+
}
2412+
}
2413+
23892414
// Test the binary (platform-specific)
23902415
if (config.platform === 'win32') {
23912416
const phpBinary = join(installPrefix, 'bin', 'php.exe')
@@ -2714,6 +2739,32 @@ function buildPhpWithSystemLibraries(config: BuildConfig, installPrefix: string)
27142739
createUnixPhpIni(installPrefix, config)
27152740

27162741
log(`✅ PHP ${config.phpVersion} built successfully with system libraries`)
2742+
2743+
// Verify that the binary was actually installed
2744+
const phpBinaryPath = join(installPrefix, 'bin', 'php')
2745+
if (existsSync(phpBinaryPath)) {
2746+
log(`✅ PHP binary verified at: ${phpBinaryPath}`)
2747+
} else {
2748+
log(`❌ PHP binary not found at expected location: ${phpBinaryPath}`)
2749+
log(`🔍 Contents of ${installPrefix}:`)
2750+
if (existsSync(installPrefix)) {
2751+
const contents = readdirSync(installPrefix)
2752+
log(` ${contents.join(', ')}`)
2753+
2754+
// Check if bin directory exists
2755+
const binDir = join(installPrefix, 'bin')
2756+
if (existsSync(binDir)) {
2757+
log(`🔍 Contents of ${binDir}:`)
2758+
const binContents = readdirSync(binDir)
2759+
log(` ${binContents.join(', ')}`)
2760+
} else {
2761+
log(`❌ bin directory does not exist at ${binDir}`)
2762+
}
2763+
} else {
2764+
log(`❌ Install prefix directory does not exist: ${installPrefix}`)
2765+
}
2766+
}
2767+
27172768
return installPrefix
27182769
}
27192770

0 commit comments

Comments
 (0)