Closed Embiggenerd closed 5 months ago
You need to enable CGO. See https://frankenphp.dev/docs/compile/#using-xcaddy
running command
CGO_ENABLED=1 XCADDY_GO_BUILD_FLAGS="-ldflags '-w -s'" ./xcaddy build --output frankenphp --with github.com/dunglas/frankenphp/caddy --with github.com/dunglas/mercure/caddy --with github.com/dunglas/vulcain/caddy
resulted in this out put
In file included from /root/go/pkg/mod/github.com/dunglas/frankenphp@v1.1.2/cgi.go:3:
./frankenphp.h:4:10: fatal error: Zend/zend_types.h: No such file or directory
4 | #include <Zend/zend_types.h>
| ^~~~~~~~~~~~~~~~~~~
This means that the PHP include files aren't in the include path. Please try the tutorial linked above from the beginning.
As another option one could do a static build. But I can't see where it would be possible to add other Caddy plugins in a static build. This is only possible with the xcaddy command and the --with
arguments. But then you need to have PHP dynamically linked.
@dunglas Is it possible to do a static build as described in the docs, but also add other Caddy plugins?
What happened?
Hello, I ran
./xcaddy build --with github.com/dunglas/frankenphp/caddy
from inside go/bin directory and received
I am also confused why there isn't a simple installation step. When I am looking for this sort of solution, I skim docs for a simple install step, and if I don't find it, I move on. I am only using this because I am already using caddy.
If you put this in the beginning of docs:
This will double your adoption rate.
Build Type
Custom (tell us more in the description)
Worker Mode
Yes
Operating System
GNU/Linux
CPU Architecture
x86_64
PHP configuration
Relevant log output