Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions web-build/Dockerfile.php-patch-build
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#ddev-generated
ARG STATIC_PHP_EXTENSIONS
ARG STATIC_PHP_VERSION
ARG STATIC_PHP_CLI_VERSION=2.8.5

RUN (apt-get update || true) && DEBIAN_FRONTEND=noninteractive apt-get install -y -o Dpkg::Options::="--force-confnew" --no-install-recommends --no-install-suggests build-essential

Expand All @@ -18,14 +19,9 @@ update-alternatives --set php /usr/bin/php8.4
if update-alternatives --display php-fpm >/dev/null 2>&1; then update-alternatives --set php-fpm /usr/sbin/php-fpm8.4; else ln -sf /usr/sbin/php-fpm8.4 /usr/sbin/php-fpm; fi

mkdir -p /usr/local/src/static-php-cli && cd /usr/local/src/static-php-cli
# Resolve the latest tag from the release redirect to avoid the GitHub API rate limit
LATEST_RELEASE_URL="$(curl -fsSIL --retry 3 -o /dev/null -w '%{url_effective}' "https://github.com/crazywhalecc/static-php-cli/releases/latest")"
LATEST_RELEASE_TAG="${LATEST_RELEASE_URL##*/}"
if [[ ! "${LATEST_RELEASE_TAG}" =~ ^v?[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Unable to determine the latest static-php-cli release from '${LATEST_RELEASE_URL}'" >&2
exit 1
fi
git clone --branch "${LATEST_RELEASE_TAG}" --depth 1 https://github.com/crazywhalecc/static-php-cli.git .
# Pinned to 2.x: static-php-cli 3.0.0 builds OpenSSL 4.1, which PHP 8.1 can't compile against,
# and renames extension sources (apcu -> ext-apcu), which needs changes here
git clone --branch "${STATIC_PHP_CLI_VERSION}" --depth 1 https://github.com/crazywhalecc/static-php-cli.git .
composer update -n
chmod +x bin/spc
bin/spc doctor --auto-fix
Expand Down