Skip to content

Commit 0dcff08

Browse files
committed
Add support for arm runners
1 parent 7819a4a commit 0dcff08

File tree

105 files changed

+107
-46
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+107
-46
lines changed

.github/workflows/ci.yml

+64-32
Original file line numberDiff line numberDiff line change
@@ -5,35 +5,61 @@ on:
55
jobs:
66
build-php:
77
if: "!contains(github.event.head_commit.message, 'skip-build-php')"
8-
name: Build PHP ${{ matrix.php-versions }}
9-
runs-on: ubuntu-latest
8+
name: Build PHP ${{ matrix.php-versions }} on ${{ matrix.containers }}
9+
runs-on: ${{ matrix.os }}
1010
strategy:
1111
fail-fast: false
1212
matrix:
13-
php-versions: [5.3, 5.4, 5.5]
13+
include:
14+
- php-versions: 5.3
15+
containers: ubuntu:trusty
16+
arch-suffix: ''
17+
os: ubuntu-24.04
18+
- php-versions: 5.4
19+
containers: ubuntu:trusty
20+
arch-suffix: ''
21+
os: ubuntu-24.04
22+
- php-versions: 5.5
23+
containers: ubuntu:trusty
24+
arch-suffix: ''
25+
os: ubuntu-24.04
26+
- php-versions: 5.3
27+
containers: arm64v8/ubuntu:trusty
28+
arch-suffix: '-arm64'
29+
os: ubuntu-24.04-arm
30+
- php-versions: 5.4
31+
containers: arm64v8/ubuntu:trusty
32+
arch-suffix: '-arm64'
33+
os: ubuntu-24.04-arm
34+
- php-versions: 5.5
35+
containers: arm64v8/ubuntu:trusty
36+
arch-suffix: '-arm64'
37+
os: ubuntu-24.04-arm
1438
steps:
1539
- name: Checkout
16-
uses: actions/checkout@v3
40+
uses: actions/checkout@v4
1741

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

2145
- name: Cache Docker layers
22-
uses: actions/cache@v2
46+
uses: actions/cache@v4
2347
with:
2448
path: /tmp/.buildx-cache
25-
key: ${{ runner.os }}-docker-php-${{ matrix.php-versions }}-${{ github.run_id }}-${{ github.run_number }}
26-
restore-keys: ${{ runner.os }}-docker-php-${{ matrix.php-versions }}
49+
key: ${{ runner.os }}-docker-php-${{ matrix.php-versions }}${{ matrix.arch-suffix }}-${{ matrix.os }}-${{ github.run_id }}-${{ github.run_number }}
50+
restore-keys: ${{ runner.os }}-docker-php-${{ matrix.php-versions }}${{ matrix.arch-suffix }}-${{ matrix.os }}
2751

2852
- name: Build
29-
uses: docker/build-push-action@v2
53+
uses: docker/build-push-action@v6
3054
with:
3155
context: .
32-
tags: php-${{ matrix.php-versions }}
33-
build-args: PHP_VERSION=${{ matrix.php-versions }}
56+
tags: php-${{ matrix.php-versions }}${{ matrix.arch-suffix }}
57+
build-args: |
58+
PHP_VERSION=${{ matrix.php-versions }}
59+
UBUNTU_VERSION=${{ matrix.containers }}
3460
cache-from: type=local,src=/tmp/.buildx-cache
3561
cache-to: type=local,dest=/tmp/.buildx-cache-new
36-
outputs: type=docker,dest=/tmp/php-${{ matrix.php-versions }}.tar
62+
outputs: type=docker,dest=/tmp/php-${{ matrix.php-versions }}${{ matrix.arch-suffix }}.tar
3763

3864
# https://github.com/docker/build-push-action/issues/252
3965
- name: Move build cache
@@ -45,10 +71,10 @@ jobs:
4571
env:
4672
PHP_VERSION: ${{ matrix.php-versions }}
4773
run: |
48-
docker load --input /tmp/php-$PHP_VERSION.tar
49-
docker run --name=php-$PHP_VERSION php-$PHP_VERSION sh -c exit
74+
docker load --input /tmp/php-$PHP_VERSION${{ matrix.arch-suffix }}.tar
75+
docker run --name=php-$PHP_VERSION${{ matrix.arch-suffix }} php-$PHP_VERSION${{ matrix.arch-suffix }} sh -c exit
5076
sudo chmod 777 /usr/local
51-
docker cp php-$PHP_VERSION:/usr/local/php /usr/local/php
77+
docker cp php-$PHP_VERSION${{ matrix.arch-suffix }}:/usr/local/php /usr/local/php
5278
5379
- name: Package and ship artifact to releases
5480
run: bash scripts/build.sh ship
@@ -60,10 +86,10 @@ jobs:
6086
USER: ${{ github.repository_owner }}
6187

6288
- name: Upload artifact to workflow
63-
uses: actions/upload-artifact@v2
89+
uses: actions/upload-artifact@v4
6490
with:
65-
name: php${{ matrix.php-versions }}
66-
path: ${{ github.workspace }}/php-${{ matrix.php-versions }}-build.tar.zst
91+
name: php${{ matrix.php-versions }}${{ matrix.arch-suffix }}
92+
path: ${{ github.workspace }}/php-${{ matrix.php-versions }}-build${{ matrix.arch-suffix }}.tar.zst
6793
test:
6894
needs: build-php
6995
if: ${{ always() }}
@@ -72,17 +98,19 @@ jobs:
7298
strategy:
7399
fail-fast: false
74100
matrix:
75-
operating-system: [ubuntu-24.04, ubuntu-22.04, ubuntu-20.04]
76-
php-versions: ['5.3', '5.4', '5.5']
101+
php-versions: [5.3, 5.4, 5.5]
102+
operating-system: [ubuntu-24.04, ubuntu-22.04, ubuntu-20.04, ubuntu-22.04-arm, ubuntu-24.04-arm]
77103
steps:
78104
- name: Checkout
79-
uses: actions/checkout@v3
105+
uses: actions/checkout@v4
80106

81107
- name: Stage PHP
82108
run: |
83109
bash scripts/version-files.sh ${{ matrix.php-versions }}
84110
bash scripts/stage.sh ${{ matrix.php-versions }}
85-
gh release download -p 'php-${{ matrix.php-versions }}-build.tar.zst' -D php-${{ matrix.php-versions }}
111+
arch="$(arch)"
112+
[[ "$arch" = "arm64" || "$arch" = "aarch64" ]] && arch_suffix="-arm64" || arch_suffix=""
113+
gh release download -p "php-${{ matrix.php-versions }}-build$arch_suffix.tar.zst" -D php-${{ matrix.php-versions }}
86114
env:
87115
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
88116

@@ -126,14 +154,15 @@ jobs:
126154
name: Update dist
127155
if: "!contains(github.event.head_commit.message, 'skip-release')"
128156
needs: [build-php, test]
129-
runs-on: ubuntu-latest
157+
runs-on: ${{ matrix.os }}
130158
strategy:
131159
fail-fast: false
132160
matrix:
133161
php-versions: ['5.3', '5.4', '5.5']
162+
os: [ubuntu-24.04, ubuntu-24.04-arm]
134163
steps:
135164
- name: Checkout
136-
uses: actions/checkout@v3
165+
uses: actions/checkout@v4
137166
- name: Add ZSTD
138167
env:
139168
REPO: ${{ github.repository }}
@@ -145,29 +174,32 @@ jobs:
145174
mkdir builds
146175
bash scripts/version-files.sh "$PHP_VERSION"
147176
bash scripts/stage.sh "$PHP_VERSION"
148-
gh release download -p php-"$PHP_VERSION"-build.tar.zst -D php-"$PHP_VERSION"
149-
sudo XZ_OPT=-e9 tar cfJ php-"$PHP_VERSION".tar.xz php-"$PHP_VERSION"
150-
sudo tar cf - php-"$PHP_VERSION" | zstd -22 -T0 --ultra > php-"$PHP_VERSION".tar.zst
151-
mv php-"$PHP_VERSION".tar.* ./builds/
177+
arch="$(arch)"
178+
[[ "$arch" = "arm64" || "$arch" = "aarch64" ]] && arch_suffix="-arm64" || arch_suffix=""
179+
gh release download -p php-"$PHP_VERSION"-build"$arch_suffix".tar.zst -D php-"$PHP_VERSION"
180+
sudo XZ_OPT=-e9 tar cfJ php-"$PHP_VERSION$arch_suffix".tar.xz php-"$PHP_VERSION"
181+
sudo tar cf - php-"$PHP_VERSION" | zstd -22 -T0 --ultra > php-"$PHP_VERSION$arch_suffix".tar.zst
182+
mv php-"$PHP_VERSION$arch_suffix".tar.* ./builds/
152183
env:
153184
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
154185
PHP_VERSION: ${{ matrix.php-versions }}
155186
- name: Upload Artifact
156-
uses: actions/upload-artifact@v2
187+
uses: actions/upload-artifact@v4
157188
with:
158-
name: builds
189+
name: builds-${{ matrix.php-versions }}-${{ matrix.os }}
159190
path: builds
160191
release:
161192
runs-on: ubuntu-latest
162193
if: "!contains(github.event.head_commit.message, 'skip-release')"
163194
needs: [build-php, test, package]
164195
steps:
165-
- uses: actions/checkout@v3
196+
- uses: actions/checkout@v4
166197
- run: mkdir builds
167-
- uses: actions/download-artifact@v2
198+
- uses: actions/download-artifact@v4
168199
with:
169-
name: builds
200+
pattern: builds-*
170201
path: builds
202+
merge-multiple: true
171203
- name: Release
172204
run: |
173205
set -x

Dockerfile

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
ARG UBUNTU_VERSION=trusty
1+
ARG UBUNTU_VERSION=ubuntu:trusty
22
ARG PHP_VERSION=5.3
3-
FROM ubuntu:$UBUNTU_VERSION AS base
3+
FROM $UBUNTU_VERSION AS base
44

55
ENV DEBIAN_FRONTEND=noninteractive
66
ENV LC_ALL=C.UTF-8
@@ -15,18 +15,19 @@ RUN apt-get update && apt-get install -y wget ca-certificates \
1515
FROM base AS deps
1616
RUN apt-get update && apt-get install -y --no-install-recommends sudo curl software-properties-common
1717
RUN add-apt-repository ppa:ubuntu-toolchain-r/test
18-
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
18+
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
1919
RUN set -x \
20+
&& arch="$(uname -m)" \
2021
&& sed -i '/^mozilla\/DST_Root_CA_X3/s/^/!/' /etc/ca-certificates.conf \
2122
&& update-ca-certificates -f \
2223
&& update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.7 4 \
2324
&& update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.7 4 \
24-
&& 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/@ \
25-
&& ln -sf /usr/lib/libc-client.so.2007e.0 /usr/lib/x86_64-linux-gnu/libc-client.a \
25+
&& find /usr/lib/"$arch"-linux-gnu -maxdepth 1 -name "*.so" -printf "%f\n" | xargs -I@ ln -sf /usr/lib/"$arch"-linux-gnu/@ /usr/lib/@ \
26+
&& ln -sf /usr/lib/libc-client.so.2007e.0 /usr/lib/"$arch"-linux-gnu/libc-client.a \
2627
&& mkdir -p /usr/c-client/ /usr/include/freetype2/freetype \
2728
&& ln -sf /usr/lib/libc-client.so.2007e.0 /usr/c-client/libc-client.a \
2829
&& ln -sf /usr/include/qdbm/* /usr/include/ \
29-
&& ln -sf /usr/include/x86_64-linux-gnu/gmp.h /usr/include/gmp.h \
30+
&& ln -sf /usr/include/"$arch"-linux-gnu/gmp.h /usr/include/gmp.h \
3031
&& ln -sf /usr/include/freetype2/freetype.h /usr/include/freetype2/freetype/freetype.h \
3132
&& exit 0
3233

Binary file not shown.
Binary file not shown.
2.15 KB
Binary file not shown.
Binary file not shown.
210 KB
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.
44.2 KB
Binary file not shown.
2.21 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
62.2 KB
Binary file not shown.
2.48 KB
Binary file not shown.
15.3 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
621 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
210 KB
Binary file not shown.
53.4 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
-49.8 KB
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.
44.2 KB
Binary file not shown.
26.9 KB
Binary file not shown.
1.45 KB
Binary file not shown.
Binary file not shown.
1.45 KB
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.
62.2 KB
Binary file not shown.

deps/24.04/libodbc1_2.3.9-5_arm64.deb

2.47 KB
Binary file not shown.

deps/24.04/libodbc2_2.3.9-5_arm64.deb

141 KB
Binary file not shown.
15.2 KB
Binary file not shown.
229 KB
Binary file not shown.
221 KB
Binary file not shown.

deps/24.04/libpcre3_8.39-15_arm64.deb

306 KB
Binary file not shown.
139 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
306 KB
Binary file not shown.
304 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2.05 KB
Binary file not shown.
2.05 KB
Binary file not shown.
-181 KB
Binary file not shown.

deps/24.04/libtiff5_4.3.0-7_amd64.deb

179 KB
Binary file not shown.

deps/24.04/libtiff5_4.3.0-7_arm64.deb

175 KB
Binary file not shown.
-5.6 KB
Binary file not shown.
5.6 KB
Binary file not shown.
5.46 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
210 KB
Binary file not shown.
470 KB
Binary file not shown.
Binary file not shown.
51.3 KB
Binary file not shown.
6.32 MB
Binary file not shown.
Binary file not shown.
72.9 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
71.9 KB
Binary file not shown.
94.6 KB
Binary file not shown.
Binary file not shown.
705 KB
Binary file not shown.
107 KB
Binary file not shown.
Binary file not shown.
-142 KB
Binary file not shown.
121 KB
Binary file not shown.
99.5 KB
Binary file not shown.

scripts/build-deps.sh

+8
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ install_pkg() {
22
pkg_dir=$1
33
(
44
cd "$pkg_dir" || exit 1
5+
fix_config_files
56
sudo ./configure --prefix=/usr
67
sudo make -j"$(nproc)"
78
sudo make install DESTDIR="$DESTDIR"
@@ -25,13 +26,20 @@ add_openssl() {
2526
tar -xzf /tmp/openssl.tar.gz -C /tmp
2627
(
2728
cd /tmp/openssl-1.0.2u || exit 1
29+
fix_config_files
2830
./config --prefix=/usr --openssldir=/etc/ssl --libdir=lib/openssl-1.0 shared zlib-dynamic
2931
make depend
3032
sudo make -j"$(nproc)"
3133
sudo make install INSTALL_PREFIX="$DESTDIR"
3234
)
3335
}
3436

37+
fix_config_files() {
38+
for conf_file in config.guess config.sub; do
39+
find . -name "$conf_file" -exec cp /usr/share/automake-*/"$conf_file" {} \;
40+
done
41+
}
42+
3543
mode="${1:-all}"
3644
DESTDIR="${2:-}"
3745

scripts/build-extensions.sh

+8
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ build_extension() {
88
(
99
cd "$source_dir" || exit
1010
phpize
11+
fix_config_files
1112
sudo ./configure "${args[@]}" --with-php-config="$install_dir"/bin/php-config
1213
sudo make -j"$(nproc)"
1314
sudo make install
@@ -26,6 +27,7 @@ build_lib() {
2627
mkdir "$install_dir"/lib/"$lib"
2728
(
2829
cd "$source_dir" || exit
30+
fix_config_files
2931
sudo ./configure --prefix="$install_dir"/lib/"$lib" "$@"
3032
sudo make -j"$(nproc)"
3133
sudo make install
@@ -140,6 +142,12 @@ add_redis() {
140142
build_extension redis /tmp/redis-"$REDIS_VERSION" extension 20 --enable-redis --enable-redis-igbinary
141143
}
142144

145+
fix_config_files() {
146+
for conf_file in config.guess config.sub; do
147+
find . -name "$conf_file" -exec cp /usr/share/automake-*/"$conf_file" {} \;
148+
done
149+
}
150+
143151
PHP_VERSION=${PHP_VERSION:-'5.3'}
144152
APCU_VERSION='4.0.11'
145153
AMQP_VERSION='1.9.3'

scripts/build.sh

+5-3
Original file line numberDiff line numberDiff line change
@@ -166,13 +166,15 @@ build_extensions() {
166166

167167
build_and_ship_package() {
168168
bash scripts/install-zstd.sh
169+
arch="$(arch)"
170+
[[ "$arch" = "arm64" || "$arch" = "aarch64" ]] && arch_suffix="-arm64" || arch_suffix=""
169171
(
170172
cd "$install_dir"/.. || exit
171-
sudo tar cf - "$PHP_VERSION" | zstd -22 -T0 --ultra > "$GITHUB_WORKSPACE"/php-"$PHP_VERSION"-build.tar.zst
173+
sudo tar cf - "$PHP_VERSION" | zstd -22 -T0 --ultra > "$GITHUB_WORKSPACE"/php-"$PHP_VERSION"-build"$arch_suffix".tar.zst
172174
)
173175
gh release download -p "release.log" || true
174-
echo "$(date "+%Y-%m-%d %H:%M:%S") Update php-$PHP_VERSION-build.tar.zst" | sudo tee -a release.log >/dev/null 2>&1
175-
gh release upload "builds" release.log "php-$PHP_VERSION-build.tar.zst" --clobber
176+
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
177+
gh release upload "builds" release.log "php-$PHP_VERSION-build$arch_suffix.tar.zst" --clobber
176178
}
177179

178180
mode="${1:-all}"

scripts/install-php.sh

+12-4
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,16 @@
22
debconf_fix="DEBIAN_FRONTEND=noninteractive"
33
dpkg_install="sudo $debconf_fix dpkg -i --force-conflicts --force-overwrite"
44
sudo mkdir -p /var/run /run/php /usr/local/php /usr/lib/systemd/system /usr/lib/cgi-bin /var/www/html
5-
[[ "$VERSION_ID" = "20.04" || "$VERSION_ID" = "22.04" || $VERSION_ID = "24.04" ]] && $dpkg_install ./deps/"$VERSION_ID"/multiarch-support_2.28-10_amd64
6-
$dpkg_install ./deps/"$VERSION_ID"/*.deb
7-
$dpkg_install ./deps/all/*.deb
8-
sudo tar -I zstd -xf ./php-@[email protected] -C /usr/local/php
5+
arch="$(arch)"
6+
if [[ "$arch" = "arm64" || "$arch" = "aarch64" ]]; then
7+
arch="arm64";
8+
arch_name="-arm64";
9+
else
10+
arch="amd64"
11+
arch_name=""
12+
fi
13+
[[ "$VERSION_ID" = "20.04" || "$VERSION_ID" = "22.04" || $VERSION_ID = "24.04" ]] && $dpkg_install ./deps/"$VERSION_ID"/multiarch-support_2.28-10_"$arch"
14+
$dpkg_install ./deps/"$VERSION_ID"/*_"$arch".deb
15+
$dpkg_install ./deps/all/*_"$arch".deb
16+
sudo tar -I zstd -xf ./php-@PHP_VERSION@-build"$arch_name".tar.zst -C /usr/local/php
917
sudo ln -sf /usr/local/php/@PHP_VERSION@/etc/php.ini /etc/php.ini

scripts/install.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ install() {
2121
)
2222
}
2323

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

0 commit comments

Comments
 (0)