Closed dionysios-ioannidis closed 1 week ago
I think you have to do run the install-php-extensions
part in the runner image, otherwise the libraries from the extensions will be missing in the final image.
...
FROM dunglas/frankenphp AS runner
# Replace the official binary by the one containing your custom modules
COPY --from=builder /usr/local/bin/frankenphp /usr/local/bin/frankenphp
# Now install PHP extensions
RUN install-php-extensions ...
I followed your suggestion and explored other methods, but the PHP extensions are still missing from the FrankenPHP binary. I'm building the Docker image inside an Incus container. Could this be causing the issue? I'm running out of ideas, and since I'm not a Docker expert, perhaps compiling FrankenPHP from source might be an alternative approach, as explained in the documentation: https://frankenphp.dev/docs/compile/.
Looking at your Docker file and command, this isn't doing what you think it is doing. You are copying a FrankenPHP that is not statically compiled to your system. You need to statically compile FrankenPHP: https://frankenphp.dev/docs/embed/
Instead, you are using a dynamically compiled version of FrankenPHP which is using your system's installed version of PHP. If this is a non-zts build of PHP on your system, you will suffer severe performance issues and use your installed extensions. If it is a zts build of PHP and the same version from the container (same minor version with no special patches) you should be able to use it just fine this way. In fact, this is what you would end up with if you compile FrankenPHP from scratch.
Thanks to everyone who offered their help.
I decided to take a different approach and build a FrankenPHP binary without using Docker. Following the instructions at https://frankenphp.dev/docs/compile/, I downloaded and built PHP from source, installed the required dependencies on Debian (including Go and xcaddy), and successfully created a binary that meets my WordPress needs.
Since I've achieved my goal, I believe this issue is no longer necessary.
Hi,
I would like to build a custom Docker image for FrankenPHP and followed the instructions provided in the FrankenPHP documentation.
I attempted to install both the PHP extensions and the Caddy module for Cloudflare DNS. While the addition of the Caddy module was successful, I encountered issues with the PHP extensions. When visiting my WordPress site and checking the site health status, I receive the following warnings and error messages:
imagick
, is not installed or has been disabled.zip
, is not installed or has been disabled.gd
, is not installed or has been disabled.Here is my
Dockerfile
(on Debian 12):Steps to Build and Use the FrankenPHP Static File:
Could you please help me troubleshoot why the PHP extensions are not being recognized in my WordPress installation? Thank you!