Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
161 commits
Select commit Hold shift + click to select a range
b549469
ZTS initial support for FrankenPHP
ioaniftimesei Nov 7, 2025
cc173d4
Refactor global variable access to use local references for improved …
ioaniftimesei Nov 7, 2025
5e4905e
Changed zend_hash_init
ioaniftimesei Nov 7, 2025
bf126db
Refactor PHP function calls to ensure proper cleanup of zval variables
ioaniftimesei Nov 10, 2025
b0d4896
ReportStats() accesses the stats map during RequestProcessor destruct…
ioaniftimesei Nov 10, 2025
9dc8f99
Reorder destruction of global variables in PHP_GSHUTDOWN_FUNCTION to …
ioaniftimesei Nov 10, 2025
2f5fffb
Update Server::GetBody() to properly release zend_string + fix destru…
ioaniftimesei Nov 10, 2025
4b45bc0
Add ZTS support for global variable cleanup in PHP_GSHUTDOWN_FUNCTION…
ioaniftimesei Nov 10, 2025
b3f2f87
Temporary disable franken installation support. We should provide the…
ioaniftimesei Nov 11, 2025
cab28bc
Merge branch 'main' into zts-thread-safety-module-globals
ioaniftimesei Nov 11, 2025
3ffed08
GINIT with proper ifdef
ioaniftimesei Nov 11, 2025
0a2cd8d
Enhance thread safety and instance management in RequestProcessor
ioaniftimesei Nov 18, 2025
40cd5ee
Comments refactoring
ioaniftimesei Nov 18, 2025
e3383b3
Revert to using CallPhpFunctionWithOneParam
ioaniftimesei Nov 19, 2025
03ce80b
Remove unused CONTENT_TYPE_HEADER definition from Action.cpp
ioaniftimesei Nov 19, 2025
3f02c11
Merge branch 'zts-thread-safety-module-globals' into zts-thread-safet…
ioaniftimesei Nov 19, 2025
11c2f56
Refactor event handler mappings in RequestProcessor.
ioaniftimesei Nov 19, 2025
55c1666
Add GitHub workflows for building PHP test images and extensions in Z…
ioaniftimesei Nov 19, 2025
4546628
Enable maintainer ZTS option in Dockerfiles for PHP builds
ioaniftimesei Nov 20, 2025
6045f60
Patch openssl.c for OpenSSL compatibility in Dockerfiles for PHP builds
ioaniftimesei Nov 20, 2025
0423999
Debug php -v
ioaniftimesei Nov 20, 2025
815e184
Update ZTS verification in workflows and remove unused intl extension…
ioaniftimesei Nov 20, 2025
2bcacfc
Add PHP-FPM configuration files to Dockerfiles and update ZTS verific…
ioaniftimesei Nov 20, 2025
842fe5b
Add MySQL socket configuration for mysqli in CentOS and Ubuntu Docker…
ioaniftimesei Nov 20, 2025
0ea1ef0
Add GitHub workflows for building PHP test images and extensions in N…
ioaniftimesei Nov 20, 2025
d7f6705
Updated naming convention for tests too
ioaniftimesei Nov 20, 2025
754b35a
++ Naming convention
ioaniftimesei Nov 20, 2025
079c999
Remove -dev tag from php builds versioning
ioaniftimesei Nov 20, 2025
b05ddb5
Add symbolic links for PHP and PHP-FPM in CentOS and Ubuntu Dockerfiles
ioaniftimesei Nov 20, 2025
4ee292d
Add directories for PHP-FPM configuration in CentOS and Ubuntu Docker…
ioaniftimesei Nov 20, 2025
522ee14
+
ioaniftimesei Nov 20, 2025
7ac0e8d
Add PHP-FPM configuration setup in CentOS and Ubuntu Dockerfiles
ioaniftimesei Nov 20, 2025
7624bc0
Update PHP-FPM configuration to use 'root' user and group in CentOS a…
ioaniftimesei Nov 20, 2025
8154188
Refactor PHP-FPM startup commands in CentOS and Ubuntu Dockerfiles to…
ioaniftimesei Nov 20, 2025
04e06fe
Enhance PHP-FPM configuration in Dockerfiles for CentOS and Ubuntu to…
ioaniftimesei Nov 21, 2025
e6e02e9
Ensure 'daemonize' is set to 'no' in PHP-FPM configuration for CentOS…
ioaniftimesei Nov 21, 2025
2ca27a9
Refactor PHP-FPM configuration in CentOS and Ubuntu
ioaniftimesei Nov 21, 2025
2d6768d
.
ioaniftimesei Nov 21, 2025
da5c41b
Update PHP-FPM configuration
ioaniftimesei Nov 21, 2025
8752b05
Refactor PHP-FPM configuration in CentOS and Ubuntu Dockerfiles
ioaniftimesei Nov 21, 2025
350dd19
Merge with main
ioaniftimesei Nov 25, 2025
0ebb573
Add FrankenPHP support to environment handling and request processing
ioaniftimesei Dec 2, 2025
015ccb5
Enhance request processing and context handling by integrating instan…
ioaniftimesei Dec 9, 2025
b83a631
Merge remote-tracking branch 'origin/main' into zts-thread-safety-req…
ioaniftimesei Dec 9, 2025
538e986
Add URL retrieval to request metadata in OnPostRequest function
ioaniftimesei Dec 9, 2025
a6dc44b
Update PHP version support to include 8.5 across multiple workflows a…
ioaniftimesei Dec 9, 2025
65a7a99
Correct version
ioaniftimesei Dec 9, 2025
5730f0b
Update PHP version matrix to include 8.5 in CentOS PHP test image wor…
ioaniftimesei Dec 9, 2025
d62858f
Update Docker container versions for PHP extension builds to v2 in th…
ioaniftimesei Dec 9, 2025
0548a77
Update PHP version matrix formatting and bump version to v2 in the bu…
ioaniftimesei Dec 9, 2025
cbb015a
Refactor request processor instance management to include thread ID h…
ioaniftimesei Dec 10, 2025
bb8efbe
Update version to v2 in CentOS and Ubuntu PHP test image workflows fo…
ioaniftimesei Dec 10, 2025
b7880ed
Update run-tests.php (from PHP 8.5)
ioaniftimesei Dec 10, 2025
dcd3a16
ensure compatibility with php <= php 7.4
ioaniftimesei Dec 10, 2025
6fa5dde
Add phpize step in CLI test workflows for PHP run-tests.sh
ioaniftimesei Dec 10, 2025
e877252
Update CentOS and Ubuntu Dockerfiles to build PHP from source in NTS …
ioaniftimesei Dec 10, 2025
c9a5995
official run-tests.php. now we run phpize before pipeline tests too
ioaniftimesei Dec 10, 2025
ff8cd9d
Enhance PHP-FPM setup in build workflow to verify NTS configuration a…
ioaniftimesei Dec 10, 2025
b4eeff5
Create extension dir folder in test images
ioaniftimesei Dec 10, 2025
cc0c7c4
Enable caching in CentOS and Ubuntu PHP test image workflows
ioaniftimesei Dec 10, 2025
72b4ace
Refactor exception handling in Action.cpp to differentiate behavior b…
ioaniftimesei Dec 10, 2025
2aed4f6
build mod_php
ioaniftimesei Dec 10, 2025
d9fb10b
Fix apxs2 path in Ubuntu PHP test Dockerfile
ioaniftimesei Dec 10, 2025
6cb9804
test dockerfile update
ioaniftimesei Dec 10, 2025
068d02b
.
ioaniftimesei Dec 10, 2025
a6bc016
test
ioaniftimesei Dec 10, 2025
4d8dae5
Add Apache module directories to CentOS and Ubuntu PHP test Dockerfiles
ioaniftimesei Dec 10, 2025
ec5dc38
Fix apxs2 path in Ubuntu PHP test Dockerfiles to use correct binary
ioaniftimesei Dec 10, 2025
136bb3e
test.
ioaniftimesei Dec 11, 2025
685ae8a
.
ioaniftimesei Dec 11, 2025
1280048
.
ioaniftimesei Dec 11, 2025
5e1564b
++
ioaniftimesei Dec 11, 2025
def7e1f
....
ioaniftimesei Dec 11, 2025
203a372
Add Apache PHP module configuration for CentOS and Ubuntu Dockerfiles
ioaniftimesei Dec 11, 2025
e474b7e
Update Apache configuration in Dockerfiles to use prefork MPM and han…
ioaniftimesei Dec 11, 2025
1326cce
Add FrankenPHP testing workflows for PHP versions 8.2 to 8.5.
ioaniftimesei Dec 11, 2025
a557704
Update Dockerfiles and GitHub Actions workflows to improve FrankenPHP…
ioaniftimesei Dec 11, 2025
9173a75
Dont fail the images build if PHP < 8.2
ioaniftimesei Dec 11, 2025
04f5eea
Fix syntax in error message for unsupported PHP versions in CentOS an…
ioaniftimesei Dec 11, 2025
82b10c3
Refactor Dockerfile syntax for improved readability in CentOS and Ubu…
ioaniftimesei Dec 11, 2025
75654eb
.
ioaniftimesei Dec 11, 2025
c79e2ab
removed extra keyword
ioaniftimesei Dec 11, 2025
9c66228
Update GitHub Actions workflows to use 'command -v' for FrankenPHP ch…
ioaniftimesei Dec 11, 2025
aaa6334
Don't test anymore franken with PHP 8.2. is too old, with a lot of bu…
ioaniftimesei Dec 11, 2025
cc2a5a4
Update GitHub Actions workflows and Dockerfiles to include PHP 8.2 su…
ioaniftimesei Dec 12, 2025
a99b812
Remove hardcoded PHP version in Dockerfiles for CentOS and Ubuntu wor…
ioaniftimesei Dec 12, 2025
cc521c4
Add FrankenPHP image argument to Dockerfiles for CentOS and Ubuntu wo…
ioaniftimesei Dec 12, 2025
206dbda
.
ioaniftimesei Dec 12, 2025
2090e77
Add FrankenPHP binary copy step to Dockerfiles for CentOS and Ubuntu …
ioaniftimesei Dec 12, 2025
2f27dcb
.
ioaniftimesei Dec 12, 2025
41ee3b5
.
ioaniftimesei Dec 12, 2025
dc77b17
+
ioaniftimesei Dec 12, 2025
cab4b9c
+++
ioaniftimesei Dec 12, 2025
70b6876
.
ioaniftimesei Dec 12, 2025
3ae0cfa
.
ioaniftimesei Dec 12, 2025
d51bc51
++++
ioaniftimesei Dec 12, 2025
31012cd
++++
ioaniftimesei Dec 12, 2025
f81a956
.
ioaniftimesei Dec 12, 2025
0769b5e
.
ioaniftimesei Dec 12, 2025
a2e1bce
Remove PHP_VERSION argument and related conditional logic from Docker…
ioaniftimesei Dec 12, 2025
d94d163
Add --enable-embed option to PHP configuration in CentOS and Ubuntu D…
ioaniftimesei Dec 12, 2025
f00b123
Add libphp.so to Docker build process for CentOS and Ubuntu workflows
ioaniftimesei Dec 12, 2025
1d45310
.
ioaniftimesei Dec 12, 2025
6bdec3c
.
ioaniftimesei Dec 12, 2025
47b488b
.
ioaniftimesei Dec 12, 2025
6c0cbfd
.
ioaniftimesei Dec 12, 2025
a8e95a3
.
ioaniftimesei Dec 12, 2025
342f060
.
ioaniftimesei Dec 12, 2025
7b2b7da
.
ioaniftimesei Dec 12, 2025
8b5e00a
Update Docker image references to use 'bookworm' tag for CentOS and U…
ioaniftimesei Dec 12, 2025
795b41d
.
ioaniftimesei Dec 12, 2025
998c049
.
ioaniftimesei Dec 12, 2025
170f78f
.
ioaniftimesei Dec 12, 2025
2cca1ce
.
ioaniftimesei Dec 12, 2025
9167478
Build libwatcher for frankenphp + binaries from the official images
ioaniftimesei Dec 12, 2025
324affd
Remove --enable-embed option from PHP configuration in CentOS Dockerfile
ioaniftimesei Dec 12, 2025
0011777
Integrate static lexbor library into PHP builds for CentOS and Ubuntu…
ioaniftimesei Dec 13, 2025
7255eb1
.
ioaniftimesei Dec 13, 2025
2df2e2f
+
ioaniftimesei Dec 13, 2025
56c6a78
.
ioaniftimesei Dec 13, 2025
2f07524
Merge remote-tracking branch 'origin/main' into zts-thread-safety-req…
ioaniftimesei Dec 13, 2025
59c45d3
.
ioaniftimesei Dec 13, 2025
0f9fd69
Refactor test cases in checkBlockedDomain_test.go to remove unnecessa…
ioaniftimesei Dec 13, 2025
19515e1
Remove unused urllib.request import and related code for checking Fra…
ioaniftimesei Dec 13, 2025
d1cc20b
Add --disable-zend-signals option to PHP configuration in CentOS and …
ioaniftimesei Dec 14, 2025
7d532f0
Add Dockerfile for CentOS Stream 9 with PHP 8.3 built from source in …
ioaniftimesei Dec 14, 2025
f7f6ac3
Remove lexbor library build from Dockerfile for Ubuntu PHP ZTS, and a…
ioaniftimesei Dec 14, 2025
46f86bb
Refactor exception handling in Action::executeThrow to streamline res…
ioaniftimesei Dec 14, 2025
beedab5
.
ioaniftimesei Dec 14, 2025
1faaeb1
Update Dockerfile for Ubuntu PHP ZTS to configure library path for ld…
ioaniftimesei Dec 14, 2025
9754514
Remove Dockerfile for CentOS PHP ZTS and update paths for FrankenPHP …
ioaniftimesei Dec 14, 2025
d7adf45
Fix rate limiting race condition with atomic check-and-increment
ioaniftimesei Dec 14, 2025
cf01b3d
Fix rate limiting status function to ensure proper mutex unlocking
ioaniftimesei Dec 14, 2025
31db3c3
Refactor server tickers initialization to ensure they start on the fi…
ioaniftimesei Dec 30, 2025
144d2ab
Merge branch 'main' into zts-thread-safety-request-processor
ioaniftimesei Dec 30, 2025
7c3ba4a
fix merge conflicts
ioaniftimesei Dec 30, 2025
213ed41
Refactor IP bypass handling to use global accessors. Update initializ…
ioaniftimesei Dec 30, 2025
004d110
+
ioaniftimesei Dec 30, 2025
7b2e79a
Add request initialization check in IP bypass handling
ioaniftimesei Dec 30, 2025
dcebcfd
Initialize IP bypass state in global structure and update bypass chec…
ioaniftimesei Dec 30, 2025
529927d
Remove inline method IsRequestInitialized from RequestProcessor class
ioaniftimesei Dec 30, 2025
d58dc96
Add EnsureTickersStarted RPC and refactor ticker initialization logic
ioaniftimesei Dec 30, 2025
f7201b6
Ensure tickers are started for rate limiting in blocking status check
ioaniftimesei Dec 30, 2025
6d40bc3
Implement ticker initialization for rate limiting in gRPC server and …
ioaniftimesei Dec 30, 2025
bf328bf
Refactor ticker management
ioaniftimesei Dec 30, 2025
1a12497
++
ioaniftimesei Dec 30, 2025
3ad616d
++
ioaniftimesei Dec 30, 2025
0493aa9
-_-
ioaniftimesei Dec 30, 2025
5bb47a2
Start tickers in all the runtime handlers
ioaniftimesei Dec 30, 2025
4a37636
+++
ioaniftimesei Dec 30, 2025
abccd55
fix
ioaniftimesei Dec 30, 2025
fb64927
test
ioaniftimesei Dec 30, 2025
860bb8d
Revert "fix"
ioaniftimesei Dec 31, 2025
1ecc875
Revert "test"
ioaniftimesei Dec 31, 2025
6941226
No longer need is_frankenphp
ioaniftimesei Dec 31, 2025
2dbd2c4
test
ioaniftimesei Dec 31, 2025
169b53a
Don't LoadEnvironment for FrankenPHP on MINIT
ioaniftimesei Dec 31, 2025
2040d1d
Update MINIT function for FrankenPHP to set sapi_name and defer envir…
ioaniftimesei Dec 31, 2025
956b54b
Atomic server creation in request processor
ioaniftimesei Dec 31, 2025
d0ff6b3
Refactor server registration to avoid holding mutex during configurat…
ioaniftimesei Dec 31, 2025
4014d1f
Refactor server configuration process by separating logger initializa…
ioaniftimesei Dec 31, 2025
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
99 changes: 99 additions & 0 deletions .devcontainer/centos_franken_php/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
FROM --platform=linux/amd64 centos:8

ARG PHP_VERSION=8.4
ARG PHP_FULL_VERSION=8.4.14
ARG FRANKENPHP_VERSION=1.9.1

WORKDIR /etc/yum.repos.d/
RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
RUN sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
RUN yum update -y
RUN yum install -y yum-utils
RUN yum install -y https://rpms.remirepo.net/enterprise/remi-release-8.4.rpm
RUN yum install -y epel-release
RUN dnf config-manager --set-enabled powertools || dnf config-manager --set-enabled PowerTools || true
RUN yum install -y httpd
RUN yum install -y cpio
RUN yum install -y unzip
RUN yum install -y nano
RUN yum install -y lsof
RUN yum install -y jq
RUN yum install -y libcurl-devel
RUN curl -O https://dl.google.com/go/go1.23.3.linux-amd64.tar.gz
RUN tar -C /usr/local -xzf go1.23.3.linux-amd64.tar.gz
ENV PATH="/usr/local/go/bin:${PATH}"
RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
RUN go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
ENV PROTOC_ZIP=protoc-28.3-linux-x86_64.zip
RUN curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v28.3/$PROTOC_ZIP
RUN unzip -o $PROTOC_ZIP -d /usr/local bin/protoc
RUN unzip -o $PROTOC_ZIP -d /usr/local include/*
RUN rm -f $PROTOC_ZIP
ENV PATH="$HOME/go/bin:${PATH}"
RUN yum install -y rpmdevtools
RUN yum install -y git
RUN yum install -y nginx
RUN yum install -y sudo
RUN yum install -y gcc gcc-c++ make
RUN dnf -y module enable python39
RUN yum install -y python39 python39-devel
RUN ln -sf /usr/bin/python3.9 /usr/bin/python3 && ln -sf /usr/bin/python3.9 /usr/bin/python
RUN pip3 install psutil flask requests --quiet --no-input

# Checkout PHP sources at the requested full version tag/branch (e.g., PHP-8.4.14)
RUN git clone --depth 1 --branch PHP-${PHP_FULL_VERSION} https://github.com/php/php-src.git /usr/local/src/php-src

## Build and install a recent re2c required by PHP build system
ENV RE2C_VERSION=3.1
RUN curl -fsSL -o /tmp/re2c.tar.xz https://github.com/skvadrik/re2c/releases/download/${RE2C_VERSION}/re2c-${RE2C_VERSION}.tar.xz \
&& mkdir -p /tmp/re2c-src \
&& tar -xJf /tmp/re2c.tar.xz -C /tmp/re2c-src --strip-components=1 \
&& cd /tmp/re2c-src \
&& ./configure \
&& make -j"$(nproc)" \
&& make install

RUN yum install -y \
autoconf automake libtool bison pkgconfig \
libxml2-devel \
oniguruma-devel \
libicu-devel \
mariadb-devel \
openssl-devel \
zlib-devel \
libzip-devel \
sqlite-devel \
&& cd /usr/local/src/php-src \
&& sed -i 's/\[\([0-9]\+\.[0-9]\+\.[0-9]\+\)-dev\]/[\1]/' configure.ac \
&& ./buildconf --force \
&& CFLAGS="$CFLAGS -fPIE -fPIC" LDFLAGS="$LDFLAGS -pie" ./configure \
--enable-embed \
--enable-zts \
--enable-pdo \
--disable-zend-signals \
--enable-zend-max-execution-timers \
--with-extra-version="" \
--with-config-file-scan-dir=/etc/php.d \
--enable-mbstring \
--enable-pcntl \
--with-curl \
--with-mysqli \
--with-openssl \
--with-zlib \
--with-zip \
--with-sqlite3 \
--with-pdo-sqlite \
&& make -j"$(nproc)" \
&& make install

RUN mkdir -p /etc/php.d

RUN ln -sf /usr/local/bin/php /usr/bin/php

# Install FrankenPHP from RPM
RUN FRANKENPHP_RPM_URL="https://github.com/php/frankenphp/releases/download/v${FRANKENPHP_VERSION}/frankenphp-${FRANKENPHP_VERSION}-1.x86_64.rpm" \
&& curl -fsSL -L -o /tmp/frankenphp.rpm "$FRANKENPHP_RPM_URL" \
&& yum install -y /tmp/frankenphp.rpm \
&& rm -f /tmp/frankenphp.rpm


34 changes: 34 additions & 0 deletions .devcontainer/centos_franken_php/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"name": "Centos FrankenPHP Dev Container",
"runArgs": [
"--privileged"
],
"mounts": [
"source=${localWorkspaceFolder}/.devcontainer/shared,target=/shared,type=bind"
],
"build": {
"platform": "linux/amd64",
"dockerfile": "Dockerfile",
"args": {
"PHP_VERSION": "8.4",
"PHP_FULL_VERSION": "8.4.14",
"FRANKENPHP_VERSION": "1.9.1"
}
},
"remoteUser": "root",
"customizations": {
"vscode": {
"extensions": [
"golang.go",
"github.vscode-github-actions",
"ms-vscode.cpptools-extension-pack",
"ms-vscode.cpptools",
"ms-vscode.cpptools-themes",
"austin.code-gnu-global",
"ms-vscode.makefile-tools",
"ms-python.vscode-pylance"
]
}
}
}

114 changes: 114 additions & 0 deletions .devcontainer/centos_franken_php_arm/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
FROM --platform=linux/arm64 centos:8

ARG PHP_VERSION=8.4
ARG PHP_FULL_VERSION=8.4.14
ARG FRANKENPHP_VERSION=1.9.1

WORKDIR /etc/yum.repos.d/
RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* \
&& sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* \
&& yum update -y \
&& yum install -y yum-utils \
&& yum install -y https://rpms.remirepo.net/enterprise/remi-release-8.4.rpm \
&& yum install -y epel-release \
&& dnf config-manager --set-enabled powertools || dnf config-manager --set-enabled PowerTools || true \
&& yum install -y httpd cpio unzip nano lsof jq libcurl-devel rpmdevtools git nginx sudo gcc gcc-c++ make \
&& yum clean all && rm -rf /var/cache/yum

# Go toolchain (arm64) and protoc (aarch_64) similar to centos_arm
RUN curl -O https://dl.google.com/go/go1.23.3.linux-arm64.tar.gz \
&& tar -C /usr/local -xzf go1.23.3.linux-arm64.tar.gz
ENV PATH="/usr/local/go/bin:${PATH}"
RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@latest \
&& go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
ENV PROTOC_ZIP=protoc-30.2-linux-aarch_64.zip
RUN curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v30.2/$PROTOC_ZIP \
&& unzip -o $PROTOC_ZIP -d /usr/local bin/protoc \
&& unzip -o $PROTOC_ZIP -d /usr/local include/* \
&& rm -f $PROTOC_ZIP
ENV PATH="$HOME/go/bin:${PATH}"

# Python 3.9 for PHP build helpers
RUN dnf -y module enable python39 \
&& yum install -y python39 python39-devel \
&& ln -sf /usr/bin/python3.9 /usr/bin/python3 && ln -sf /usr/bin/python3.9 /usr/bin/python

RUN pip3 install psutil flask requests --quiet --no-input

# Fetch PHP sources
RUN git clone --depth 1 --branch PHP-${PHP_FULL_VERSION} https://github.com/php/php-src.git /usr/local/src/php-src

# Build re2c from source (arm64)
ENV RE2C_VERSION=3.1
RUN curl -fsSL -o /tmp/re2c.tar.xz https://github.com/skvadrik/re2c/releases/download/${RE2C_VERSION}/re2c-${RE2C_VERSION}.tar.xz \
&& mkdir -p /tmp/re2c-src \
&& tar -xJf /tmp/re2c.tar.xz -C /tmp/re2c-src --strip-components=1 \
&& cd /tmp/re2c-src \
&& ./configure \
&& make -j"$(nproc)" \
&& make install \
&& rm -rf /tmp/re2c.tar.xz /tmp/re2c-src

# Build latest GDB from release tarball (more stable than git)
ENV GDB_VERSION=14.2
RUN yum install -y texinfo mpfr-devel gmp-devel ncurses-devel readline-devel zlib-devel expat-devel \
libmpc-devel gettext-devel \
&& curl -fsSL -o /tmp/gdb-${GDB_VERSION}.tar.xz https://ftp.gnu.org/gnu/gdb/gdb-${GDB_VERSION}.tar.xz \
&& mkdir -p /tmp/gdb-src \
&& tar -xJf /tmp/gdb-${GDB_VERSION}.tar.xz -C /tmp/gdb-src --strip-components=1 \
&& cd /tmp/gdb-src \
&& ./configure --prefix=/usr/local \
--with-python=/usr/bin/python3.9 \
--enable-tui \
--with-readline \
&& make -j"$(nproc)" \
&& make install \
&& echo 'set auto-load safe-path /' > /root/.gdbinit

RUN yum install -y \
autoconf automake libtool bison pkgconfig \
libxml2-devel \
oniguruma-devel \
libicu-devel \
mariadb-devel \
openssl-devel \
libzip-devel \
sqlite-devel \
&& cd /usr/local/src/php-src \
&& sed -i 's/\[\([0-9]\+\.[0-9]\+\.[0-9]\+\)-dev\]/[\1]/' configure.ac \
&& ./buildconf --force \
&& CFLAGS="$CFLAGS -fPIE -fPIC" LDFLAGS="$LDFLAGS -pie" ./configure \
--enable-embed \
--enable-zts \
--enable-pdo \
--disable-zend-signals \
--enable-zend-max-execution-timers \
--with-extra-version="" \
--with-config-file-scan-dir=/etc/php.d \
--enable-mbstring \
--enable-pcntl \
--with-curl \
--with-mysqli \
--with-openssl \
--with-zlib \
--with-zip \
--with-sqlite3 \
--with-pdo-sqlite \
&& make -j"$(nproc)" \
&& make install

RUN mkdir -p /etc/php.d

RUN ln -sf /usr/local/bin/php /usr/bin/php

# Try to install FrankenPHP for arm64 (optional)
RUN FRANKENPHP_ARCH=aarch64 \
&& FRANKENPHP_RPM_URL="https://github.com/php/frankenphp/releases/download/v${FRANKENPHP_VERSION}/frankenphp-${FRANKENPHP_VERSION}-1.${FRANKENPHP_ARCH}.rpm" \
&& curl -fsSL -L -o /tmp/frankenphp.rpm "$FRANKENPHP_RPM_URL" \
&& yum install -y /tmp/frankenphp.rpm || true \
&& rm -f /tmp/frankenphp.rpm || true

# Final PATH to include phpize/php-config if installed
ENV PATH="/usr/local/bin:/usr/local/sbin:${PATH}"


32 changes: 32 additions & 0 deletions .devcontainer/centos_franken_php_arm/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"name": "Centos FrankenPHP (arm64)",
"runArgs": [],
"mounts": [
"source=${localWorkspaceFolder}/.devcontainer/shared,target=/shared,type=bind"
],
"build": {
"platform": "linux/arm64",
"dockerfile": "Dockerfile",
"args": {
"PHP_VERSION": "8.4",
"PHP_FULL_VERSION": "8.4.14",
"FRANKENPHP_VERSION": "1.9.1"
}
},
"remoteUser": "root",
"customizations": {
"vscode": {
"extensions": [
"golang.go",
"github.vscode-github-actions",
"ms-vscode.cpptools-extension-pack",
"ms-vscode.cpptools",
"ms-vscode.cpptools-themes",
"austin.code-gnu-global",
"ms-vscode.makefile-tools"
]
}
}
}


Loading
Loading