admin管理员组文章数量:1314442
Im want to create a docker container where I can serve my PHP project with Apache.
Right now I'm using php:8.3.16-cli-alpine3.20
as the base image. The project depends on numerous extensions which I add the following way:
ADD --chmod=0755 /usr/local/bin/
RUN install-php-extensions gd redis intl protobuf mysqli
After that I install apache and copy it's configuration:
RUN apk add --no-cache apache2 php$phpverx-apache2
COPY ./default.conf /etc/apache2/httpd.conf
Here comes the problem. The php$phpverx-apache2
package overrides my PHP and because of this my project is not working. Is there any way I can tell apache to use my already installed PHP? I am thinking about adding LoadModule php_module path/to/my/php.so
, but I can't locate it on Alpine linux.
I would appreciate any help.
Im want to create a docker container where I can serve my PHP project with Apache.
Right now I'm using php:8.3.16-cli-alpine3.20
as the base image. The project depends on numerous extensions which I add the following way:
ADD --chmod=0755 https://github/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
RUN install-php-extensions gd redis intl protobuf mysqli
After that I install apache and copy it's configuration:
RUN apk add --no-cache apache2 php$phpverx-apache2
COPY ./default.conf /etc/apache2/httpd.conf
Here comes the problem. The php$phpverx-apache2
package overrides my PHP and because of this my project is not working. Is there any way I can tell apache to use my already installed PHP? I am thinking about adding LoadModule php_module path/to/my/php.so
, but I can't locate it on Alpine linux.
I would appreciate any help.
Share Improve this question asked Jan 30 at 11:20 SabeexSabeex 431 silver badge5 bronze badges1 Answer
Reset to default 1Use the fpm-alpine
base-image and do not install php$phpverx-apache2
inside. Instead bind your Apache2 HTTP application server to the PHP FPM version (via mod_proxy_fcgi, Examples (apache.)).
RUN apk add --no-cache apache2 apache2-proxy
AFAIK the Docker PHP Alpine images do not ship with an Apache module.
本文标签: Docker PHP alpine can39t configure Apache to use PHPStack Overflow
版权声明:本文标题:Docker PHP alpine can't configure Apache to use PHP - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741970380a2407800.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论