11#! /usr/bin/env bash
2- PHP_VERSIONS=(" 8.1.33 " " 8.2.29 " " 8.3.28 " " 8.4.15 " " 8.5.0" )
2+ PHP_VERSIONS=(" 8.1.34 " " 8.2.30 " " 8.3.29 " " 8.4.16 " " 8.5.0" )
33
44# ### NOTE: Tags with "v" prefixes behave weirdly in the GitHub API. They'll be stripped in some places but not others.
55# ### Use commit hashes to avoid this.
@@ -15,23 +15,23 @@ CURL_VERSION="curl-8_13_0"
1515YAML_VERSION=" 0.2.5"
1616LEVELDB_VERSION=" 1c7564468b41610da4f498430e795ca4de0931ff" # release not tagged
1717LIBXML_VERSION=" 2.15.1"
18- LIBPNG_VERSION=" 1.6.50 "
18+ LIBPNG_VERSION=" 1.6.53 "
1919LIBJPEG_VERSION=" 9f"
2020OPENSSL_VERSION=" 3.6.0"
2121LIBZIP_VERSION=" 1.11.4"
22- SQLITE3_VERSION=" 3500400 " # 3.50.4
23- LIBDEFLATE_VERSION=" 96836d7d9d10e3e0d53e6edb54eb908514e336c4 " # 1.24 - see above note about "v" prefixes
22+ SQLITE3_VERSION=" 3510100 " # 3.51.1
23+ LIBDEFLATE_VERSION=" c8c56a20f8f621e6a966b716b31f1dedab6a41e3 " # 1.25 - see above note about "v" prefixes
2424LIBRDKAFKA_VER=" 2.12.1"
2525LIBZSTD_VER=" 1.5.7"
2626LIBGRPC_VER=" 1.76.0"
2727LIBSNAPPY_VER=" 1.2.2"
2828SASL2_VERSION=" 2.1.28"
2929
30- EXT_PMMPTHREAD_VERSION=" 6.2 .0"
31- EXT_YAML_VERSION=" 2.2.5 "
30+ EXT_PMMPTHREAD_VERSION=" 6.3 .0"
31+ EXT_YAML_VERSION=" 2.3.0 "
3232EXT_LEVELDB_VERSION=" 88071eb1b1eae96af043229104b9d813f7cbe40c" # release not tagged
3333EXT_CHUNKUTILS2_VERSION=" 0.3.5"
34- EXT_XDEBUG_VERSION=" 3.4.7 "
34+ EXT_XDEBUG_VERSION=" 3.5.0 "
3535EXT_IGBINARY_VERSION=" 3.2.16"
3636EXT_CRYPTO_VERSION=" 999b3c7edbc7f8ca4fdeb0bb4bbae488ad0daf07" # release not tagged
3737EXT_SNAPPY_VERSION=" 0.2.3"
@@ -46,9 +46,7 @@ EXT_ZSTD_VERSION="0.15.2"
4646EXT_GRPC_VERSION=" 1.76.0"
4747EXT_VANILLAGENERATOR_VERSION=" abd059fd2ca79888aab3b9c5070d83ceea55fada"
4848
49- EXT_PMMPTHREAD_VERSION_PHP85=" 4aa34a27feaa43adba5f1e93939828d1d7afdefc"
50- EXT_XDEBUG_VERSION_PHP85=" 3.5.0alpha2"
51- EXT_IGBINARY_VERSION_PHP85=" 8f8b7175c7859f1845bcdee6f7d0baeea7d07cb8"
49+ EXT_IGBINARY_VERSION_PHP85=" 3.2.17RC1"
5250
5351function write_out {
5452 echo " [$1 ] $2 "
@@ -320,8 +318,6 @@ PHP_VERSION_ID=$(php_version_id "$PHP_VERSION")
320318write_out " opt" " Selected PHP $PHP_VERSION ($PHP_VERSION_ID )"
321319
322320if [ $PHP_VERSION_ID -ge 80500 ]; then
323- EXT_PMMPTHREAD_VERSION=" $EXT_PMMPTHREAD_VERSION_PHP85 "
324- EXT_XDEBUG_VERSION=" $EXT_XDEBUG_VERSION_PHP85 "
325321 EXT_IGBINARY_VERSION=" $EXT_IGBINARY_VERSION_PHP85 "
326322fi
327323if [ $PHP_VERSION_ID -ge 80400 ]; then
@@ -331,7 +327,7 @@ if [ "$HAVE_OPCACHE_JIT" == "yes" ]; then
331327 if [ $PHP_VERSION_ID -lt 80400 ]; then
332328 write_out " WARNING" " JIT in versions below PHP 8.4 is highly unstable and not recommended"
333329 else
334- write_out " WARNING" " JIT in PHP 8.4 has not been tested , use it with caution"
330+ write_out " WARNING" " JIT in PHP 8.4+ may be unstable , use it with caution"
335331 fi
336332else
337333 write_out " INFO" " JIT support in OPcache won't be compiled"
502498 exit 1
503499 elif [ -z " $CFLAGS " ]; then
504500 if [ ` getconf LONG_BIT` == " 64" ]; then
501+ COMPILE_TARGET=" linux64"
505502 write_out " INFO" " Compiling for current machine using 64-bit"
506503 if [ " $( uname -m) " != " aarch64" ]; then
507504 CFLAGS=" -m64 $CFLAGS "
@@ -515,9 +512,11 @@ else
515512fi
516513
517514if [ " $DO_STATIC " == " yes" ]; then
518- HAVE_OPCACHE=" no" # doesn't work on static builds
519- HAVE_OPCACHE_JIT=" no"
520- write_out " warning" " OPcache cannot be used on static builds; this may have a negative effect on performance"
515+ if [ " $PHP_VERSION_ID " -lt 80500 ]; then
516+ HAVE_OPCACHE=" no"
517+ HAVE_OPCACHE_JIT=" no"
518+ write_out " warning" " OPcache cannot be used on static builds prior to PHP 8.5; this may have a negative effect on performance"
519+ fi
521520 if [ " $FSANITIZE_OPTIONS " != " " ]; then
522521 write_out " warning" " Sanitizers cannot be used on static builds"
523522 fi
@@ -926,7 +925,7 @@ function build_gmp {
926925 download_from_mirror " gmp-$GMP_VERSION .tar.xz" " gmp" | tar -Jx >> " $DIR /install.log" 2>&1
927926 write_configure
928927 cd " $gmp_dir "
929- RANLIB=$RANLIB ./configure --prefix=" $INSTALL_DIR " \
928+ CFLAGS= " -std=gnu17 $CFLAGS " RANLIB=$RANLIB ./configure --prefix=" $INSTALL_DIR " \
930929 $EXTRA_FLAGS \
931930 --disable-posix-threads \
932931 --enable-static \
@@ -1473,7 +1472,32 @@ get_github_extension "rdkafka" "$EXT_RDKAFKA_VERSION" "arnaud-lb" "php-rdkafka"
14731472
14741473get_github_extension " zstd" " $EXT_ZSTD_VERSION " " kjdev" " php-ext-zstd"
14751474
1476- if [ " $( uname -s) " == " Darwin" ]; then
1475+ cafile=" "
1476+ if [[ " $COMPILE_TARGET " == " mac" * ]]; then
1477+ cafile=" /etc/ssl/cert.pem"
1478+ elif [[ " $COMPILE_TARGET " == " linux" * ]] && [[ " $IS_CROSSCOMPILE " != " yes" ]]; then
1479+ # try to detect the correct location from the current system
1480+ for file in \
1481+ " $SSL_CERT_FILE " \
1482+ " /etc/ssl/certs/ca-certificates.crt" \
1483+ " /etc/pki/tls/certs/ca-bundle-crt" \
1484+ " /etc/ssl/cert.pem" ;
1485+ do
1486+ if [ -f " $file " ]; then
1487+ cafile=" $file "
1488+ break
1489+ fi
1490+ done
1491+ else
1492+ echo " wtf $COMPILE_TARGET "
1493+ fi
1494+ if [ -z " $cafile " ]; then
1495+ write_out " WARNING" " Don't know where to find SSL CA bundle for this target; PHP code won't be able to safely access https:// links unless openssl.cafile is configured to the correct path in php.ini"
1496+ else
1497+ write_out " INFO" " System SSL CA bundle detected as $cafile ; if this is not correct, please adjust openssl.cafile in php.ini"
1498+ fi
1499+
1500+ if [[ " $COMPILE_TARGET " == " mac" * ]]; then
14771501 echo " [rdkafka] Implementing quick patch for MacOS support."
14781502
14791503 rm $BUILD_DIR /php/ext/rdkafka/config.m4 2>&1
@@ -1781,6 +1805,9 @@ echo "display_errors=1" >> "$INSTALL_DIR/bin/php.ini"
17811805echo " display_startup_errors=1" >> " $INSTALL_DIR /bin/php.ini"
17821806echo " recursionguard.enabled=0 ;disabled due to minor performance impact, only enable this if you need it for debugging" >> " $INSTALL_DIR /bin/php.ini"
17831807echo " extension_dir=./$INSTALL_DIR /lib/php/extensions/no-debug-zts-20230831" >> " $INSTALL_DIR /bin/php.ini"
1808+ if [ -n " $cafile " ]; then
1809+ echo " openssl.cafile=$cafile " >> " $INSTALL_DIR /bin/php.ini"
1810+ fi
17841811
17851812if [ " $HAVE_OPCACHE " == " yes" ]; then
17861813 if [ " $PHP_VERSION_ID " -lt 80500 ]; then
0 commit comments