Skip to content

Conversation

@ChiragAgg5k
Copy link
Member

@ChiragAgg5k ChiragAgg5k commented Dec 5, 2025

Summary

This PR adds support for PHP 8.4.

Changes

  • Added php-8.4/Dockerfile with PHP 8.4 base image
  • Added php-8.4/tests.yaml for extension verification

Extensions Included

All extensions from PHP 8.3 are included:

  • Redis 6.1.0
  • Swoole v5.1.7
  • Imagick 3.7.0
  • YAML 2.2.4
  • MaxMindDB v1.12.0
  • Scrypt 2.0.1
  • Zstd 0.14.0
  • Brotli 0.15.0
  • Snappy 0.2.2
  • LZ4 0.4.4
  • XDebug 3.4.1

Notes

  • Uses PHP 8.4 API version directory: no-debug-non-zts-20240924

Summary by CodeRabbit

  • New Features
    • PHP 8.4 support with a broad extension suite (Redis, Swoole, ImageMagick, YAML, Scrypt, Zstd, Brotli, LZ4, Snappy, Xdebug)
  • Tests
    • Added automated checks that verify the presence of the key PHP extensions in the runtime
  • Chores (CI)
    • CI build matrix expanded to include PHP 8.4 so images are built and published for the new version

✏️ Tip: You can customize this high-level summary in your review settings.

- Add Dockerfile for PHP 8.4 with all required extensions
- Add tests.yaml for PHP 8.4 extension verification
- Extensions included: Redis, Swoole, Imagick, YAML, MaxMindDB, Scrypt, Zstd, Brotli, Snappy, LZ4, XDebug
- Uses PHP 8.4 API version directory (no-debug-non-zts-20240924)
@coderabbitai
Copy link

coderabbitai bot commented Dec 5, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Adds a new PHP 8.4 multi-stage Dockerfile (Alpine-based) that defines environment variables and build stages to compile and enable multiple extensions (redis, swoole, imagick, yaml, maxminddb, scrypt, zstd, brotli, snappy, lz4, xdebug). The final image installs runtime libraries, copies compiled extension .so files from build stages, generates ini files to enable them, sets timezone, exposes port 80, and uses a persistent command. Also adds php-8.4/tests.yaml to assert presence of nine extensions' shared objects, and updates the GitHub Actions matrix to include PHP 8.4.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

  • Review each extension build stage for correct build dependencies, PHP 8.4 compatibility, and compile flags
  • Verify that copied .so filenames and paths match the entries in tests.yaml
  • Confirm ini generation/placement and ordering (avoid duplicate/conflicting settings)
  • Check final image for required runtime libraries and minimal attack surface (unnecessary build tools removed)
  • Validate CI matrix change and ensure tags/outputs remain consistent with existing versions

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: Add PHP 8.4 support' directly and clearly summarizes the main change: adding support for PHP 8.4 across the repository.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/php-8.4-support

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f4bad2b and 5705486.

📒 Files selected for processing (1)
  • .github/workflows/build-and-push.yml (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: build (8.1)
  • GitHub Check: build (8.0)
  • GitHub Check: build (8.3)
  • GitHub Check: build (8.2)
🔇 Additional comments (1)
.github/workflows/build-and-push.yml (1)

17-17: Workflow matrix update is safe to merge.

The addition of '8.4' to the php-versions matrix is syntactically correct and follows the existing naming convention. The supporting infrastructure is in place: php-8.4/Dockerfile (6060 bytes) and php-8.4/tests.yaml (1249 bytes) both exist and are properly configured. The Dockerfile correctly targets PHP 8.4's API version directory no-debug-non-zts-20240924, as verified by the test file's extension paths. All required extensions (swoole, redis, imagick, yaml, scrypt, zstd, brotli, lz4, snappy) are included in the build tests.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (1)
php-8.4/Dockerfile (1)

184-192: Consolidate extension enablement into a single RUN command to reduce image layers.

Currently, each extension is enabled via a separate RUN command (9 commands total), which creates unnecessary Docker image layers and increases the final image size. Consolidate these into a single RUN statement for efficiency.

Apply this diff to consolidate the extension enablement:

-# Enable Extensions
-RUN echo extension=swoole.so >> /usr/local/etc/php/conf.d/swoole.ini
-RUN echo extension=redis.so >> /usr/local/etc/php/conf.d/redis.ini
-RUN echo extension=imagick.so >> /usr/local/etc/php/conf.d/imagick.ini
-RUN echo extension=yaml.so >> /usr/local/etc/php/conf.d/yaml.ini
-RUN echo extension=scrypt.so >> /usr/local/etc/php/conf.d/scrypt.ini
-RUN echo extension=zstd.so >> /usr/local/etc/php/conf.d/zstd.ini
-RUN echo extension=brotli.so >> /usr/local/etc/php/conf.d/brotli.ini
-RUN echo extension=lz4.so >> /usr/local/etc/php/conf.d/lz4.ini
-RUN echo extension=snappy.so >> /usr/local/etc/php/conf.d/snappy.ini
+# Enable Extensions
+RUN { \
+  echo "extension=swoole.so"; \
+  echo "extension=redis.so"; \
+  echo "extension=imagick.so"; \
+  echo "extension=yaml.so"; \
+  echo "extension=scrypt.so"; \
+  echo "extension=zstd.so"; \
+  echo "extension=brotli.so"; \
+  echo "extension=lz4.so"; \
+  echo "extension=snappy.so"; \
+  echo "zend_extension=xdebug.so"; \
+} | tee /usr/local/etc/php/conf.d/extensions.ini > /dev/null
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ca86cfc and f4bad2b.

📒 Files selected for processing (2)
  • php-8.4/Dockerfile (1 hunks)
  • php-8.4/tests.yaml (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: build (8.0)
  • GitHub Check: build (8.3)
  • GitHub Check: build (8.2)
  • GitHub Check: build (8.1)
🔇 Additional comments (1)
php-8.4/Dockerfile (1)

79-86: Verify maxminddb extension is being built and configured correctly.

The maxminddb stage exists, but maxminddb is not copied to the final stage (lines 172–181) or enabled (lines 184–192), despite being declared in the ENV variables and PR summary. Confirm whether this is intentional or an oversight. If intentional, remove the stage to reduce build complexity; if not, add the copy and enable steps.

Can you verify:

  1. Whether the maxminddb stage (line 79) produces a maxminddb.so file (or different name)?
  2. Whether maxminddb is intentionally excluded from the final image?

If maxminddb should be included, add these lines to the Dockerfile:

After line 181, add:

+COPY --from=maxmind /usr/local/lib/php/extensions/no-debug-non-zts-20240924/maxminddb.so /usr/local/lib/php/extensions/no-debug-non-zts-20240924/

After line 192, add:

+RUN echo extension=maxminddb.so >> /usr/local/etc/php/conf.d/maxminddb.ini

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for PHP 8.4 by creating a new Docker image configuration with the same extension set as PHP 8.3. The implementation follows the established pattern from previous PHP versions, using the new PHP 8.4 API version directory no-debug-non-zts-20240924.

  • Multi-stage Dockerfile building 11 PHP extensions (Redis, Swoole, Imagick, YAML, Scrypt, Zstd, Brotli, LZ4, Snappy, MaxMindDB, XDebug)
  • Tests to verify presence of 9 enabled extensions
  • Maintains consistency with PHP 8.3 configuration regarding which extensions are copied and enabled

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
php-8.4/Dockerfile Multi-stage build configuration for PHP 8.4-cli-alpine with extensions compiled and selectively included in final image
php-8.4/tests.yaml File existence tests for 9 PHP extensions using the PHP 8.4 API version path

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@abnegate abnegate merged commit de620a8 into main Dec 5, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants