mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-09 01:45:36 +08:00
Update README-en.md
This commit is contained in:
116
README-en.md
116
README-en.md
@@ -1,72 +1,92 @@
|
|||||||
# static-php-swoole
|
# static-php-swoole
|
||||||
Compile A Statically Linked PHP With Swoole and other Extensions. [English README](/README-en.md)
|
Compile A Statically Linked PHP With Swoole and other Extensions.
|
||||||
|
|
||||||
BTW, It's only for CLI mode.
|
BTW, It's only for CLI mode.
|
||||||
|
|
||||||
[]()
|
[]()
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
- Tested on `x86_64` and `aarch64` platform, others have not tested.
|
- Tested on `x86_64` and `aarch64` platform, others have not tested.
|
||||||
- Requiring Alpine Linux (version >= 3.13), or requiring musl-libc
|
- Docker required (or alpine linux when I write single script file)
|
||||||
- Support WSL2
|
- Supporting PHP version from 7.2 to 8.0
|
||||||
- Supporting PHP version >= 7.3
|
|
||||||
|
|
||||||
## Start
|
## Start
|
||||||
You can directly download static binary in Release.
|
You can directly download static binary in Release.
|
||||||
|
|
||||||
Here's help command to compile it yourself:
|
Here's help command to compile it yourself:
|
||||||
```bash
|
```bash
|
||||||
# Compile script
|
git clone https://github.com/crazywhalecc/static-php-cli.git
|
||||||
./static-compile-php.sh
|
cd static-php-cli/docker
|
||||||
# And now you get `php-dist/bin/php` file!
|
docker build -t static-php .
|
||||||
```
|
```
|
||||||
|
|
||||||
## Library version
|
After compilation you can use command to get static php binary file:
|
||||||
- php: 7.4.18
|
```bash
|
||||||
- libxml2: 2.9.10
|
mkdir dist
|
||||||
- curl: 7.76.1
|
docker run --rm -v $(pwd)/dist:/dist/ -it static-php cp php-dist/bin/php /dist/
|
||||||
|
cd dist
|
||||||
|
file ./php
|
||||||
|
```
|
||||||
|
|
||||||
## Including PHP extensions
|
To customize PHP extensions, edit `docker/extensions.txt` file, and rules below:
|
||||||
- bcmath
|
- Use `#` as comment, to mark not install
|
||||||
- calendar
|
- extensions name uses lower case, and default file contains all supported extensions, if u need other extensions, consider write an Issue
|
||||||
- ctype
|
|
||||||
- filter
|
## Supported PHP extensions
|
||||||
- openssl
|
| Support | PHP Ext Name | Version | Comments |
|
||||||
- pcntl
|
| -------- | ------------ | -------- | ------------------------------------------------------- |
|
||||||
- iconv
|
| yes | bcmath | * | |
|
||||||
- inotify (3.0.0)
|
| yes | calendar | * | |
|
||||||
- json
|
| yes | ctype | * | |
|
||||||
- mbstring
|
| yes | curl | * | |
|
||||||
- phar
|
| yes | dom | * | |
|
||||||
- curl
|
| | event | | |
|
||||||
- pdo
|
| yes | filter | * | |
|
||||||
- gd
|
| yes | gd | * | |
|
||||||
- pdo_mysql
|
| yes | hash | * | PHP7.3 or older uses `--enable-hash` |
|
||||||
- mysqlnd
|
| yes | iconv | * | |
|
||||||
- sockets
|
| yes | inotify | 3.0.0 | |
|
||||||
- swoole (4.6.6)
|
| yes | json | * | |
|
||||||
- redis (5.3.4)
|
| yes | libxml | * | |
|
||||||
- simplexml
|
| yes | mbstring | * | |
|
||||||
- dom
|
| yes | mongodb | >=1.9.1 | not tested |
|
||||||
- xml
|
| | mysqli | | |
|
||||||
- xmlwriter
|
| yes | mysqlnd | * | |
|
||||||
- xmlreader
|
| yes | openssl | * | |
|
||||||
- posix
|
| yes | pcntl | * | |
|
||||||
- tokenizer
|
| yes | pdo | * | |
|
||||||
|
| yes | pdo_mysql | * | |
|
||||||
|
| | pdo_pgsql | * | |
|
||||||
|
| yes | phar | * | |
|
||||||
|
| yes | posix | * | |
|
||||||
|
| yes | redis | * | |
|
||||||
|
| yes | simplexml | * | |
|
||||||
|
| yes | sockets | * | |
|
||||||
|
| yes | swoole | >=4.6.6 | support mysqlnd, sockets, openssl, redis |
|
||||||
|
| yes | tokenizer | * | |
|
||||||
|
| yes | xml | * | |
|
||||||
|
| yes | xmlreader | * | |
|
||||||
|
| yes | xmlwriter | * | |
|
||||||
|
| | zip | | |
|
||||||
|
| yes | zlib | * | |
|
||||||
|
|
||||||
|
## Current Issue
|
||||||
|
- [ ] Not support event(libevent), because of its `config.m4` and code.
|
||||||
|
- [ ] Swoole not support `--enable-swoole-curl`.
|
||||||
|
- [ ] Not support readline, maybe caused by ncurses library.
|
||||||
|
- [X] Not support curl (solved)
|
||||||
|
- [X] Customize extensions to compile
|
||||||
|
- [ ] php.ini integration
|
||||||
|
- [X] i18n (including README and scripts)
|
||||||
|
|
||||||
## Running preview
|
## Running preview
|
||||||
After-compile status
|
After-compile status
|
||||||

|
|
||||||
|
|
||||||
Run Swoft framework directly
|

|
||||||

|
|
||||||
|
|
||||||
## Todo List
|
Run Workerman directly
|
||||||
- [X] curl/libcurl extension support
|
|
||||||
- [ ] Alternative extension compiling
|

|
||||||
- [ ] php.ini support
|
|
||||||
- [ ] Make composer together
|
|
||||||
- [ ] i18n
|
|
||||||
|
|
||||||
## References
|
## References
|
||||||
- <https://blog.terrywh.net/post/2019/php-static-openssl/>
|
- <https://blog.terrywh.net/post/2019/php-static-openssl/>
|
||||||
|
|||||||
Reference in New Issue
Block a user