Skip to content

Commit

Permalink
Add support for arm runners
Browse files Browse the repository at this point in the history
  • Loading branch information
shivammathur committed Jan 18, 2025
1 parent 7819a4a commit c6d74cb
Show file tree
Hide file tree
Showing 93 changed files with 107 additions and 46 deletions.
96 changes: 64 additions & 32 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,61 @@ on:
jobs:
build-php:
if: "!contains(github.event.head_commit.message, 'skip-build-php')"
name: Build PHP ${{ matrix.php-versions }}
runs-on: ubuntu-latest
name: Build PHP ${{ matrix.php-versions }} on ${{ matrix.containers }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
php-versions: [5.3, 5.4, 5.5]
include:
- php-versions: 5.3
containers: ubuntu:trusty
arch-suffix: ''
os: ubuntu-24.04
- php-versions: 5.4
containers: ubuntu:trusty
arch-suffix: ''
os: ubuntu-24.04
- php-versions: 5.5
containers: ubuntu:trusty
arch-suffix: ''
os: ubuntu-24.04
- php-versions: 5.3
containers: arm64v8/ubuntu:trusty
arch-suffix: '-arm64'
os: ubuntu-24.04-arm
- php-versions: 5.4
containers: arm64v8/ubuntu:trusty
arch-suffix: '-arm64'
os: ubuntu-24.04-arm
- php-versions: 5.5
containers: arm64v8/ubuntu:trusty
arch-suffix: '-arm64'
os: ubuntu-24.04-arm
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Cache Docker layers
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-docker-php-${{ matrix.php-versions }}-${{ github.run_id }}-${{ github.run_number }}
restore-keys: ${{ runner.os }}-docker-php-${{ matrix.php-versions }}
key: ${{ runner.os }}-docker-php-${{ matrix.php-versions }}${{ matrix.arch-suffix }}-${{ github.run_id }}-${{ github.run_number }}
restore-keys: ${{ runner.os }}-docker-php-${{ matrix.php-versions }}${{ matrix.arch-suffix }}

- name: Build
uses: docker/build-push-action@v2
uses: docker/build-push-action@v6
with:
context: .
tags: php-${{ matrix.php-versions }}
build-args: PHP_VERSION=${{ matrix.php-versions }}
tags: php-${{ matrix.php-versions }}${{ matrix.arch-suffix }}
build-args: |
PHP_VERSION=${{ matrix.php-versions }}
UBUNTU_VERSION=${{ matrix.containers }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
outputs: type=docker,dest=/tmp/php-${{ matrix.php-versions }}.tar
outputs: type=docker,dest=/tmp/php-${{ matrix.php-versions }}${{ matrix.arch-suffix }}.tar

# https://github.com/docker/build-push-action/issues/252
- name: Move build cache
Expand All @@ -45,10 +71,10 @@ jobs:
env:
PHP_VERSION: ${{ matrix.php-versions }}
run: |
docker load --input /tmp/php-$PHP_VERSION.tar
docker run --name=php-$PHP_VERSION php-$PHP_VERSION sh -c exit
docker load --input /tmp/php-$PHP_VERSION${{ matrix.arch-suffix }}.tar
docker run --name=php-$PHP_VERSION${{ matrix.arch-suffix }} php-$PHP_VERSION${{ matrix.arch-suffix }} sh -c exit
sudo chmod 777 /usr/local
docker cp php-$PHP_VERSION:/usr/local/php /usr/local/php
docker cp php-$PHP_VERSION${{ matrix.arch-suffix }}:/usr/local/php /usr/local/php
- name: Package and ship artifact to releases
run: bash scripts/build.sh ship
Expand All @@ -60,10 +86,10 @@ jobs:
USER: ${{ github.repository_owner }}

- name: Upload artifact to workflow
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: php${{ matrix.php-versions }}
path: ${{ github.workspace }}/php-${{ matrix.php-versions }}-build.tar.zst
name: php${{ matrix.php-versions }}${{ matrix.arch-suffix }}
path: ${{ github.workspace }}/php-${{ matrix.php-versions }}-build${{ matrix.arch-suffix }}.tar.zst
test:
needs: build-php
if: ${{ always() }}
Expand All @@ -72,17 +98,19 @@ jobs:
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-24.04, ubuntu-22.04, ubuntu-20.04]
php-versions: ['5.3', '5.4', '5.5']
php-versions: [5.3, 5.4, 5.5]
operating-system: [ubuntu-24.04, ubuntu-22.04, ubuntu-20.04, ubuntu-22.04-arm, ubuntu-24.04-arm]
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Stage PHP
run: |
bash scripts/version-files.sh ${{ matrix.php-versions }}
bash scripts/stage.sh ${{ matrix.php-versions }}
gh release download -p 'php-${{ matrix.php-versions }}-build.tar.zst' -D php-${{ matrix.php-versions }}
arch="$(arch)"
[[ "$arch" = "arm64" || "$arch" = "aarch64" ]] && arch_suffix="-arm64" || arch_suffix=""
gh release download -p "php-${{ matrix.php-versions }}-build$arch_suffix.tar.zst" -D php-${{ matrix.php-versions }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down Expand Up @@ -126,14 +154,15 @@ jobs:
name: Update dist
if: "!contains(github.event.head_commit.message, 'skip-release')"
needs: [build-php, test]
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
php-versions: ['5.3', '5.4', '5.5']
os: [ubuntu-24.04, ubuntu-24.04-arm]
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Add ZSTD
env:
REPO: ${{ github.repository }}
Expand All @@ -145,29 +174,32 @@ jobs:
mkdir builds
bash scripts/version-files.sh "$PHP_VERSION"
bash scripts/stage.sh "$PHP_VERSION"
gh release download -p php-"$PHP_VERSION"-build.tar.zst -D php-"$PHP_VERSION"
sudo XZ_OPT=-e9 tar cfJ php-"$PHP_VERSION".tar.xz php-"$PHP_VERSION"
sudo tar cf - php-"$PHP_VERSION" | zstd -22 -T0 --ultra > php-"$PHP_VERSION".tar.zst
mv php-"$PHP_VERSION".tar.* ./builds/
arch="$(arch)"
[[ "$arch" = "arm64" || "$arch" = "aarch64" ]] && arch_suffix="-arm64" || arch_suffix=""
gh release download -p php-"$PHP_VERSION"-build"$arch_suffix".tar.zst -D php-"$PHP_VERSION"
sudo XZ_OPT=-e9 tar cfJ php-"$PHP_VERSION$arch_suffix".tar.xz php-"$PHP_VERSION"
sudo tar cf - php-"$PHP_VERSION" | zstd -22 -T0 --ultra > php-"$PHP_VERSION$arch_suffix".tar.zst
mv php-"$PHP_VERSION$arch_suffix".tar.* ./builds/
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PHP_VERSION: ${{ matrix.php-versions }}
- name: Upload Artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: builds
name: builds-${{ matrix.php-versions }}-${{ matrix.os }}
path: builds
release:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'skip-release')"
needs: [build-php, test, package]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: mkdir builds
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v4
with:
name: builds
pattern: builds-*
path: builds
merge-multiple: true
- name: Release
run: |
set -x
Expand Down
13 changes: 7 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG UBUNTU_VERSION=trusty
ARG UBUNTU_VERSION=ubuntu:trusty
ARG PHP_VERSION=5.3
FROM ubuntu:$UBUNTU_VERSION AS base
FROM $UBUNTU_VERSION AS base

ENV DEBIAN_FRONTEND=noninteractive
ENV LC_ALL=C.UTF-8
Expand All @@ -15,18 +15,19 @@ RUN apt-get update && apt-get install -y wget ca-certificates \
FROM base AS deps
RUN apt-get update && apt-get install -y --no-install-recommends sudo curl software-properties-common
RUN add-apt-repository ppa:ubuntu-toolchain-r/test
RUN apt-get update && apt-get install -y --no-install-recommends apache2-mpm-prefork apache2-dev build-essential automake autoconf bison chrpath dpkg-dev flex bzip2 git m4 make libstdc++6-4.7-dev gcc-4.7 g++-4.7 gettext expect imagemagick libmagickwand-dev locales language-pack-de re2c mysql-server postgresql pkg-config libc-client2007e-dev libcurl4-gnutls-dev libacl1-dev libapache2-mod-php5 libapr1-dev libasn1-8-heimdal libattr1-dev libblkid1 libbz2-dev libc6 libcap2 libc-bin libclass-isa-perl libcomerr2 libdb-dev libdbus-1-3 libdebian-installer4 libdrm2 libdrm-intel1 libdrm-nouveau2 libdrm-radeon1 libevent-dev libexpat1-dev libenchant-dev libffi-dev libfreetype6-dev libgcc1 libgcrypt11-dev libgearman-dev libqdbm-dev libglib2.0-0 libgnutls-dev libgpg-error0 libgssapi3-heimdal libgssapi-krb5-2 libgmp-dev libhcrypto4-heimdal libheimbase1-heimdal libheimntlm0-heimdal libhx509-5-heimdal libidn11-dev libk5crypto3 libkeyutils1 libklibc libkrb5-26-heimdal libkrb5-dev libkrb5support0 libldb-dev libldap2-dev libltdl-dev liblzma-dev libmagic-dev libmount-dev libonig-dev libmysqlclient-dev libncurses5-dev libncursesw5 libnewt-dev libnih-dev libnih-dbus1 libodbc1 libp11-kit0 libpam0g libpam-modules libpam-modules-bin libpciaccess0 libpcre3-dev libplymouth-dev libpng12-dev libjpeg-dev libmcrypt-dev libmhash-dev libpspell-dev libpthread-stubs0-dev libpq-dev libreadline-dev librecode-dev libroken18-heimdal libsasl2-dev libselinux1-dev libslang2-dev libsqlite0-dev libsqlite3-dev libssl-dev libswitch-perl libsybdb5 libtasn1-6 libtextwrap-dev libtidy-dev libtinfo-dev libudev-dev libuuid1 libwind0-heimdal libxml2-dev libxpm-dev libxslt1-dev libzip-dev unixodbc-dev zlib1g
RUN apt-get update && apt-get install -y --no-install-recommends apache2-mpm-prefork apache2-dev build-essential automake autoconf bison chrpath dpkg-dev flex bzip2 git m4 make libstdc++6-4.7-dev gcc-4.7 g++-4.7 gettext expect imagemagick libmagickwand-dev locales language-pack-de re2c mysql-server postgresql pkg-config libc-client2007e-dev libcurl4-gnutls-dev libacl1-dev libapache2-mod-php5 libapr1-dev libasn1-8-heimdal libattr1-dev libblkid1 libbz2-dev libc6 libcap2 libc-bin libclass-isa-perl libcomerr2 libdb-dev libdbus-1-3 libdebian-installer4 libevent-dev libexpat1-dev libenchant-dev libffi-dev libfreetype6-dev libgcc1 libgcrypt11-dev libgearman-dev libqdbm-dev libglib2.0-0 libgnutls-dev libgpg-error0 libgssapi3-heimdal libgssapi-krb5-2 libgmp-dev libhcrypto4-heimdal libheimbase1-heimdal libheimntlm0-heimdal libhx509-5-heimdal libidn11-dev libk5crypto3 libkeyutils1 libklibc libkrb5-26-heimdal libkrb5-dev libkrb5support0 libldb-dev libldap2-dev libltdl-dev liblzma-dev libmagic-dev libmount-dev libonig-dev libmysqlclient-dev libncurses5-dev libncursesw5 libnewt-dev libnih-dev libnih-dbus1 libodbc1 libp11-kit0 libpam0g libpam-modules libpam-modules-bin libpciaccess0 libpcre3-dev libplymouth-dev libpng12-dev libjpeg-dev libmcrypt-dev libmhash-dev libpspell-dev libpthread-stubs0-dev libpq-dev libreadline-dev librecode-dev libroken18-heimdal libsasl2-dev libselinux1-dev libslang2-dev libsqlite0-dev libsqlite3-dev libssl-dev libswitch-perl libsybdb5 libtasn1-6 libtextwrap-dev libtidy-dev libtinfo-dev libudev-dev libuuid1 libwind0-heimdal libxml2-dev libxpm-dev libxslt1-dev libzip-dev unixodbc-dev zlib1g
RUN set -x \
&& arch="$(uname -m)" \
&& sed -i '/^mozilla\/DST_Root_CA_X3/s/^/!/' /etc/ca-certificates.conf \
&& update-ca-certificates -f \
&& update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.7 4 \
&& update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.7 4 \
&& find /usr/lib/x86_64-linux-gnu -maxdepth 1 -name "*.so" -printf "%f\n" | xargs -I@ ln -sf /usr/lib/x86_64-linux-gnu/@ /usr/lib/@ \
&& ln -sf /usr/lib/libc-client.so.2007e.0 /usr/lib/x86_64-linux-gnu/libc-client.a \
&& find /usr/lib/"$arch"-linux-gnu -maxdepth 1 -name "*.so" -printf "%f\n" | xargs -I@ ln -sf /usr/lib/"$arch"-linux-gnu/@ /usr/lib/@ \
&& ln -sf /usr/lib/libc-client.so.2007e.0 /usr/lib/"$arch"-linux-gnu/libc-client.a \
&& mkdir -p /usr/c-client/ /usr/include/freetype2/freetype \
&& ln -sf /usr/lib/libc-client.so.2007e.0 /usr/c-client/libc-client.a \
&& ln -sf /usr/include/qdbm/* /usr/include/ \
&& ln -sf /usr/include/x86_64-linux-gnu/gmp.h /usr/include/gmp.h \
&& ln -sf /usr/include/"$arch"-linux-gnu/gmp.h /usr/include/gmp.h \
&& ln -sf /usr/include/freetype2/freetype.h /usr/include/freetype2/freetype/freetype.h \
&& exit 0

Expand Down
Binary file not shown.
Binary file not shown.
Binary file added deps/20.04/libjpeg8_8c-2ubuntu8_arm64.deb
Binary file not shown.
Binary file not shown.
Binary file added deps/20.04/multiarch-support_2.28-10_arm64
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added deps/22.04/libidn11_1.33-2.2ubuntu2_arm64.deb
Binary file not shown.
Binary file added deps/22.04/libjpeg8_8c-2ubuntu10_arm64.deb
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added deps/22.04/libmcrypt4_2.5.8-3.4_arm64.deb
Binary file not shown.
Binary file added deps/22.04/libodbc1_2.3.9-5_arm64.deb
Binary file not shown.
Binary file added deps/22.04/libodbccr2_2.3.9-5_arm64.deb
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added deps/22.04/libsqlite3-0_3.37.2-2_arm64.deb
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added deps/22.04/multiarch-support_2.28-10_arm64
Binary file not shown.
File renamed without changes.
Binary file added deps/22.04/usrmerge_25ubuntu2_all_arm64.deb
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed deps/24.04/libdeflate-dev_1.19-1build1_amd64.deb
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added deps/24.04/libidn11_1.33-2.2ubuntu2_arm64.deb
Binary file not shown.
Binary file added deps/24.04/libjbig-dev_2.1-6.1ubuntu2_arm64.deb
Binary file not shown.
Binary file added deps/24.04/libjpeg-dev_8c-2ubuntu11_arm64.deb
Binary file not shown.
Binary file not shown.
Binary file added deps/24.04/libjpeg8-dev_8c-2ubuntu11_arm64.deb
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added deps/24.04/libmcrypt4_2.5.8-3.4_arm64.deb
Binary file not shown.
Binary file added deps/24.04/libodbc1_2.3.9-5_arm64.deb
Binary file not shown.
Binary file added deps/24.04/libodbc2_2.3.9-5_arm64.deb
Binary file not shown.
Binary file added deps/24.04/libodbccr2_2.3.9-5_arm64.deb
Binary file not shown.
Binary file added deps/24.04/libpcre16-3_8.39-15_arm64.deb
Binary file not shown.
Binary file added deps/24.04/libpcre32-3_8.39-15_arm64.deb
Binary file not shown.
Binary file added deps/24.04/libpcre3_8.39-15_arm64.deb
Binary file not shown.
Binary file added deps/24.04/libpcrecpp0v5_8.39-15_arm64.deb
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added deps/24.04/libtiff-dev_4.3.0-6_arm64.deb
Binary file not shown.
Binary file added deps/24.04/libtiff5-dev_4.3.0-6_arm64.deb
Binary file not shown.
Binary file added deps/24.04/libtiff5_4.3.0-6_arm64.deb
Binary file not shown.
Binary file added deps/24.04/libtiffxx5_4.3.0-6_arm64.deb
Binary file not shown.
Binary file not shown.
Binary file added deps/24.04/libwebp-dev_1.3.2-0.4build3_arm64.deb
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added deps/24.04/multiarch-support_2.28-10_arm64
Binary file not shown.
Binary file added deps/all/libdb5.1_5.1.29-7ubuntu1_arm64.deb
Binary file not shown.
Binary file not shown.
Binary file added deps/all/libgearman7_1.0.6-3_arm64.deb
Binary file not shown.
Binary file added deps/all/libicu52_52.1-3ubuntu0.8_arm64.deb
Binary file not shown.
Binary file not shown.
Binary file added deps/all/liblcms1_1.19.dfsg-1.2ubuntu5_arm64.deb
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added deps/all/libonig2_5.9.6-1ubuntu0.1_arm64.deb
Binary file not shown.
Binary file added deps/all/libreadline6_6.3-8ubuntu2_arm64.deb
Binary file not shown.
Binary file not shown.
Binary file added deps/all/libssl1.0.0_1.0.2n-1ubuntu5_arm64.deb
Binary file not shown.
Binary file added deps/all/libt1-5_5.1.2-3.6ubuntu1_arm64.deb
Binary file not shown.
Binary file added deps/all/libtidy-0.99-0_20091223cvs-1.5_arm64.deb
Binary file not shown.
Binary file added deps/all/libtiff4_3.9.6-9ubuntu1.2_amd64.deb
Binary file not shown.
8 changes: 8 additions & 0 deletions scripts/build-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ install_pkg() {
pkg_dir=$1
(
cd "$pkg_dir" || exit 1
fix_config_files
sudo ./configure --prefix=/usr
sudo make -j"$(nproc)"
sudo make install DESTDIR="$DESTDIR"
Expand All @@ -25,13 +26,20 @@ add_openssl() {
tar -xzf /tmp/openssl.tar.gz -C /tmp
(
cd /tmp/openssl-1.0.2u || exit 1
fix_config_files
./config --prefix=/usr --openssldir=/etc/ssl --libdir=lib/openssl-1.0 shared zlib-dynamic
make depend
sudo make -j"$(nproc)"
sudo make install INSTALL_PREFIX="$DESTDIR"
)
}

fix_config_files() {
for conf_file in config.guess config.sub; do
find . -name "$conf_file" -exec cp /usr/share/automake-*/"$conf_file" {} \;
done
}

mode="${1:-all}"
DESTDIR="${2:-}"

Expand Down
8 changes: 8 additions & 0 deletions scripts/build-extensions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ build_extension() {
(
cd "$source_dir" || exit
phpize
fix_config_files
sudo ./configure "${args[@]}" --with-php-config="$install_dir"/bin/php-config
sudo make -j"$(nproc)"
sudo make install
Expand All @@ -26,6 +27,7 @@ build_lib() {
mkdir "$install_dir"/lib/"$lib"
(
cd "$source_dir" || exit
fix_config_files
sudo ./configure --prefix="$install_dir"/lib/"$lib" "$@"
sudo make -j"$(nproc)"
sudo make install
Expand Down Expand Up @@ -140,6 +142,12 @@ add_redis() {
build_extension redis /tmp/redis-"$REDIS_VERSION" extension 20 --enable-redis --enable-redis-igbinary
}

fix_config_files() {
for conf_file in config.guess config.sub; do
find . -name "$conf_file" -exec cp /usr/share/automake-*/"$conf_file" {} \;
done
}

PHP_VERSION=${PHP_VERSION:-'5.3'}
APCU_VERSION='4.0.11'
AMQP_VERSION='1.9.3'
Expand Down
8 changes: 5 additions & 3 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,15 @@ build_extensions() {

build_and_ship_package() {
bash scripts/install-zstd.sh
arch="$(arch)"
[[ "$arch" = "arm64" || "$arch" = "aarch64" ]] && arch_suffix="-arm64" || arch_suffix=""
(
cd "$install_dir"/.. || exit
sudo tar cf - "$PHP_VERSION" | zstd -22 -T0 --ultra > "$GITHUB_WORKSPACE"/php-"$PHP_VERSION"-build.tar.zst
sudo tar cf - "$PHP_VERSION" | zstd -22 -T0 --ultra > "$GITHUB_WORKSPACE"/php-"$PHP_VERSION"-build"$arch_suffix".tar.zst
)
gh release download -p "release.log" || true
echo "$(date "+%Y-%m-%d %H:%M:%S") Update php-$PHP_VERSION-build.tar.zst" | sudo tee -a release.log >/dev/null 2>&1
gh release upload "builds" release.log "php-$PHP_VERSION-build.tar.zst" --clobber
echo "$(date "+%Y-%m-%d %H:%M:%S") Update php-$PHP_VERSION-build$arch_suffix.tar.zst" | sudo tee -a release.log >/dev/null 2>&1
gh release upload "builds" release.log "php-$PHP_VERSION-build$arch_suffix.tar.zst" --clobber
}

mode="${1:-all}"
Expand Down
16 changes: 12 additions & 4 deletions scripts/install-php.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,16 @@
debconf_fix="DEBIAN_FRONTEND=noninteractive"
dpkg_install="sudo $debconf_fix dpkg -i --force-conflicts --force-overwrite"
sudo mkdir -p /var/run /run/php /usr/local/php /usr/lib/systemd/system /usr/lib/cgi-bin /var/www/html
[[ "$VERSION_ID" = "20.04" || "$VERSION_ID" = "22.04" || $VERSION_ID = "24.04" ]] && $dpkg_install ./deps/"$VERSION_ID"/multiarch-support_2.28-10_amd64
$dpkg_install ./deps/"$VERSION_ID"/*.deb
$dpkg_install ./deps/all/*.deb
sudo tar -I zstd -xf ./php-@PHP_VERSION@-build.tar.zst -C /usr/local/php
arch="$(arch)"
if [[ "$arch" = "arm64" || "$arch" = "aarch64" ]]; then
arch="arm64";
arch_name="-arm64";
else
arch="amd64"
arch_name=""
fi
[[ "$VERSION_ID" = "20.04" || "$VERSION_ID" = "22.04" || $VERSION_ID = "24.04" ]] && $dpkg_install ./deps/"$VERSION_ID"/multiarch-support_2.28-10_"$arch"
$dpkg_install ./deps/"$VERSION_ID"/*_"$arch".deb
$dpkg_install ./deps/all/*_"$arch".deb
sudo tar -I zstd -xf ./php-@PHP_VERSION@-build"$arch_name".tar.zst -C /usr/local/php
sudo ln -sf /usr/local/php/@PHP_VERSION@/etc/php.ini /etc/php.ini
4 changes: 3 additions & 1 deletion scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ install() {
)
}

tar_file="php-$1.tar.zst"
arch="$(arch)"
[[ "$arch" = "arm64" || "$arch" = "aarch64" ]] && arch_suffix="-arm64" || arch_suffix=""
tar_file="php-$1$arch_suffix.tar.zst"
php_dir="/tmp/php-$1"
install

0 comments on commit c6d74cb

Please sign in to comment.