Comments (19)
可以自己添加
wget https://github.com/winlibs/libmcrypt/archive/refs/tags/libmcrypt-2.5.8-3.4.tar.gz
mkdir -p libmcrypt
tar --strip-components=1 -C /work/thirdparty/libmcrypt -xf /work/pool/lib/libmcrypt-2.5.8-3.4.tar.gz
# 静态编译
chmod a+x ./install-sh
sh ./configure --prefix=/usr/libmcrypt \
--enable-static=yes \
--enable-shared=no
make -j `nproc`
make install
micro 构建配置脚本:
build-config-php-8-micro.sh
build-make-php-8-micro.sh
今天编译时临时加上了 mcrypt 扩展
from static-php-cli.
安装libmcrypt依赖库参考: https://github.com/jingjingxyk/swoole-cli/blob/1ffb277dd93b70385f12022f1862fa3ac65c5003/library_install_builder_test.php#L1615
from static-php-cli.
安装libmcrypt依赖库参考: https://github.com/jingjingxyk/swoole-cli/blob/1ffb277dd93b70385f12022f1862fa3ac65c5003/library_install_builder_test.php#L1615
好的,我研究下
from static-php-cli.
进入容器就可以开始静态编译PHP了,依赖库已经提前准备好了 提前构建依赖库的 Dockerfile 文件
#!/bin/env sh
__DIR__=$(
cd "$(dirname "$0")"
pwd
)
default_image=registry.cn-beijing.aliyuncs.com/jingjingxyk-public/app:build-swoole-cli-build-dependencies-alpine-edge-20230226T074232Z
image=$default_image
docker run --rm --name swoole-cli-build-dev-all-dependencies-container -d -v ${__DIR__}:/work -w /work $image tail -f /dev/null
进入容器就可以开始构建PHP了
from static-php-cli.
容器里准备了这些依赖库
COPY --from=builder-all-library /usr/openssl/ /usr/openssl/
COPY --from=builder-all-library /usr/libiconv /usr/libiconv
COPY --from=builder-all-library /usr/libxml2/ /usr/libxml2/
COPY --from=builder-all-library /usr/libxslt/ /usr/libxslt/
COPY --from=builder-all-library /usr/brotli/ /usr/brotli/
COPY --from=builder-all-library /usr/zlib /usr/zlib
COPY --from=builder-all-library /usr/bzip2 /usr/bzip2
COPY --from=builder-all-library /usr/liblz4 /usr/liblz4
COPY --from=builder-all-library /usr/liblzma /usr/liblzma
COPY --from=builder-all-library /usr/libzstd /usr/libzstd
COPY --from=builder-all-library /usr/libzip /usr/libzip
COPY --from=builder-all-library /usr/libgif /usr/libgif
COPY --from=builder-all-library /usr/libpng /usr/libpng
COPY --from=builder-all-library /usr/libjpeg /usr/libjpeg
COPY --from=builder-all-library /usr/freetype /usr/freetype
COPY --from=builder-all-library /usr/libwebp /usr/libwebp
COPY --from=builder-all-library /usr/imagemagick /usr/imagemagick
COPY --from=builder-all-library /usr/libidn2 /usr/libidn2
COPY --from=builder-all-library /usr/cares /usr/cares
COPY --from=builder-all-library /usr/curl/ /usr/curl/
COPY --from=builder-all-library /usr/icu/ /usr/icu/
COPY --from=builder-all-library /usr/ncurses /usr/ncurses
COPY --from=builder-all-library /usr/readline /usr/readline
COPY --from=builder-all-library /usr/mimalloc/ /usr/mimalloc/
COPY --from=builder-all-library /usr/pgsql/ /usr/pgsql/
COPY --from=builder-all-library /usr/libffi /usr/libffi
COPY --from=builder-all-library /usr/gmp/ /usr/gmp/
COPY --from=builder-all-library /usr/sqlite3/ /usr/sqlite3/
COPY --from=builder-all-library /usr/oniguruma/ /usr/oniguruma/
COPY --from=builder-all-library /usr/libsodium/ /usr/libsodium/
COPY --from=builder-all-library /usr/libyaml /usr/libyaml
from static-php-cli.
我不会用docker,只想要在基础扩展中多添加一个mcrypt扩展的静态php可执行文件,能帮我编译一份吗
from static-php-cli.
@y1713375484
已经上传到这里了呀
#27 (comment)
https://github.com/crazywhalecc/static-php-cli/files/10834490/micro.sfx.linux.zip
from static-php-cli.
@y1713375484 已经上传到这里了呀 #27 (comment)
https://github.com/crazywhalecc/static-php-cli/files/10834490/micro.sfx.linux.zip
from static-php-cli.
会用了,用.sfx文件和phar编译成了可执行文件了,但还是想要一个单独的php的静态执行文件
from static-php-cli.
自己编译呀,现在简单多了,因为其他(swoole-cli) 项目,已经提前把依赖库解决了 swoole/swoole-cli#41
提前解决了依赖库,你就直接开始构建编译就行了
进入容器,你就可以开始编译静态PHP了 (扩展的依赖库依靠容器技术已经提前解决了)
from static-php-cli.
需要的脚本都放这里了:linux x86-64版本
php7静态编译 : https://github.com/jingjingxyk/swoole-cli/tree/new_dev_build/build-tools/php-7
php8静态编译: https://github.com/jingjingxyk/swoole-cli/tree/new_dev_build/build-tools/php-8
from static-php-cli.
(禁止偷家(bushi
from static-php-cli.
需要的脚本都放这里了:linux x86-64版本 php7静态编译 : https://github.com/jingjingxyk/swoole-cli/tree/new_dev_build/build-tools/php-7 php8静态编译: https://github.com/jingjingxyk/swoole-cli/tree/new_dev_build/build-tools/php-8
@jingjingxyk php静态编译?这个仓库就是啊,你这个是把代码转成二进制?
from static-php-cli.
需要的脚本都放这里了:linux x86-64版本 php7静态编译 : https://github.com/jingjingxyk/swoole-cli/tree/new_dev_build/build-tools/php-7 php8静态编译: https://github.com/jingjingxyk/swoole-cli/tree/new_dev_build/build-tools/php-8
@jingjingxyk php静态编译?这个仓库就是啊,你这个是把代码转成二进制?
他的意思是 swoole-cli 这个项目有你需要的构建需求了,这个项目和本项目的功能类似,各有不同特点。
from static-php-cli.
(禁止偷家(bushi
着实没看懂呀?
构建扩展的依赖库,不就3种方式:
1、源码编译;
2、借助系统源已经构建好依赖库
3、上面两种混合使用
我目前只不过是参与了,源码编译扩展依赖库 。其它都是连带测试一下能不能用
目的: 提前构建好扩展的依赖库,至于扩展是否要启用,由使用人决定
本项目:是一个很好的参考项目,我参考以后,我把我的成果发了出来了而已,我可没啥其他意思
编译的静态库:可不止PHP 需要,我编译 ffmpeg opencv ovn socat aria2 都是需要的,也就是这个文件里的这些: https://github.com/jingjingxyk/swoole-cli/blob/new_dev/library_builder.php
from static-php-cli.
@crazywhalecc 我发现这个项目的时候star才几十个,我是第42个star,加油
from static-php-cli.
(禁止偷家(bushi
着实没看懂呀?
构建扩展的依赖库,不就3种方式: 1、源码编译; 2、借助系统源已经构建好依赖库 3、上面两种混合使用
我目前只不过是参与了,源码编译扩展依赖库 。其它都是连带测试一下能不能用
目的: 提前构建好扩展的依赖库,至于扩展是否要启用,由使用人决定
本项目:是一个很好的参考项目,我参考以后,我把我的成果发了出来了而已,我可没啥其他意思
编译的静态库:可不止PHP 需要,我编译 ffmpeg opencv ovn socat aria2 都是需要的,也就是这个文件里的这些: https://github.com/jingjingxyk/swoole-cli/blob/new_dev/library_builder.php
我没其他意思,就是说你们在这个项目上 Issue 讨论了好久,我都鸽了很久了,感觉都快变成不是我的项目了,摊手调侃一下。(笑哭)我等最近忙完会发布重构的版本。
from static-php-cli.
mcrypt 只适用于 Linux,重构版本完成 Linux builder 后可支持。
from static-php-cli.
这项目确实方便,静态编译部署比docker什么的强多了
from static-php-cli.
Related Issues (20)
- freetype is buggy for bulk(huge) HOT 1
- postgresql bug in bulk build for macOS x86_64 HOT 7
- macOS 环境下 静态编译 libldap imap 库 存在 编译bug
- macOS does not support mongodb extension HOT 1
- gd 扩展无法在 Actions 构建 HOT 9
- 这个新的分支和以前旧的分支构建上有什么区别吗? HOT 26
- ext-snappy configuration may break features of other extensions
- 是否支持libwebp,--with-webp编译选项 HOT 4
- 如何自定义每个依赖库的编译选项,添加自己想要的其他库? HOT 9
- [CRIT] Source [pkg-config] not downloaded or not locked, you should download it first ! HOT 11
- error shown when using the built in composer and php HOT 1
- Redis compression and serializer options not enabled in phpredis HOT 2
- Add backup url for unstable sources
- Unable to Build PHP Static with GitHub Actions - [CRIT] ext [igbinary] is not supported yet HOT 1
- 大佬,actions构建的 apcu 扩展 如何把apc.enable_cli=1写入php.ini里面,我应该改那个文件呢? HOT 1
- Bulk build failed: libxml2 with icu HOT 1
- 构建postgresql扩展报错 src/Makefile.shlib:461: *** 遗漏“endif” HOT 2
- uv 和 swoole 同时启用的时候会导致 uv 找不到,分开各自编译都是ok的 HOT 2
- imagick 和 swoole 同时编译报错,去掉 lib.json 中 brotli 的 `-static` 后缀就可以正常编译了 HOT 2
- 【feature】 support UI extension HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from static-php-cli.