Closed bpolaszek closed 4 months ago
PHP sources are missing (they are included in the builder images we provide), otherwise you need to install them by yourself as described in the "compile form sources" docs.
My bad, didn't understand that step was required prior to using Xcaddy (all that go stuff is black box to me). Sorry for disturbing! Still not lucky, unfortunately. No biggie (don't waste your time investigating, I was just curious about building FrankenPHP with Xcaddy, hoping it would work in a snap).
2024/05/29 16:22:10 [INFO] Build environment ready
2024/05/29 16:22:10 [INFO] Building Caddy
2024/05/29 16:22:10 [INFO] exec (timeout=0s): /opt/homebrew/bin/go mod tidy -e
2024/05/29 16:22:10 [INFO] exec (timeout=0s): /opt/homebrew/bin/go build -o /tmp/php-8.3.7/frankenphp -ldflags -w -s
# caddy
/opt/homebrew/Cellar/go/1.22.3/libexec/pkg/tool/darwin_arm64/link: running cc failed: exit status 1
ld: warning: ignoring duplicate libraries: '-largon2', '-laspell', '-lbz2', '-lc++', '-lcom_err', '-lcrypto', '-lcurl', '-ledit', '-lexslt', '-lffi', '-lgd', '-lgmp', '-lgssapi_krb5', '-liconv', '-licudata', '-licui18n', '-licuio', '-licuuc', '-lintl', '-lk5crypto', '-lkrb5', '-llber', '-lldap', '-lm', '-lncurses', '-lnetwork', '-lodbc', '-lonig', '-lpcre2-8', '-lpq', '-lpspell', '-lresolv', '-lsodium', '-lsqlite3', '-lssl', '-lsybdb', '-ltidy', '-lxml2', '-lxslt', '-lz', '-lzip'
Undefined symbols for architecture arm64:
"_compiler_globals", referenced from:
_execute_script_cli in 000007.o
"_core_globals", referenced from:
_frankenphp_worker_request_shutdown in 000007.o
_frankenphp_request_reset in 000007.o
_frankenphp_worker_request_startup in 000007.o
"_executor_globals", referenced from:
_zif_frankenphp_handle_request in 000007.o
_frankenphp_execute_script in 000007.o
_execute_script_cli in 000007.o
_frankenphp_worker_request_shutdown in 000007.o
_frankenphp_request_reset in 000007.o
_frankenphp_worker_request_startup in 000007.o
"_sapi_globals", referenced from:
_zif_frankenphp_finish_request in 000007.o
_zif_frankenphp_request_headers in 000007.o
_zif_frankenphp_response_headers in 000007.o
_zif_frankenphp_handle_request in 000007.o
_zif_headers_send in 000007.o
_zif_headers_send in 000007.o
_frankenphp_update_server_context in 000007.o
...
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
2024/05/29 16:22:15 [INFO] Cleaning up temporary folder: /tmp/php-8.3.7/buildenv_2024-05-29-1622.2977248618
2024/05/29 16:22:15 [FATAL] exit status 1
It looks like you didn't enable ZTS support. Did you compile PHP with these flags: https://frankenphp.dev/docs/compile/#linux ?
As FrankenPHP uses cgo (because PHP is written in C), it's more complicated to build than usual C programs. You need libphp compiled with the proper options.
I'm having the same error of of 'Zend/zend_types.h' file not found
in the static builds (trying to build a Laravel app) instead of while building xcaddy. Also on Sonoma.
What happened?
Hello there, I tried building FrankenPHP with Xcaddy but it crashes (MacOS Sonoma, Apple M1).
Copy/pasted from the docs:
Any ideas?
Build Type
Custom (tell us more in the description)
Worker Mode
No
Operating System
macOS
CPU Architecture
Apple Silicon
PHP configuration
Relevant log output