Skip to content

Commit

Permalink
Add PHP 8.4 (no pcov, newrelic) and update extensions:
Browse files Browse the repository at this point in the history
grpc 1.68.0
sqlsrv 5.12.0
rdkafka 6.0.5
brotli 0.15.2
spx 0.4.17
oauth 2.0.9
  • Loading branch information
csandanov committed Nov 22, 2024
1 parent 5bdada1 commit 2cb6b73
Show file tree
Hide file tree
Showing 8 changed files with 408 additions and 213 deletions.
62 changes: 59 additions & 3 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,31 @@ on:
pull_request:

env:
PHP84: '8.4.1'
PHP83: '8.3.14'
PHP82: '8.2.26'
PHP81: '8.1.31'
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}

jobs:
php84:
runs-on: ubuntu-latest
defaults:
run:
working-directory: '8'
steps:
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
with:
platforms: linux/amd64,linux/arm64
- uses: docker/setup-buildx-action@v3
- uses: ./.github/actions
with:
version: ${{ env.PHP84 }}
tags: 8.4,8,latest
workdir: 8
platform: linux/amd64,linux/arm64
php83:
runs-on: ubuntu-latest
defaults:
Expand All @@ -32,7 +50,7 @@ jobs:
- uses: ./.github/actions
with:
version: ${{ env.PHP83 }}
tags: 8.3,8,latest
tags: 8.3
workdir: 8
platform: linux/amd64,linux/arm64
php82:
Expand Down Expand Up @@ -70,6 +88,24 @@ jobs:
workdir: 8
platform: linux/amd64,linux/arm64
### dev
php84-dev:
runs-on: ubuntu-latest
defaults:
run:
working-directory: '8'
steps:
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
with:
platforms: linux/amd64,linux/arm64
- uses: docker/setup-buildx-action@v3
- uses: ./.github/actions
with:
version: ${{ env.PHP84 }}
dev: 1
tags: 8.4-dev,8-dev,dev
workdir: 8
platform: linux/amd64,linux/arm64
php83-dev:
runs-on: ubuntu-latest
defaults:
Expand All @@ -85,7 +121,7 @@ jobs:
with:
version: ${{ env.PHP83 }}
dev: 1
tags: 8.3-dev,8-dev,dev
tags: 8.3-dev
workdir: 8
platform: linux/amd64,linux/arm64
php82-dev:
Expand Down Expand Up @@ -125,6 +161,26 @@ jobs:
workdir: 8
platform: linux/amd64,linux/arm64
### dev-macos
php84-dev-macos:
runs-on: ubuntu-latest
defaults:
run:
working-directory: '8'
steps:
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
with:
platforms: linux/amd64,linux/arm64
- uses: docker/setup-buildx-action@v3
- uses: ./.github/actions
with:
version: ${{ env.PHP84 }}
dev: 1
user_id: 501
group_id: 20
tags: 8.4-dev-macos,8-dev-macos,dev-macos
workdir: 8
platform: linux/amd64,linux/arm64
php83-dev-macos:
runs-on: ubuntu-latest
defaults:
Expand All @@ -142,7 +198,7 @@ jobs:
dev: 1
user_id: 501
group_id: 20
tags: 8.3-dev-macos,8-dev-macos,dev-macos
tags: 8.3-dev-macos
workdir: 8
platform: linux/amd64,linux/arm64
php82-dev-macos:
Expand Down
45 changes: 25 additions & 20 deletions 8/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ ENV PATH="${PATH}:/home/wodby/.composer/vendor/bin:${APP_ROOT}/vendor/bin:${APP_
ARG TARGETPLATFORM
ARG TARGETARCH

COPY patches /tmp/patches

RUN set -xe; \
\
# Delete existing user/group if uid/gid occupied.
Expand Down Expand Up @@ -198,6 +200,7 @@ RUN set -xe; \
git clone https://github.com/Imagick/imagick; \
cd imagick; \
git reset --hard 28f27044e435a2b203e32675e942eb8de620ee58; \
for i in /tmp/patches/imagick/*.patch; do patch -p1 -i "${i}"; done; \
docker-php-ext-configure imagick; \
docker-php-ext-install "-j${NPROC}" imagick; \
\
Expand Down Expand Up @@ -232,21 +235,21 @@ RUN set -xe; \
ast-1.1.2 \
ds-1.5.0 \
event-3.1.4 \
grpc-1.60.0 \
grpc-1.68.0 \
igbinary-3.2.16 \
memcached-3.2.0 \
mongodb-1.20.0 \
oauth-2.0.9 \
opentelemetry-1.1.0 \
pdo_sqlsrv-5.11.1 \
pcov \
rdkafka-6.0.3 \
pdo_sqlsrv-5.12.0 \
$(test "${PHP_VERSION:0:3}" != "8.4" && echo 'pcov') \
rdkafka-6.0.5 \
redis-6.1.0 \
sqlsrv-5.11.1 \
sqlsrv-5.12.0 \
smbclient-1.1.1 \
uploadprogress-2.0.2 \
uuid-1.2.1 \
xdebug-3.3.2 \
$(test "${PHP_VERSION:0:3}" == "8.4" && echo 'xdebug-3.4.0beta1' || echo 'xdebug-3.3.2') \
xhprof-2.3.10 \
yaml-2.2.4; \
\
Expand All @@ -263,7 +266,7 @@ RUN set -xe; \
oauth \
opentelemetry \
pdo_sqlsrv \
pcov \
$(test "${PHP_VERSION:0:3}" != "8.4" && echo 'pcov') \
rdkafka \
redis \
smbclient \
Expand All @@ -278,28 +281,30 @@ RUN set -xe; \
# http://osmanov-dev-notes.blogspot.com/2013/07/fixing-php-start-up-error-unable-to.html
mv /usr/local/etc/php/conf.d/docker-php-ext-event.ini /usr/local/etc/php/conf.d/z-docker-php-ext-event.ini; \
\
# NewRelic extension and agent. \
newrelic_url="http://download.newrelic.com/php_agent/release/"; \
wget -r -nd --no-parent -P /tmp/newrelic -Alinux-musl.tar.gz "${newrelic_url}" >/dev/null 2>&1; \
tar -xzf /tmp/newrelic/newrelic-php*.tar.gz --strip=1 -C /tmp/newrelic; \
export NR_INSTALL_SILENT=true; \
export NR_INSTALL_USE_CP_NOT_LN=true; \
bash /tmp/newrelic/newrelic-install install; \
rm -f /usr/local/etc/php/conf.d/newrelic.ini; \
mkdir -p /var/log/newrelic/; \
chown -R www-data:www-data /var/log/newrelic/; \
chmod -R 775 /var/log/newrelic/; \
if [["${PHP_VERSION:0:3}" != "8.4" ]]; then \
# NewRelic extension and agent. \
newrelic_url="http://download.newrelic.com/php_agent/release/"; \
wget -r -nd --no-parent -P /tmp/newrelic -Alinux-musl.tar.gz "${newrelic_url}" >/dev/null 2>&1; \
tar -xzf /tmp/newrelic/newrelic-php*.tar.gz --strip=1 -C /tmp/newrelic; \
export NR_INSTALL_SILENT=true; \
export NR_INSTALL_USE_CP_NOT_LN=true; \
bash /tmp/newrelic/newrelic-install install; \
rm -f /usr/local/etc/php/conf.d/newrelic.ini; \
mkdir -p /var/log/newrelic/; \
chown -R www-data:www-data /var/log/newrelic/; \
chmod -R 775 /var/log/newrelic/; \
fi; \
\
# Brotli extension.
brotli_ext_ver="0.14.2"; \
brotli_ext_ver="0.15.2"; \
mkdir -p /usr/src/php/ext/brotli; \
brotli_url="https://github.com/kjdev/php-ext-brotli/archive/refs/tags/${brotli_ext_ver}.tar.gz"; \
wget -qO- "${brotli_url}" | tar xz --strip-components=1 -C /usr/src/php/ext/brotli; \
docker-php-ext-configure brotli --with-libbrotli; \
docker-php-ext-install "-j${NPROC}" brotli; \
\
# SPX extension.
spx_ext_ver="0.4.15"; \
spx_ext_ver="0.4.17"; \
mkdir -p /usr/src/php/ext/spx; \
spx_url="https://github.com/NoiseByNorthwest/php-spx/archive/refs/tags/v${spx_ext_ver}.tar.gz"; \
wget -qO- "${spx_url}" | tar xz --strip-components=1 -C /usr/src/php/ext/spx; \
Expand Down
11 changes: 10 additions & 1 deletion 8/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ ifneq ($(STABILITY_TAG),)
endif
endif

.PHONY: build buildx-build buildx-push buildx-build-amd64 test push shell run start stop logs clean release
.PHONY: build build-debug buildx-build buildx-push buildx-build-amd64 test push shell run start stop logs clean release

default: build

Expand All @@ -49,6 +49,15 @@ build:
--build-arg PECL_HTTP_PROXY=$(PECL_HTTP_PROXY) \
./

build-debug:
docker build -t $(REPO):$(TAG) \
--build-arg PHP_VER=$(PHP_VER) \
--build-arg PHP_DEV=$(PHP_DEV) \
--build-arg WODBY_USER_ID=$(WODBY_USER_ID) \
--build-arg WODBY_GROUP_ID=$(WODBY_GROUP_ID) \
--build-arg PECL_HTTP_PROXY=$(PECL_HTTP_PROXY) \
--no-cache --progress=plain ./ 2>&1 | tee build.log

# --load doesn't work with multiple platforms https://github.com/docker/buildx/issues/59
# we need to save cache to run tests first.
buildx-build-amd64:
Expand Down
8 changes: 5 additions & 3 deletions 8/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ process_templates() {
fi

# Extensions that don't work with --enabled-debug
_gotpl "docker-php-ext-newrelic.ini.tmpl" "${PHP_INI_DIR}/conf.d/docker-php-ext-newrelic.ini"
if [[ "${php_ver_minor}" != "8.4" ]]; then
_gotpl "docker-php-ext-newrelic.ini.tmpl" "${PHP_INI_DIR}/conf.d/docker-php-ext-newrelic.ini"
_gotpl "docker-php-ext-pcov.ini.tmpl" "${PHP_INI_DIR}/conf.d/docker-php-ext-pcov.ini"
fi

_gotpl "docker-php-${php_ver_minor}.ini.tmpl" "${PHP_INI_DIR}/conf.d/docker-php.ini"
_gotpl "docker-php-ext-apcu.ini.tmpl" "${PHP_INI_DIR}/conf.d/docker-php-ext-apcu.ini"
Expand All @@ -74,8 +77,7 @@ process_templates() {
_gotpl "docker-php-ext-xhprof.ini.tmpl" "${PHP_INI_DIR}/conf.d/docker-php-ext-xhprof.ini"
_gotpl "docker-php-ext-xdebug.ini.tmpl" "${PHP_INI_DIR}/conf.d/docker-php-ext-xdebug.ini"
_gotpl "docker-php-ext-spx.ini.tmpl" "${PHP_INI_DIR}/conf.d/docker-php-ext-spx.ini"
_gotpl "docker-php-ext-opcache.ini.tmpl" "${PHP_INI_DIR}/conf.d/docker-php-ext-opcache.ini"
_gotpl "docker-php-ext-pcov.ini.tmpl" "${PHP_INI_DIR}/conf.d/docker-php-ext-pcov.ini"
_gotpl "docker-php-ext-opcache.ini.tmpl" "${PHP_INI_DIR}/conf.d/docker-php-ext-opcache.ini"
_gotpl "docker-php-ext-sqlsrv.ini.tmpl" "${PHP_INI_DIR}/conf.d/docker-php-ext-sqlsrv.ini"

_gotpl "zz-www.conf.tmpl" "/usr/local/etc/php-fpm.d/zz-www.conf"
Expand Down
31 changes: 31 additions & 0 deletions 8/patches/imagick/imagick-pr690.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
diff --git a/imagick.c b/imagick.c
index 1b765389..ebab7ae7 100644
--- a/imagick.c
+++ b/imagick.c
@@ -610,7 +610,7 @@ static zval *php_imagick_read_property(zend_object *object, zend_string *member,
if (format) {
retval = rv;
ZVAL_STRING(retval, format);
- php_strtolower(Z_STRVAL_P(retval), Z_STRLEN_P(retval));
+ zend_str_tolower(Z_STRVAL_P(retval), Z_STRLEN_P(retval));
IMAGICK_FREE_MAGICK_MEMORY(format);
} else {
retval = rv;
@@ -683,7 +683,7 @@ static zval *php_imagick_read_property(zval *object, zval *member, int type, voi
if (format) {
retval = rv;
ZVAL_STRING(retval, format);
- php_strtolower(Z_STRVAL_P(retval), Z_STRLEN_P(retval));
+ zend_str_tolower(Z_STRVAL_P(retval), Z_STRLEN_P(retval));
IMAGICK_FREE_MAGICK_MEMORY(format);
} else {
retval = rv;
@@ -766,7 +766,7 @@ static zval *php_imagick_read_property(zval *object, zval *member, int type, con

if (format) {
ZVAL_STRING(retval, format, 1);
- php_strtolower(Z_STRVAL_P(retval), Z_STRLEN_P(retval));
+ zend_str_tolower(Z_STRVAL_P(retval), Z_STRLEN_P(retval));
IMAGICK_FREE_MAGICK_MEMORY(format);
} else {
ZVAL_STRING(retval, "", 1);
91 changes: 91 additions & 0 deletions 8/templates/docker-php-8.4.ini.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
; This file user only to override default php.ini values
; BASIC SETTINGS: $PHP_INI_DIR/php.ini
; PHP-FPM SETTINGS: /usr/local/etc/php-fpm.d/zz-www.conf

[PHP]
display_errors = {{ getenv "PHP_DISPLAY_ERRORS" "On" }}
display_startup_errors = {{ getenv "PHP_DISPLAY_STARTUP_ERRORS" "On" }}
expose_php = {{ getenv "PHP_EXPOSE" "Off" }}
max_execution_time = {{ getenv "PHP_MAX_EXECUTION_TIME" "120" }}
max_input_time = {{ getenv "PHP_MAX_INPUT_TIME" "60" }}
max_input_vars = {{ getenv "PHP_MAX_INPUT_VARS" "2000" }}
post_max_size = {{ getenv "PHP_POST_MAX_SIZE" "32M" }}
upload_max_filesize = {{ getenv "PHP_UPLOAD_MAX_FILESIZE" "32M" }}
max_file_uploads = {{ getenv "PHP_MAX_FILE_UPLOADS" "20" }}
allow_url_fopen = {{ getenv "PHP_ALLOW_URL_FOPEN" "On" }}
default_socket_timeout = {{ getenv "PHP_DEFAULT_SOCKET_TIMEOUT" "60" }}
output_buffering = {{ getenv "PHP_OUTPUT_BUFFERING" "4096" }}
short_open_tag = {{ getenv "PHP_SHORT_OPEN_TAG" "1" }}
disable_functions = {{ getenv "PHP_DISABLE_FUNCTIONS" }}
disable_classes = {{ getenv "PHP_DISABLE_CLASSES" }}

realpath_cache_size = {{ getenv "PHP_REALPATH_CACHE_SIZE" "4096k" }}
realpath_cache_ttl = {{ getenv "PHP_REALPATH_CACHE_TTL" "120" }}
memory_limit = {{ getenv "PHP_CLI_MEMORY_LIMIT" "-1" }}
error_reporting = {{ getenv "PHP_ERROR_REPORTING" "E_ALL" }}
log_errors = {{ getenv "PHP_LOG_ERRORS" "On" }}
log_errors_max_len = {{ getenv "PHP_LOG_ERRORS_MAX_LEN" "0" }}
error_log = /proc/self/fd/2
auto_prepend_file = {{ getenv "PHP_AUTO_PREPEND_FILE" }}
auto_append_file = {{ getenv "PHP_AUTO_APPEND_FILE" }}

[Date]
date.timezone = {{ getenv "PHP_DATE_TIMEZONE" "UTC"}}

[Phar]
phar.readonly = {{ getenv "PHP_PHAR_READONLY" "1" }}
phar.require_hash = {{ getenv "PHP_PHAR_REQUIRE_HASH" "1" }}
phar.cache_list = {{ getenv "PHP_PHAR_CACHE_LIST" "" }}

[mail function]
sendmail_path = {{ getenv "PHP_SENDMAIL_PATH" "/usr/bin/msmtp -t -i" }}
mail.mixed_lf_and_crlf = {{ getenv "PHP_MAIL_MIXED_LF_AND_CRLF" "Off" }}

[MySQLi]
mysqli.cache_size = {{ getenv "PHP_MYSQLI_CACHE_SIZE" "2000" }}

[Session]
session.save_handler = {{ getenv "PHP_SESSION_SAVE_HANDLER" "files" }}
session.save_path = "{{ getenv "PHP_SESSION_SAVE_PATH" "/mnt/files/sessions" }}"
session.use_strict_mode = {{ getenv "PHP_SESSION_USE_STRICT_MODE" "0" }}
session.use_cookies = {{ getenv "PHP_SESSION_USE_COOKIES" "1" }}
session.cookie_secure = {{ getenv "PHP_SESSION_COOKIE_SECURE" "0" }}
session.use_only_cookies = {{ getenv "PHP_SESSION_USE_ONLY_COOKIES" "1" }}
session.name = {{ getenv "PHP_SESSION_NAME" "PHPSESSID" }}
session.auto_start = {{ getenv "PHP_SESSION_AUTO_START" "0" }}
session.cookie_lifetime = {{ getenv "PHP_SESSION_COOKIE_LIFETIME" "0" }}
session.cookie_path = {{ getenv "PHP_SESSION_COOKIE_PATH" "/" }}
session.cookie_domain = {{ getenv "PHP_SESSION_COOKIE_DOMAIN" }}
session.cookie_httponly = {{ getenv "PHP_SESSION_COOKIE_HTTPONLY" "0" }}
session.serialize_handler = {{ getenv "PHP_SESSION_SERIALIZE_HANDLER" "php" }}
session.gc_probability = {{ getenv "PHP_SESSION_GC_PROBABILITY" "1" }}
session.gc_divisor = {{ getenv "PHP_SESSION_GC_DIVISOR" "100" }}
session.gc_maxlifetime = {{ getenv "PHP_SESSION_GC_MAXLIFETIME" "1440" }}
session.referer_check = {{ getenv "PHP_SESSION_REFERER_CHECK" "" }}
session.cache_limiter = {{ getenv "PHP_SESSION_CACHE_LIMITER" "nocache" }}
session.cache_expire = {{ getenv "PHP_SESSION_CACHE_EXPIRE" "180" }}
session.use_trans_sid = {{ getenv "PHP_SESSION_USE_TRANS_SID" "0" }}
session.sid_length = {{ getenv "PHP_SESSION_SID_LENGTH" "26" }}
session.trans_sid_tags = "{{ getenv "PHP_SESSION_TRANS_SID_TAGS" "a=href,area=href,frame=src,form=" }}"
session.trans_sid_hosts = {{ getenv "PHP_SESSION_TRANS_SID_HOSTS" "" }}
session.sid_bits_per_character = {{ getenv "PHP_SESSION_SID_BITS_PER_CHARACTER" "5" }}
session.upload_progress.enabled = {{ getenv "PHP_SESSION_UPLOAD_PROGRESS_ENABLED" "on" }}
session.upload_progress.cleanup = {{ getenv "PHP_SESSION_UPLOAD_PROGRESS_CLEANUP" "on" }}
session.upload_progress.prefix = "{{ getenv "PHP_SESSION_UPLOAD_PROGRESS_PREFIX" "upload_progress_" }}"
session.upload_progress.name = "{{ getenv "PHP_SESSION_UPLOAD_PROGRESS_NAME" "PHP_SESSION_UPLOAD_PROGRESS" }}"
session.upload_progress.freq = "{{ getenv "PHP_SESSION_UPLOAD_PROGRESS_FREQ" "1%" }}"
session.upload_progress.min_freq = "{{ getenv "PHP_SESSION_UPLOAD_PROGRESS_MIN_FREQ" "1" }}"
session.lazy_write = {{ getenv "PHP_SESSION_LAZY_WRITE" "on" }}

[Assertion]
zend.assertions = {{ getenv "PHP_ZEND_ASSERTIONS" "1" }}
zend.exception_ignore_args = {{ getenv "PHP_ZEND_EXCEPTION_IGNORE_ARGS" "0" }}
zend.multibyte = {{ getenv "PHP_ZEND_MULTIBYTE" "0" }}
zend.signal_check = {{ getenv "PHP_ZEND_SIGNAL_CHECK" "0" }}
zend.exception_string_param_max_len = {{ getenv "PHP_ZEND_EXCEPTION_STRING_PARAM_MAX_LEN" "15" }}
{{- if getenv "PHP_ZEND_SCRIPT_ENCODING" }}
zend.script_encoding = {{ getenv "PHP_ZEND_SCRIPT_ENCODING" }}
{{- end }}
{{- if getenv "PHP_ZEND_DETECT_UNICODE" }}
zend.detect_unicode = {{ getenv "PHP_ZEND_DETECT_UNICODE" }}
{{- end }}
2 changes: 0 additions & 2 deletions 8/tests/php_modules/8.4
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,10 @@ memcached
mongodb
mysqli
mysqlnd
newrelic
OAuth
openssl
opentelemetry
pcntl
pcov
pcre
PDO
pdo_mysql
Expand Down
Loading

0 comments on commit 2cb6b73

Please sign in to comment.