{
"name": "php85-zts",
"version": "8.5.12",
"summary": "PHP 8.5 thread-safe (ZTS) with lib/libphp.so for FrankenPHP, side by side with the other branches (bin/php8.5-zts): the extensions of php85 without FPM",
"category": "language",
"license": "PHP-3.01",
"homepage": "https://www.php.net/",
"source": {
"url": "https://www.php.net/distributions/php-8.5.12.tar.xz",
"sha256": "08bc2eba2a588654ade1357174aa646b761556c862dda0678345ee29ed481209"
},
"watch": {"kind": "index", "url": "https://www.php.net/releases/index.php?json&max=1000&version=8", "regex": "\"(8\\.5\\.[0-9]+)\":\\{"},
"deps": [
"libxml2",
"libxslt",
"icu",
"oniguruma",
"openssl",
"sqlite",
"zlib",
"curl",
"libsodium",
"libzip",
"libpng",
"libjpeg-turbo",
"libwebp",
"freetype",
"gmp",
"bzip2",
"libpq",
"openldap"
],
"env_packages": [],
"static": false,
"nss": true,
"check": "b=8.5-zts && php=\"bin/php$b\" && [ \"$($php -r 'echo PHP_VERSION, \" \", PHP_ZTS, \" \", PHP_SAPI;')\" = \"8.5.12 1 cli\" ] && [ ! -e \"sbin/php-fpm$b\" ] && [ -f lib/libphp.so ] && t=$(mktemp -d) && chmod 755 \"$t\" && $php -m > \"$t/m\" && n=0 && for e in Core date libxml openssl pcre sqlite3 zlib bcmath bz2 calendar ctype curl dom exif fileinfo filter gd gmp hash iconv intl json ldap mbstring mysqli mysqlnd pcntl PDO pdo_mysql pdo_pgsql pdo_sqlite pgsql Phar posix Reflection session SimpleXML soap sockets sodium SPL standard sysvsem sysvshm tokenizer xml xmlreader xmlwriter xsl zip 'Zend OPcache'; do has -ix \"$e\" < \"$t/m\" || { echo \"php$b -m lists no $e\" >&2; exit 1; }; n=$((n + 1)); done && $php -i > \"$t/i\" && has -x 'Thread Safety => enabled' < \"$t/i\" && has -x 'Zend Max Execution Timers => enabled' < \"$t/i\" && has -x 'Zend Signal Handling => disabled' < \"$t/i\" && cat > \"$t/t.php\" <<'PHP' &&\nformat(1234.5) === \"1.234,5\"\n && (new Collator(\"sv_SE\"))->compare(\"ö\", \"z\") > 0;\n$d = new PDO(\"sqlite::memory:\");\n$d->exec(\"CREATE TABLE t(v)\");\n$d->exec(\"INSERT INTO t VALUES (1)\");\n$ok[\"pdo_sqlite\"] = $d->query(\"SELECT count(*) FROM t\")->fetchColumn() == 1;\n$ok[\"sqlite3\"] = (new SQLite3(\":memory:\"))->querySingle(\"SELECT 6 * 7\") == 42;\n$g = gd_info();\n$ok[\"gd_info\"] = $g[\"PNG Support\"] && $g[\"JPEG Support\"] && $g[\"WebP Support\"] && $g[\"FreeType Support\"];\n$im = imagecreatetruecolor(16, 16);\nimagefilledrectangle($im, 0, 0, 15, 15, imagecolorallocate($im, 200, 100, 50));\n$img = [];\nforeach ([\"png\" => [], \"jpeg\" => [95], \"webp\" => [100]] as $f => $a) {\n ob_start();\n (\"image\" . $f)($im, null, ...$a);\n $img[$f] = ob_get_clean();\n $r = @imagecreatefromstring($img[$f]);\n $c = $r ? imagecolorsforindex($r, imagecolorat($r, 8, 8)) : null;\n $ok[\"gd_\" . $f] = $c && abs($c[\"red\"] - 200) <= 6 && abs($c[\"green\"] - 100) <= 6 && abs($c[\"blue\"] - 50) <= 6;\n}\nfile_put_contents(\"$t/a.bdf\", \"STARTFONT 2.1\\nFONT -bvs-check-medium-r-normal--8-80-75-75-c-80-iso10646-1\\nSIZE 8 75 75\\nFONTBOUNDINGBOX 8 8 0 0\\nSTARTPROPERTIES 2\\nFONT_ASCENT 8\\nFONT_DESCENT 0\\nENDPROPERTIES\\nCHARS 1\\nSTARTCHAR A\\nENCODING 65\\nSWIDTH 1000 0\\nDWIDTH 8 0\\nBBX 8 8 0 0\\nBITMAP\\n18\\n24\\n42\\n42\\n7E\\n42\\n42\\n00\\nENDCHAR\\nENDFONT\\n\");\n$ft = imagecreatetruecolor(16, 16);\n$bb = @imagefttext($ft, 6, 0, 2, 10, imagecolorallocate($ft, 255, 255, 255), \"$t/a.bdf\", \"A\");\n$n = 0;\nfor ($x = 0; $x < 16; $x++) for ($y = 0; $y < 16; $y++) if (imagecolorat($ft, $x, $y) & 0xffffff) $n++;\n$ok[\"gd_freetype\"] = is_array($bb) && $n >= 10;\n$z = new ZipArchive();\n$ok[\"zip\"] = $z->open(\"$t/a.zip\", ZipArchive::CREATE | ZipArchive::OVERWRITE) === true\n && $z->addFromString(\"a.txt\", \"bvs zip\") && $z->setEncryptionName(\"a.txt\", ZipArchive::EM_AES_256, \"pw\")\n && $z->close() && $z->open(\"$t/a.zip\") === true && $z->setPassword(\"pw\")\n && $z->getFromName(\"a.txt\") === \"bvs zip\" && $z->close();\n$e = \"Exif\\0\\0II*\\0\\x08\\0\\0\\0\\x01\\0\\x0f\\x01\\x02\\0\\x04\\0\\0\\0BVS\\0\\0\\0\\0\\0\";\n$x = @exif_read_data(\"data://image/jpeg;base64,\" . base64_encode(\"\\xff\\xd8\\xff\\xe1\" . pack(\"n\", strlen($e) + 2) . $e . substr($img[\"jpeg\"], 2)));\n$ok[\"exif\"] = is_array($x) && ($x[\"Make\"] ?? \"\") === \"BVS\";\n$ok[\"bcmath\"] = bcadd(\"12345678901234567890\", \"1\") === \"12345678901234567891\" && bcpow(\"2\", \"64\") === \"18446744073709551616\";\n$ok[\"gmp\"] = gmp_strval(gmp_pow(2, 100)) === \"1267650600228229401496703205376\" && gmp_strval(gmp_invert(3, 11)) === \"4\";\n$k = sodium_crypto_secretbox_keygen();\n$nc = random_bytes(SODIUM_CRYPTO_SECRETBOX_NONCEBYTES);\n$ok[\"sodium\"] = sodium_crypto_secretbox_open(sodium_crypto_secretbox(\"bvs\", $nc, $k), $nc, $k) === \"bvs\";\n$pk = openssl_pkey_new([\"private_key_type\" => OPENSSL_KEYTYPE_EC, \"curve_name\" => \"prime256v1\"]);\n$pub = $pk ? openssl_pkey_get_details($pk)[\"key\"] : \"\";\n$ok[\"openssl\"] = $pk && openssl_sign(\"bvs\", $sig, $pk, OPENSSL_ALGO_SHA256)\n && openssl_verify(\"bvs\", $sig, $pub, OPENSSL_ALGO_SHA256) === 1 && openssl_verify(\"bvx\", $sig, $pub, OPENSSL_ALGO_SHA256) === 0;\n$s = str_repeat(\"bvs zlib and bz2 \", 100);\n$ok[\"zlib\"] = gzdecode(gzencode($s, 9)) === $s && strlen(gzencode($s, 9)) < 200;\n$ok[\"bz2\"] = bzdecompress(bzcompress($s, 9)) === $s;\nfile_put_contents(\"$t/c.txt\", \"bvs curl\");\n$c = curl_init(\"file://$t/c.txt\");\ncurl_setopt($c, CURLOPT_RETURNTRANSFER, true);\n$ok[\"curl\"] = curl_exec($c) === \"bvs curl\" && str_contains(curl_version()[\"ssl_version\"], \"OpenSSL\");\nfunction bvs_add($a, $b) { return $a + $b; }\n$ss = new SoapServer(null, [\"uri\" => \"urn:bvs\"]);\n$ss->addFunction(\"bvs_add\");\nob_start();\n$ss->handle(\"240\");\n$ok[\"soap\"] = str_contains(ob_get_clean(), \">42\");\n$ok[\"sockets\"] = socket_create_pair(AF_UNIX, SOCK_STREAM, 0, $sp) && socket_write($sp[0], \"bvs\") === 3 && socket_read($sp[1], 3) === \"bvs\";\n$xd = new DOMDocument();\n$xd->loadXML(\"bvs\");\n$xs = new DOMDocument();\n$xs->loadXML(\"[]\");\n$xp = new XSLTProcessor();\n$xp->importStylesheet($xs);\n$ok[\"xsl\"] = $xp->transformToXML($xd) === \"[bvs]\" && (string) simplexml_load_string(\"x\")->b === \"x\";\n$ok[\"fileinfo\"] = (new finfo(FILEINFO_MIME_TYPE))->buffer($img[\"png\"]) === \"image/png\";\n$l = ldap_connect(\"ldap://127.0.0.1:$p\");\nldap_set_option($l, LDAP_OPT_PROTOCOL_VERSION, 3);\nldap_set_option($l, LDAP_OPT_NETWORK_TIMEOUT, 3);\n$ok[\"ldap\"] = $l && !@ldap_bind($l, \"cn=bvs\", \"x\") && ldap_errno($l) === -1 && ldap_escape(\"a*(b)\", \"\", LDAP_ESCAPE_FILTER) === \"a\\\\2a\\\\28b\\\\29\";\n$ok[\"pgsql\"] = @pg_connect(\"host=127.0.0.1 port=$p dbname=bvs connect_timeout=3\", PGSQL_CONNECT_FORCE_NEW) === false;\ntry {\n new PDO(\"pgsql:host=127.0.0.1;port=$p;dbname=bvs;connect_timeout=3\", \"bvs\", \"x\");\n $ok[\"pdo_pgsql\"] = false;\n} catch (PDOException $ex) {\n $ok[\"pdo_pgsql\"] = str_contains($ex->getMessage(), \"127.0.0.1\");\n}\ntry {\n new PDO(\"mysql:host=127.0.0.1;port=$p;dbname=bvs\", \"bvs\", \"x\", [PDO::ATTR_TIMEOUT => 3]);\n $ok[\"pdo_mysql\"] = false;\n} catch (PDOException $ex) {\n $ok[\"pdo_mysql\"] = $ex->getCode() == 2002;\n}\nmysqli_report(MYSQLI_REPORT_OFF);\n$my = mysqli_init();\n$ok[\"mysqli\"] = @$my->real_connect(\"127.0.0.1\", \"bvs\", \"x\", \"bvs\", $p) === false && $my->connect_errno === 2002;\n$ok[\"calendar\"] = cal_days_in_month(CAL_GREGORIAN, 2, 2024) === 29;\nif (PHP_VERSION_ID < 80400) {\n file_put_contents(\"$t/mbox\", \"From bvs@example.org Sat Sep 26 12:00:00 2026\\nFrom: bvs@example.org\\nSubject: bvs imap check\\n\\nhello\\n\");\n $m = imap_open(\"$t/mbox\", \"\", \"\", OP_READONLY);\n $ok[\"imap\"] = $m && imap_num_msg($m) === 1 && imap_headerinfo($m, 1)->subject === \"bvs imap check\";\n}\n$bad = array_keys(array_filter($ok, fn($v) => !$v));\necho $bad ? \"failed: \" . implode(\" \", $bad) . \"\\n\" : \"php ok \" . count($ok) . \"\\n\";\nPHP\ncat > \"$t/embed.c\" <<'C' &&\n#include \nint main(int argc, char **argv) {\n volatile int r = 1;\n PHP_EMBED_START_BLOCK(argc, argv)\n zval v;\n if (zend_eval_string(\"PHP_VERSION . ' ' . PHP_SAPI . ' ' . PHP_ZTS . ' ' . (extension_loaded('intl') && extension_loaded('Zend OPcache') ? 'ok' : 'missing')\", &v, \"bvs\") == SUCCESS && Z_TYPE(v) == IS_STRING) {\n printf(\"%s\\n\", Z_STRVAL(v));\n zval_ptr_dtor(&v);\n r = 0;\n }\n PHP_EMBED_END_BLOCK()\n return r;\n}\nC\nq=$(free_port) && $php \"$t/t.php\" \"$t\" \"$q\" > \"$t/t.out\" 2>&1 && has -Ex 'php ok [0-9]+' < \"$t/t.out\" && k=$(sed -n 's/^php ok //p' \"$t/t.out\") && $CC $CFLAGS $(bin/php-config$b --includes) -o \"$t/embed\" \"$t/embed.c\" $LDFLAGS -lphp > \"$t/cc.out\" 2>&1 && o=$(\"$t/embed\" 2>&1) && [ \"$o\" = \"8.5.12 embed 1 ok\" ]; r=$?; [ $r = 0 ] || cat \"$t/t.out\" \"$t/cc.out\" >&2 2> /dev/null; [ $r = 0 ] || echo \"embed: ${o:-}\" >&2; rm -rf -- \"${t:?}\"; [ $r = 0 ] && echo \"PHP 8.5.12 thread-safe (ZTS), its CLI and libphp.so: php$b -m lists the $n extensions asserted; thread safety and Zend max execution timers on, Zend signal handling off; $k checks of the CLI pass (those of php85); a program linked with lib/libphp.so ran PHP through the embed SAPI with intl and OPcache loaded\"; exit $r"
}