@@ -1209,7 +1209,15 @@ function buildPhpWithSystemLibraries(config: BuildConfig, installPrefix: string)
1209
1209
// Install required system packages for extensions
1210
1210
log ( 'Installing required system packages...' )
1211
1211
try {
1212
- execSync ( 'apt-get update && apt-get install -y libbz2-dev libzip-dev gettext libgettextpo-dev' , { stdio : 'inherit' } )
1212
+ execSync ( 'apt-get update && apt-get install -y libbz2-dev libzip-dev gettext libgettextpo-dev pkg-config' , { stdio : 'inherit' } )
1213
+
1214
+ // Verify libzip installation
1215
+ try {
1216
+ const libzipVersion = execSync ( 'pkg-config --modversion libzip' , { encoding : 'utf8' } ) . trim ( )
1217
+ log ( `✅ libzip ${ libzipVersion } detected` )
1218
+ } catch ( e ) {
1219
+ log ( '⚠️ libzip pkg-config not found, zip extension may fail' )
1220
+ }
1213
1221
} catch ( e ) {
1214
1222
log ( 'Warning: Could not install system packages, continuing with available libraries' )
1215
1223
}
@@ -1222,8 +1230,8 @@ function buildPhpWithSystemLibraries(config: BuildConfig, installPrefix: string)
1222
1230
CPP : 'gcc -E' ,
1223
1231
CFLAGS : '-O2 -fPIC' ,
1224
1232
CXXFLAGS : '-O2 -fPIC' ,
1225
- // Clear any paths that might contain libstdc++
1226
- PKG_CONFIG_PATH : '' ,
1233
+ // Set system pkg-config path for extension detection, but exclude Launchpad paths
1234
+ PKG_CONFIG_PATH : '/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig ' ,
1227
1235
LDFLAGS : '' ,
1228
1236
CPPFLAGS : '' ,
1229
1237
LD_LIBRARY_PATH : '' ,
@@ -1287,7 +1295,7 @@ function buildPhpWithSystemLibraries(config: BuildConfig, installPrefix: string)
1287
1295
// Try to configure with all critical extensions first
1288
1296
const fullConfigureArgs = [
1289
1297
...baseConfigureArgs ,
1290
- '--enable -zip' ,
1298
+ '--with -zip' ,
1291
1299
'--with-iconv' ,
1292
1300
'--with-bz2' ,
1293
1301
'--with-gettext'
@@ -1308,9 +1316,9 @@ function buildPhpWithSystemLibraries(config: BuildConfig, installPrefix: string)
1308
1316
// Try with individual extensions to see which ones work
1309
1317
const workingArgs = [ ...baseConfigureArgs ]
1310
1318
1311
- // Test each extension individually
1319
+ // Test each extension individually with proper configuration
1312
1320
const extensionsToTest = [
1313
- { flag : '--enable -zip' , name : 'zip' } ,
1321
+ { flag : '--with -zip' , name : 'zip' } , // Use --with-zip instead of --enable-zip
1314
1322
{ flag : '--with-iconv' , name : 'iconv' } ,
1315
1323
{ flag : '--with-bz2' , name : 'bz2' } ,
1316
1324
{ flag : '--with-gettext' , name : 'gettext' }
0 commit comments