7

把PHP或php项目静态编译为二进制发行版

 1 year ago
source link: https://blog.p2hp.com/archives/10848
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Swoole-Cli 或静态编译PHP 是一个 PHP 的二进制发行版,集成了 swoolephp 内核php-cliphp-fpm以及多个常用扩展。Swoole-Cli 或静态编译PHP 是全部静态编译打包的,不依赖任何操作系统的so动态链接库,具备非常好的移植性,可以在任意 Linux 系统之间复制,下载即可使用。

静态编译无依赖

swoole-cli或静态编译PHP 会全部使用静态编译连接方式,libclibstdc++使用musl,并会包含opensslcurl库和扩展。

用户可修改构建脚本添加其他更多三方扩展。

使得 Swoole 或PHP程序不再依赖任何系统的so,可在任意Linux系统之间复制分发运行。

静态编译是一项比较多见于 Golang 的编译方式,在传统的 Linux 系统下,正常的程序和库基本是动态编译链接(Dynamically linked)的,也就是说,不同程序引用同样的库可以共用,减少资源重复。

{
https://zhuanlan.zhihu.com/p/581695339
https://zhuanlan.zhihu.com/p/459983471
https://www.workerman.net/q/10098
https://www.workerman.net/q/10099
}

https://github.com/crazywhalecc/static-php-cli
https://github.com/dixyes/phpmicro
https://github.com/walkor/static-php-cli
https://github.com/crazywhalecc/php-cli-helper

PHP静态编译版本下载

webman官方提供了一些PHP静态编译版本,就是无需部署PHP环境,就可以独立运行。
下载地址 https://www.workerman.net/download

各种二进制的资源库
https://dl.zhamao.xin/php-bin/file/

Swoole-cli下载

https://www.swoole.com/download


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK