Install extension for php through exec command

You shared that

But I’m not sure what that is supposed to mean. So pleas, share the base image, if you have a shareable Dockerfile, please share that too.

I’m also confused about this:

As far as I know, php index.php just runs the index.php in command line without any webserver. That would only be a command line application and command line applications and PHP behind webservers use different configs and can load different extensions.

I don’t see how php index.php could run any web-based php app (unless using some parameters to run the built-in webserver), but I assume you you are using an image where the extension is loaded in one PHP but not in the other if you have multiple PHP in the same image. Official PHP images for example have a PHP built from source, so extension paths and configs could be different.