You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm referring to at least the Alpine PHP-FPM 5.6 version here
I've just switched over from the Debian version to the Alpine Linux and was having some trouble compiling the extensions but know there are already a set of packages available in the Alpine repository for the majority of extensions needed.
After trying to install them from there, my app was complaining about a lack of extensions and investigation shows that it was because PHP is expecting the following paths
Alpine Linux on the other hand installs to a much saner
config - /etc/php5
extensions - /usr/lib/php5/modules
What I have ended up doing with my dockerfile (because docker-php-ext-* rarely works) is just to remove the originals and symlink the Alpine paths using the following:
RUN rm -R /usr/local/etc/php && \
rm -R /usr/local/lib/php/extensions/no-debug-non-zts-20131226/
RUN mkdir -p /usr/local/lib/php/extensions
RUN ln -s /etc/php5 /usr/local/etc/php && \
ln -s /usr/lib/php5/modules /usr/local/lib/php/extensions/no-debug-non-zts-20131226
With the situation explained, I have 2 questions:
Is there a reason these awkward paths are chosen?
If not, can the paths in the image be set to what Alpine would natively use? It's installation method is much simpler than the aforementioned docker function
Is there a reason these particular directories were chosen?
The text was updated successfully, but these errors were encountered:
I think this is wanted, extensions built by alpine might not be compatible with the php binary inside the image. you are expected to build the extension in the Dockerfile and not install them from alpine
if you want to use "native" alpine built extesion you're better off using the alpine image directly instead of the php:alpine image and install both php and the extensions from alpine
Indeed, as noted, this is definitely intentional. Not only are these paths the defaults that the PHP ./configure script uses given --prefix=/usr/local, but it's also important that any additional extensions be compiled against the appropriate version of PHP, and thus installing extensions from distribution packages is heavily discouraged and likely to lead to trouble (see #542 for a recent change which actively blocks exactly that in Debian-based images).
I'm referring to at least the Alpine PHP-FPM 5.6 version here
I've just switched over from the Debian version to the Alpine Linux and was having some trouble compiling the extensions but know there are already a set of packages available in the Alpine repository for the majority of extensions needed.
After trying to install them from there, my app was complaining about a lack of extensions and investigation shows that it was because PHP is expecting the following paths
config - /usr/local/etc/php
extensions - /usr/local/lib/php/extensions/no-debug-non-zts-20131226/
Alpine Linux on the other hand installs to a much saner
config - /etc/php5
extensions - /usr/lib/php5/modules
What I have ended up doing with my dockerfile (because docker-php-ext-* rarely works) is just to remove the originals and symlink the Alpine paths using the following:
With the situation explained, I have 2 questions:
Is there a reason these particular directories were chosen?
The text was updated successfully, but these errors were encountered: