Caddy:2.7.6-builder with Frakenphp

1. The problem I’m having:

I have undid and redid alpine and can not get this to work, it worked october.
I did ask on the frakenphp github, but he closed the issue,I can ask again since the error changed, i just thought you may know too, and dunglas may not want to be bothered a that much by one person.

plus its probably something that was announced somewhere i didn’t see. :innocent:

2. Error messages and/or full log output:

=> => # 2024/03/10 20:06:17 [INFO] exec (timeout=0s): /usr/local/go/bin/go build -o /src/caddy -ldflags -w -s
 => => # #
 => => # /go/pkg/mod/ fatal error: php_variables.h: No such file or directory
 => => #    30 | // #include <php_variables.h>
 => => #       |           ^~~~~~~~~~~~~~~~~
 => => # compilation terminated.

3. Caddy version:

FROM caddy:2.7.6-builder AS builder

4. How I installed and ran Caddy:


FROM caddy:2.7.6-builder-alpine AS builder
RUN apk --no-cache add make git gcc libtool musl-dev ca-certificates dumb-init
RUN echo "" | tee -a /etc/apk/repositories
RUN apk update
#ADD apk_repositories /etc/apk/repositories
RUN apk --no-cache add php82 php82-dev
#RUN apt install -y build-essential automake autoconf bison re2c libsqlite3-dev git libxml2-dev python3.11 python3.11-dev libtool pkg-config
#RUN git clone -v --depth 1 --branch master libxml2
#RUN cd /src/libxml2/ && git remote update && git fetch
# && git checkout tags/v2.12.5
#RUN cd /src/libxml2 autoreconf && ./ && ./configure && make && make install
# php
#RUN git clone php_8_3_3
#RUN cd /src/php_8_3_3 && ./buildconf -f --debug
#RUN cd /src/php_8_3_3 && ./configure && make && make install
# xcaddy
#RUN wget
#RUN tar xzvf /src/xcaddy_0.3.5_linux_amd64.tar.gz
ENV XCADDY_GO_BUILD_FLAGS="-ldflags '-w -s'"
RUN xcaddy build v2.7.6 --with \
--with \
--with \
--with \
--with \
--with \
--with \
--with \
--with \
--with \
--with \
--with \
--with \
--with \
--with \
--with \
FROM caddy:2.7.6
COPY --from=builder /src/caddy /usr/bin/caddy

a. System environment:

Linux redbloom 5.15.0-100-generic #110-Ubuntu SMP Wed Feb 7 13:27:48 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

b. Command:

docker build -t <img-name> .

c. Service/unit/compose file:


d. My complete Caddy config:

its a bit too long, plus right now it's irrelevant,
but if you want me to share it with the community I will.

5. Links to relevant resources:

If you’re using FrankenPHP, you probably shouldn’t use the caddy-builder image. Use the instructions at the FrankenPHP docs instead: FrankenPHP: the modern PHP app server

Are you sure you need all those plugins? Only add plugins you actually need. Don’t bloat your installation.

You are right, i do not need them all in the same executable, i was wondering if they would still compile, and if i remove frankenphp it all compiles.
I seem to have missed this part XCADDY_SETCAP=1.
I will try some more later.

The problem is that FrankenPHP requires having libphp installed before trying to build. The caddy-builder image won’t have that. The dunglas/frankenphp image does, so you should use that as a base instead, as per their docs. You’ll still be using xcaddy to build, and can add whatever plugins.

i didnt mean to make you do my work
i will send 10$ to the github project for you and frakenphp.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.