Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PHP 8.4 support (testing) #556

Merged
merged 25 commits into from
Nov 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
220c4da
Add PHP 8.4 support (testing)
crazywhalecc Oct 25, 2024
6ed25ed
Add 8.4 support for switch-php-version command
crazywhalecc Nov 2, 2024
0e131f2
8.4 download imap separately, compatible with 8.1-8.3
crazywhalecc Nov 2, 2024
307e984
Fix imap library build in macOS Sequoia
crazywhalecc Nov 2, 2024
6670b56
Fix display PHP version when using archive
crazywhalecc Nov 2, 2024
dc57e5e
Remove 8.1-8.3 tests
crazywhalecc Nov 2, 2024
e196442
Change default download php version to 8.3
crazywhalecc Nov 3, 2024
3f871fd
Change swoole source to git master instead of pecl (6.0 has not been …
crazywhalecc Nov 3, 2024
4a22d2a
Fix sodium build, remove build patches
crazywhalecc Nov 3, 2024
aa457df
Update README
crazywhalecc Nov 3, 2024
6de6605
Remove --with-zlib-dir that has been removed in 8.4
crazywhalecc Nov 3, 2024
13523bc
Fix imagick build for PHP 8.4
crazywhalecc Nov 3, 2024
664a812
Add 8.1-8.3 test
crazywhalecc Nov 3, 2024
e9466dc
Use similar optimize flags for compiling PHP (bump major ver)
crazywhalecc Nov 5, 2024
23daeeb
Add extension matrix tests
crazywhalecc Nov 5, 2024
dc3f3df
Do not cache PHP
crazywhalecc Nov 5, 2024
8da3f35
Fix gettext sanity check
crazywhalecc Nov 6, 2024
237fc53
Fix FileSystem remove soft link directory
crazywhalecc Nov 6, 2024
7c59e4d
Update to RC4
crazywhalecc Nov 9, 2024
eaa9969
Remove RC version for PHP 8.4
crazywhalecc Nov 22, 2024
42abb5a
Sort config
crazywhalecc Nov 22, 2024
6598dde
Update docs
crazywhalecc Nov 22, 2024
5e4b266
Update workflows, add php 8.4
crazywhalecc Nov 22, 2024
4b28007
Remove PHP 8.1 libxml2 patch
crazywhalecc Nov 23, 2024
bdadc47
Update docs
crazywhalecc Nov 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/build-linux-arm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ on:
version:
required: true
description: php version to compile
default: '8.2'
default: '8.3'
type: choice
options:
- '8.4'
- '8.3'
- '8.2'
- '8.1'
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/build-linux-x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ on:
version:
required: true
description: php version to compile
default: '8.2'
default: '8.3'
type: choice
options:
- '8.4'
- '8.3'
- '8.2'
- '8.1'
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/build-macos-aarch64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ on:
version:
required: true
description: php version to compile
default: '8.2'
default: '8.3'
type: choice
options:
- '8.4'
- '8.3'
- '8.2'
- '8.1'
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/build-macos-x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ on:
version:
required: true
description: php version to compile
default: '8.2'
default: '8.3'
type: choice
options:
- '8.4'
- '8.3'
- '8.2'
- '8.1'
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build-windows-x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
default: '8.2'
type: choice
options:
- '8.4'
- '8.3'
- '8.2'
- '8.1'
Expand Down
148 changes: 148 additions & 0 deletions .github/workflows/ext-matrix-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
name: "Extension matrix tests"

on:
workflow_dispatch:
pull_request:
branches: [ "main" ]
paths:
- '.github/workflows/ext-matrix-tests.yml'

jobs:
test:
name: "${{ matrix.extension }} (PHP ${{ matrix.php-version }} on ${{ matrix.operating-system }})"
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
extension:
- amqp
- apcu
- bcmath
- bz2
- calendar
- ctype
- curl
- dba
- dom
- ds
- event
- exif
- filter
- fileinfo
- ftp
- gd
- gettext
- gmp
- iconv
- igbinary
- imagick
- imap
- intl
- ldap
- mbstring,mbregex
- memcache
- mysqli,mysqlnd,pdo_mysql
- opcache
- openssl
- pcntl
- password-argon2
- pcntl
- pdo
- pgsql,pdo_pgsql
- phar
- posix
- rar
- protobuf
- readline
- redis
- session
- shmop
- simdjson
- simplexml,xml
- snappy
- soap
- sockets
- sodium
- sqlite3,pdo_sqlite
- sqlsrv
- ssh2
- swoole
- swoole,swoole-hook-pgsql,swoole-hook-mysql,swoole-hook-sqlite
- swow
- sysvmsg,sysvsem,sysvshm
- tidy
- tokenizer
- uuid
- uv
- xhprof
- xlswriter
- xmlwriter,xmlreader
- xsl
- yac
- yaml
- zip
- zlib
- zstd
php-version:
- "8.4"
operating-system:
- "ubuntu-latest"
#- "macos-13"
#- "debian-arm64-self-hosted"
- "macos-14"

steps:
- name: "Checkout"
uses: "actions/checkout@v4"

- name: OS type
id: os-type
run: |
OS=""
if [ "${{ matrix.operating-system }}" = "ubuntu-latest" ]; then
OS="linux-x86_64"
elif [ "${{ matrix.operating-system }}" = "macos-13" ]; then
OS="macos-x86_64"
elif [ "${{ matrix.operating-system }}" = "debian-arm64-self-hosted" ]; then
OS="linux-aarch64"
elif [ "${{ matrix.operating-system }}" = "macos-14" ]; then
OS="macos-aarch64"
fi
echo "OS=$OS" >> $GITHUB_ENV

- name: "Setup PHP"
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
tools: pecl, composer
extensions: curl, openssl, mbstring
ini-values: memory_limit=-1
env:
phpts: nts

- name: "Install Dependencies"
run: composer update -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist

- id: cache-download
uses: actions/cache@v4
with:
path: downloads
key: php-${{ matrix.php-version }}-dependencies-for-tests

# If there's no dependencies cache, fetch sources
- name: "Download sources"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./bin/spc download --with-php=${{ matrix.php-version }} --for-extensions=${{ matrix.extension }} --debug --ignore-cache-sources=php-src

- name: "Build library: ${{ matrix.library }}"
run: |
SPC_USE_SUDO=yes ./bin/spc doctor --auto-fix
if [ "${{ env.OS }}" = "linux-x86_64" ]; then
./bin/spc install-pkg upx
UPX=--with-upx-pack
elif [ "${{ env.OS }}" = "linux-aarch64" ]; then
./bin/spc install-pkg upx
UPX=--with-upx-pack
fi
./bin/spc build --build-cli --build-micro --build-fpm ${{ matrix.extension }} --debug $UPX --with-suggested-libs --with-suggested-exts
1 change: 1 addition & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ jobs:
- php: '8.1'
- php: '8.2'
- php: '8.3'
- php: '8.4'

steps:
- name: "Checkout"
Expand Down
22 changes: 12 additions & 10 deletions README-zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,18 @@ static-php-cli(简称 `spc`)有许多特性:
>
> :x: 不支持

| PHP Version | Status | Comment |
|-------------|--------------------|------------------------------|
| 7.2 | :x: | |
| 7.3 | :warning: | phpmicro 和许多扩展不支持 7.3、7.4 版本 |
| 7.4 | :warning: | phpmicro 和许多扩展不支持 7.3、7.4 版本 |
| 8.0 | :heavy_check_mark: | PHP 官方已停止 8.0 的维护 |
| 8.1 | :heavy_check_mark: | PHP 官方仅对 8.1 提供安全更新 |
| 8.2 | :heavy_check_mark: | |
| 8.3 | :heavy_check_mark: | |
| 8.4 | :x: | WIP |
| PHP Version | Status | Comment |
|-------------|--------------------|----------------------------------------------|
| 7.2 | :x: | |
| 7.3 | :x: | phpmicro 和许多扩展不支持 7.3、7.4 版本 |
| 7.4 | :x: | phpmicro 和许多扩展不支持 7.3、7.4 版本 |
| 8.0 | :warning: | PHP 官方已停止 8.0 的维护,我们不再处理 8.0 相关的 backport 支持 |
| 8.1 | :heavy_check_mark: | PHP 官方仅对 8.1 提供安全更新 |
| 8.2 | :heavy_check_mark: | |
| 8.3 | :heavy_check_mark: | |
| 8.4 | :heavy_check_mark: | |

> 这个表格的支持状态是 static-php-cli 对构建对应版本的支持情况,不是 PHP 官方对该版本的支持情况。

### 支持的扩展

Expand Down
23 changes: 13 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,19 @@ Currently supported PHP versions for compilation:
>
> :x: not supported

| PHP Version | Status | Comment |
|-------------|--------------------|---------------------------------------------------|
| 7.2 | :x: | |
| 7.3 | :warning: | phpmicro and some extensions not supported on 7.x |
| 7.4 | :warning: | phpmicro and some extensions not supported on 7.x |
| 8.0 | :heavy_check_mark: | PHP official has stopped maintenance of 8.0 |
| 8.1 | :heavy_check_mark: | PHP official has security fixes only |
| 8.2 | :heavy_check_mark: | |
| 8.3 | :heavy_check_mark: | |
| 8.4 | :x: | WIP |
| PHP Version | Status | Comment |
|-------------|--------------------|----------------------------------------------------------------------------------------------------|
| 7.2 | :x: | |
| 7.3 | :x: | phpmicro and some extensions not supported on 7.x |
| 7.4 | :x: | phpmicro and some extensions not supported on 7.x |
| 8.0 | :warning: | PHP official has stopped maintenance of 8.0, we no longer provide backport support for version 8.0 |
| 8.1 | :heavy_check_mark: | PHP official has security fixes only |
| 8.2 | :heavy_check_mark: | |
| 8.3 | :heavy_check_mark: | |
| 8.4 | :heavy_check_mark: | |

> This table shows the support status for static-php-cli in building the corresponding version,
> not the official PHP support status for that version.

### Supported Extensions

Expand Down
2 changes: 1 addition & 1 deletion config/env.ini
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS="${SPC_PHP_DEFAULT_OPTIMIZE_CFLAGS} -fno-ident
; EXTRA_LIBS for `make` php
SPC_CMD_VAR_PHP_MAKE_EXTRA_LIBS=""
; EXTRA_LDFLAGS_PROGRAM for `make` php
SPC_CMD_VAR_PHP_MAKE_EXTRA_LDFLAGS_PROGRAM="-all-static"
SPC_CMD_VAR_PHP_MAKE_EXTRA_LDFLAGS_PROGRAM="-all-static -Wl,-O1 -pie"

[macos]
; compiler environments
Expand Down
3 changes: 2 additions & 1 deletion config/ext.json
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,8 @@
"BSD": "wip"
},
"notes": true,
"type": "builtin",
"type": "external",
"source": "ext-imap",
"arg-type": "custom",
"lib-depends": [
"imap"
Expand Down
25 changes: 21 additions & 4 deletions config/source.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,18 @@
"path": "LICENSE"
}
},
"ext-imap": {
"type": "url",
"url": "https://pecl.php.net/get/imap",
"path": "php-src/ext/imap",
"filename": "imap.tgz",
"license": {
"type": "file",
"path": [
"LICENSE"
]
}
},
"ext-memcache": {
"type": "url",
"url": "https://pecl.php.net/get/memcache",
Expand Down Expand Up @@ -513,7 +525,7 @@
"micro": {
"type": "git",
"path": "php-src/sapi/micro",
"rev": "master",
"rev": "84beta",
"url": "https://github.com/static-php/phpmicro",
"license": {
"type": "file",
Expand Down Expand Up @@ -726,13 +738,18 @@
}
},
"swoole": {
"type": "ghtar",
"path": "php-src/ext/swoole",
"repo": "swoole/swoole-src",
"prefer-stable": true,
"type": "git",
"rev": "master",
"url": "https://github.com/swoole/swoole-src.git",
"license": {
"type": "file",
"path": "LICENSE"
},
"alt": {
"type": "ghtar",
"repo": "swoole/swoole-src",
"prefer-stable": true
}
},
"swow": {
Expand Down
8 changes: 8 additions & 0 deletions docs/en/faq/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,11 @@ For Linux systems, you can download the [cacert.pem](https://curl.se/docs/caextr
For the certificate locations of different distros, please refer to [Golang docs](https://go.dev/src/crypto/x509/root_linux.go).

> INI configuration `openssl.cafile` cannot be set dynamically using the `ini_set()` function, because `openssl.cafile` is a `PHP_INI_SYSTEM` type configuration and can only be set in the `php.ini` file.

## Why don't we support older versions of PHP?

Because older versions of PHP have many problems, such as security issues, performance issues, and functional issues.
In addition, many older versions of PHP are not compatible with the latest dependency libraries,
which is one of the reasons why older versions of PHP are not supported.

You can use older versions compiled earlier by static-php-cli, such as PHP 8.0, but earlier versions will not be explicitly supported.
2 changes: 1 addition & 1 deletion docs/en/guide/extension-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ This extension contains an implementation of the coroutine environment for `pdo_

## swow

1. Only PHP version >= 8.0 is supported.
1. Only PHP 8.0 ~ 8.4 is supported.

## imap

Expand Down
2 changes: 1 addition & 1 deletion docs/en/guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Windows currently only supports the x86_64 architecture, and does not support 32

## Supported PHP Version

Currently, static php cli supports PHP versions 8.0 to 8.3, and theoretically supports PHP 7.4 and earlier versions.
Currently, static php cli supports PHP versions 8.1 to 8.4, and theoretically supports PHP 8.0 and earlier versions.
Simply select the earlier version when downloading.
However, due to some extensions and special components that have stopped supporting earlier versions of PHP,
static-php-cli will not explicitly support earlier versions.
Expand Down
12 changes: 6 additions & 6 deletions docs/en/guide/manual-build.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,9 @@ including php-src and the source code of various dependent libraries.
# Download all dependencies
bin/spc download --all

# Download all dependent packages, and specify the main version of PHP to download, optional: 7.3, 7.4, 8.0, 8.1, 8.2, 8.3
# Download all dependent packages, and specify the main version of PHP to download, optional: 8.1, 8.2, 8.3, 8.4
# Also supports specific version of php release: 8.3.10, 8.2.22, etc.
bin/spc download --all --with-php=8.2
bin/spc download --all --with-php=8.3

# Show download progress bar while downloading (curl)
bin/spc download --all --debug
Expand Down Expand Up @@ -272,12 +272,12 @@ If you want to build multiple versions of PHP and don't want to build other depe
you can use `switch-php-version` to quickly switch to another version and compile after compiling one version:

```shell
# switch to 8.3
bin/spc switch-php-version 8.3
# switch to 8.4
bin/spc switch-php-version 8.4
# build
bin/spc build bcmath,curl,openssl,ftp,posix,pcntl --build-cli
# switch to 8.0
bin/spc switch-php-version 8.0
# switch to 8.1
bin/spc switch-php-version 8.1
# build
bin/spc build bcmath,curl,openssl,ftp,posix,pcntl --build-cli
```
Expand Down
Loading
Loading