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
{{ message }}
Repository navigation
tutorial on how to compile php into static binary build #1
thank you for sharing the static binary and explanation .
i am using musl to do static binary build and able to get most of the binary in static build. It is only when i try to compile php using musl gcc that i run into problem. i assume you are using gcc to create these static binary ?
May i know are you able to share tutorial on how to compile php into static binary build and your email contact . i can follow up on question in regard to compilation privately rather post on public message board.
I use this script to record all the build command into a shell script, there is ~/php_build_gcc.sh , ~/php_build_gcc++.sh, , ~/php_build_gcc++.sh, ~/php_build_linker.sh.
modify the scripts to remove all unwanted flags like -fpie, -shared, and you also need modify the linker to made it generate static binary.
clear all shared object file, then run the scripts to build the new static binary. you can write a script like make to skip the already exists object file by time.
it will stop some where in the build process, you may need modify php_config.h and scripts or add patch to made it continue.
you maybe need adjust static library orders at link step to avoid symbol problem.
I suggestion disable all extensions when you start.
i have problem compile openssl,curl into the new php8.0.12 and latest php7 . private message your email so i can drop down more info on the compilation process.
do 'info (at) phpstatic.com' able to reach you ?
Activity
phpstatic commentedon Apr 14, 2021
The process is a bit complex, I will try explain here:
patch the source code to remove all dynamic library code.
use a compile wrapper script like
ccacheto build shared binary .I use this script to record all the build command into a shell script, there is
~/php_build_gcc.sh,~/php_build_gcc++.sh, ,~/php_build_gcc++.sh,~/php_build_linker.sh.modify the scripts to remove all unwanted flags like
-fpie,-shared, and you also need modify the linker to made it generate static binary.clear all shared object file, then run the scripts to build the new static binary. you can write a script like make to skip the already exists object file by time.
it will stop some where in the build process, you may need modify
php_config.hand scripts or add patch to made it continue.you maybe need adjust static library orders at link step to avoid symbol problem.
I suggestion disable all extensions when you start.
nonvwvnon commentedon Nov 3, 2021
i have problem compile openssl,curl into the new php8.0.12 and latest php7 . private message your email so i can drop down more info on the compilation process.
do 'info (at) phpstatic.com' able to reach you ?
heyjordn commentedon Jul 20, 2023
Anymore details on this @phpstatic I would like to try compiling myself.
Could you go into more detail here?