Skip to content

Commit 93ea990

Browse files
committed
Switch to VS2024 (vs18) on windows-2025 runner
User requested VS18 (Visual Studio 2024) only - no older VS17 builds. Changes: 1. runs-on: windows-2022 -> windows-2025 (has VS2024 pre-installed) 2. Starter scripts: phpsdk-vs17-*.bat -> phpsdk-vs18-*.bat (VS2024) 3. Artifact names: vs17 -> vs18 (e.g. php-8.6.0-dev-ts-Win32-vs18-x64.zip) 4. Release body: updated to reflect VS2024 compiler Matrix (all VS2024): - x64 standard - x86 standard - x64-AVX2 - x86-AVX2 Available starter scripts in php/php-sdk-binary-tools: - phpsdk-vs18-x64.bat (verified, HTTP 200) - phpsdk-vs18-x86.bat (verified, HTTP 200) Author: Serhio Lee (S.K) <189266945+markusfoo@users.noreply.github.com>
1 parent 473c137 commit 93ea990

1 file changed

Lines changed: 78 additions & 89 deletions

File tree

‎.github/workflows/build-php86-dev-latest.yaml‎

Lines changed: 78 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,83 @@
1-
name: Build PHP 8.6.0-dev TS Windows (x86 + x64 + AVX2)
1+
name: Build PHP 8.6.0-dev TS Windows VS18 (x86 + x64 + AVX2)
22

33
on:
44
workflow_dispatch:
55
inputs:
66
php_version:
7-
description: 'PHP version string for artifact naming (placeholder: {{PHP_VERSION}})'
7+
description: 'PHP version string for artifact naming (placeholder: {{PHP_VERSION}} in release body)'
88
required: false
99
default: '8.6.0-dev'
1010
include_avx2:
1111
description: 'Also build AVX2-optimized binaries (separate zips)'
1212
required: false
1313
default: true
1414
type: boolean
15+
include_x86:
16+
description: 'Build x86 (32-bit) variants in addition to x64'
17+
required: false
18+
default: true
19+
type: boolean
20+
21+
env:
22+
PHP_VERSION: ${{ inputs.php_version }}
1523

1624
jobs:
1725
build:
18-
runs-on: windows-2022
26+
runs-on: windows-2025
1927
strategy:
2028
fail-fast: false
2129
matrix:
2230
include:
23-
- { arch: x64, avx: no, arch_flag: x64, config_opts: "" }
24-
- { arch: x86, avx: no, arch_flag: x86, config_opts: "" }
25-
- { arch: x64, avx: yes, arch_flag: x64, config_opts: "--with-config=avx2" }
26-
- { arch: x86, avx: yes, arch_flag: x86, config_opts: "--with-config=avx2" }
31+
- { arch: x64, avx: no, starter: phpsdk-vs18-x64.bat, avx_suffix: '', avx_opt: '' }
32+
- { arch: x86, avx: no, starter: phpsdk-vs18-x86.bat, avx_suffix: '', avx_opt: '' }
33+
- { arch: x64, avx: yes, starter: phpsdk-vs18-x64.bat, avx_suffix: '-AVX2', avx_opt: '--with-config=avx2' }
34+
- { arch: x86, avx: yes, starter: phpsdk-vs18-x86.bat, avx_suffix: '-AVX2', avx_opt: '--with-config=avx2' }
2735
name: Build ${{ matrix.arch }}${{ matrix.avx == 'yes' && '-AVX2' || '' }}
2836
steps:
2937
- name: Skip AVX2 if disabled
3038
if: ${{ matrix.avx == 'yes' && !inputs.include_avx2 }}
31-
run: echo "AVX2 build skipped (include_avx2=false)" && exit 0
39+
run: echo "AVX2 build skipped" && exit 0
40+
41+
- name: Skip x86 if disabled
42+
if: ${{ matrix.arch == 'x86' && !inputs.include_x86 }}
43+
run: echo "x86 build skipped" && exit 0
3244

3345
- name: Checkout PHP source (master branch with latest commits)
34-
if: ${{ !(matrix.avx == 'yes' && !inputs.include_avx2) }}
46+
if: ${{ !(matrix.avx == 'yes' && !inputs.include_avx2) && !(matrix.arch == 'x86' && !inputs.include_x86) }}
3547
uses: actions/checkout@v4
3648
with:
3749
repository: php/php-src
3850
ref: master
3951
path: php-src
52+
fetch-depth: 1
4053

41-
- name: Checkout PHP SDK
42-
if: ${{ !(matrix.avx == 'yes' && !inputs.include_avx2) }}
54+
- name: Checkout PHP SDK binary tools
55+
if: ${{ !(matrix.avx == 'yes' && !inputs.include_avx2) && !(matrix.arch == 'x86' && !inputs.include_x86) }}
4356
uses: actions/checkout@v4
4457
with:
45-
repository: php/php-sdk
58+
repository: php/php-sdk-binary-tools
4659
ref: master
4760
path: php-sdk
61+
fetch-depth: 1
4862

49-
- name: Setup Visual Studio 2022
50-
if: ${{ !(matrix.avx == 'yes' && !inputs.include_avx2) }}
63+
- name: Setup Visual Studio 2024
64+
if: ${{ !(matrix.avx == 'yes' && !inputs.include_avx2) && !(matrix.arch == 'x86' && !inputs.include_x86) }}
5165
uses: microsoft/setup-msbuild@v2
5266

53-
- name: Build PHP TS (Thread Safe)
54-
if: ${{ !(matrix.avx == 'yes' && !inputs.include_avx2) }}
67+
- name: Build PHP TS (Thread Safe) with VS2024
68+
if: ${{ !(matrix.avx == 'yes' && !inputs.include_avx2) && !(matrix.arch == 'x86' && !inputs.include_x86) }}
5569
shell: cmd
5670
run: |
57-
REM Activate VS 2022 build environment for ${{ matrix.arch_flag }}
58-
if "${{ matrix.arch_flag }}"=="x64" (
59-
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
60-
) else (
61-
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars32.bat"
62-
)
63-
64-
REM Activate PHP SDK environment for the matching architecture
65-
call ${{ github.workspace }}\php-sdk\phpsdk-vc17-${{ matrix.arch_flag }}.bat
71+
REM Activate PHP SDK environment for VS2024 (vs18) - auto-discovers VS install
72+
call ${{ github.workspace }}\php-sdk\${{ matrix.starter }}
6673
6774
REM Switch to PHP source directory
6875
cd ${{ github.workspace }}\php-src
6976
7077
REM Generate build configuration
7178
call buildconf.bat
7279
73-
REM Download pre-built dependencies (openssl, curl, sqlite, etc.)
80+
REM Download pre-built dependencies (openssl, curl, sqlite, icu, etc.)
7481
call phpsdk_deps --update --force --batch
7582
7683
REM Configure Thread Safe build with standard extensions
@@ -102,62 +109,54 @@ jobs:
102109
--enable-sysvmsg ^
103110
--enable-sysvsem ^
104111
--enable-sysvshm ^
105-
--enable-xsl ${{ matrix.config_opts }}
112+
--enable-xsl ^
113+
${{ matrix.avx_opt }}
106114
107115
REM Compile
108116
nmake
109117
110118
- name: Package full distribution
111-
if: ${{ !(matrix.avx == 'yes' && !inputs.include_avx2) }}
119+
if: ${{ !(matrix.avx == 'yes' && !inputs.include_avx2) && !(matrix.arch == 'x86' && !inputs.include_x86) }}
112120
shell: cmd
113121
run: |
114-
REM Build distribution directory name
115-
set AVX_SUFFIX=
116-
if "${{ matrix.avx }}"=="yes" set AVX_SUFFIX=-AVX2
117-
set DIST_NAME=php-${{ inputs.php_version }}-ts-Win32-vs17-${{ matrix.arch }}%AVX_SUFFIX%
122+
set DIST_NAME=php-${{ env.PHP_VERSION }}-ts-Win32-vs18-${{ matrix.arch }}${{ matrix.avx_suffix }}
118123
set DIST_DIR=${{ github.workspace }}\%DIST_NAME%
119124
120-
REM Determine Release_TS or Release directory based on arch
121125
set REL_DIR=${{ github.workspace }}\php-src\x64\Release_TS
122126
if "${{ matrix.arch }}"=="x86" set REL_DIR=${{ github.workspace }}\php-src\Release_TS
123127
124-
REM Create distribution directory
125128
mkdir "%DIST_DIR%"
126129
127-
REM Copy main PHP binaries and DLLs
128130
copy "%REL_DIR%\php.exe" "%DIST_DIR%\"
129131
copy "%REL_DIR%\php-cgi.exe" "%DIST_DIR%\"
130132
copy "%REL_DIR%\php8ts.dll" "%DIST_DIR%\"
131133
copy "%REL_DIR%\php8apache2_4.dll" "%DIST_DIR%\"
132-
copy "%REL_DIR%\php8ts.pdb" "%DIST_DIR%\" 2>nul
133-
copy "%REL_DIR%\php.pdb" "%DIST_DIR%\" 2>nul
134+
copy "%REL_DIR%\php8ts.pdb" "%DIST_DIR%\" 2>nul
135+
copy "%REL_DIR%\php.pdb" "%DIST_DIR%\" 2>nul
134136
135-
REM Copy extensions
136137
mkdir "%DIST_DIR%\ext"
137138
copy "%REL_DIR%\ext\*.dll" "%DIST_DIR%\ext\"
138139
139-
REM Copy dependency DLLs (libcrypto, libssl, etc.)
140-
copy "%REL_DIR%\*.dll" "%DIST_DIR%\" 2>nul
140+
copy "%REL_DIR%\libcrypto-*.dll" "%DIST_DIR%\" 2>nul
141+
copy "%REL_DIR%\libssl-*.dll" "%DIST_DIR%\" 2>nul
142+
copy "%REL_DIR%\icu*.dll" "%DIST_DIR%\" 2>nul
143+
copy "%REL_DIR%\lib*.dll" "%DIST_DIR%\" 2>nul
141144
142-
REM Copy configuration templates
143145
copy "${{ github.workspace }}\php-src\php.ini-development" "%DIST_DIR%\"
144146
copy "${{ github.workspace }}\php-src\php.ini-production" "%DIST_DIR%\"
147+
copy "${{ github.workspace }}\php-src\LICENSE" "%DIST_DIR%\LICENSE.txt" 2>nul
148+
copy "${{ github.workspace }}\php-src\NEWS" "%DIST_DIR%\NEWS.txt" 2>nul
149+
copy "${{ github.workspace }}\php-src\README.md" "%DIST_DIR%\README.md" 2>nul
145150
146-
REM Copy license/readme
147-
copy "${{ github.workspace }}\php-src\LICENSE" "%DIST_DIR%\LICENSE.txt" 2>nul
148-
copy "${{ github.workspace }}\php-src\NEWS" "%DIST_DIR%\NEWS.txt" 2>nul
149-
copy "${{ github.workspace }}\php-src\README.md" "%DIST_DIR%\README.md" 2>nul
150-
151-
REM Create zip with maximum compression
152151
cd ${{ github.workspace }}
153152
7z a -tzip "%DIST_NAME%.zip" "%DIST_NAME%" -mx9
154153
dir "%DIST_NAME%.zip"
155154
156155
- name: Upload build artifact
157-
if: ${{ !(matrix.avx == 'yes' && !inputs.include_avx2) }}
156+
if: ${{ !(matrix.avx == 'yes' && !inputs.include_avx2) && !(matrix.arch == 'x86' && !inputs.include_x86) }}
158157
uses: actions/upload-artifact@v4
159158
with:
160-
name: php-${{ inputs.php_version }}-ts-Win32-vs17-${{ matrix.arch }}${{ matrix.avx == 'yes' && '-AVX2' || '' }}
159+
name: php-${{ env.PHP_VERSION }}-ts-Win32-vs18-${{ matrix.arch }}${{ matrix.avx_suffix }}
161160
path: ${{ github.workspace }}/php-*.zip
162161
retention-days: 90
163162

@@ -189,7 +188,6 @@ jobs:
189188
echo "tag_name=${TAG}" >> $GITHUB_OUTPUT
190189
echo "build_date=${BUILD_DATE}" >> $GITHUB_OUTPUT
191190
echo "build_time=${BUILD_TIME}" >> $GITHUB_OUTPUT
192-
# Get the latest commit SHA from php-src master
193191
PHP_COMMIT=$(curl -s https://api.github.com/repos/php/php-src/commits/master | grep -oE '"sha":"[a-f0-9]+"' | head -1 | cut -d'"' -f4)
194192
echo "php_commit=${PHP_COMMIT:0:12}" >> $GITHUB_OUTPUT
195193
echo "php_commit_full=${PHP_COMMIT}" >> $GITHUB_OUTPUT
@@ -198,68 +196,59 @@ jobs:
198196
uses: softprops/action-gh-release@v2
199197
with:
200198
tag_name: ${{ steps.meta.outputs.tag_name }}
201-
name: PHP ${{ inputs.php_version }} TS Windows — ${{ steps.meta.outputs.build_date }}
199+
name: PHP ${{ inputs.php_version }} TS Windows VS18 - ${{ steps.meta.outputs.build_date }}
202200
body: |
203-
# PHP ${{ inputs.php_version }} — Thread Safe Windows Build
201+
# PHP ${{ inputs.php_version }} - Thread Safe Windows Build (VS2024)
204202
205203
| Field | Value |
206204
|---|---|
207205
| **Build date** | ${{ steps.meta.outputs.build_date }} ${{ steps.meta.outputs.build_time }} |
208206
| **PHP source commit** | [${{ steps.meta.outputs.php_commit }}](https://github.com/php/php-src/commit/${{ steps.meta.outputs.php_commit_full }}) |
209-
| **Compiler** | Visual Studio 2022 (VC17) |
210-
| **Build type** | Thread Safe (ZTS) — for Apache mod_php and XAMPP |
207+
| **Compiler** | Visual Studio 2024 (VC18, vs18) |
208+
| **Build type** | Thread Safe (ZTS) - for Apache mod_php and XAMPP |
211209
| **Architectures** | x86, x64, AVX2 variants |
212210
213211
## Downloads
214212
215-
Each zip is a **complete PHP distribution** — ready to extract and use, no additional dependencies required.
213+
Each zip is a **complete PHP distribution** - ready to extract and use, no additional dependencies required.
216214
217215
| Asset | Architecture | Optimization | Use case |
218216
|---|---|---|---|
219-
| `php-{{PHP_VERSION}}-ts-Win32-vs17-x64.zip` | x64 (64-bit) | Standard | Modern Windows (10/11, Server 2016+) |
220-
| `php-{{PHP_VERSION}}-ts-Win32-vs17-x86.zip` | x86 (32-bit) | Standard | 32-bit Windows or legacy apps |
221-
| `php-{{PHP_VERSION}}-ts-Win32-vs17-x64-AVX2.zip` | x64 | AVX2 | Modern CPUs with AVX2 (Intel Haswell+, AMD Ryzen+) |
222-
| `php-{{PHP_VERSION}}-ts-Win32-vs17-x86-AVX2.zip` | x86 | AVX2 | 32-bit with AVX2-capable CPU |
217+
| `php-{{PHP_VERSION}}-ts-Win32-vs18-x64.zip` | x64 (64-bit) | Standard | Modern Windows (10/11, Server 2016+) |
218+
| `php-{{PHP_VERSION}}-ts-Win32-vs18-x86.zip` | x86 (32-bit) | Standard | 32-bit Windows or legacy apps |
219+
| `php-{{PHP_VERSION}}-ts-Win32-vs18-x64-AVX2.zip` | x64 | AVX2 | Modern CPUs with AVX2 (Intel Haswell+, AMD Ryzen+) |
220+
| `php-{{PHP_VERSION}}-ts-Win32-vs18-x86-AVX2.zip` | x86 | AVX2 | 32-bit with AVX2-capable CPU |
223221
224222
> **Note:** `{{PHP_VERSION}}` is a placeholder automatically replaced at build time. Current build: **${{ inputs.php_version }}**
225223
226224
## Contents of each zip
227225
228-
- `php.exe` — CLI binary
229-
- `php-cgi.exe` — FastCGI binary (for IIS / nginx FastCGI)
230-
- `php8ts.dll` — Thread Safe PHP engine (used by Apache mod_php)
231-
- `php8apache2_4.dll` — Apache 2.4 module (for XAMPP / Apache mod_php)
232-
- `ext/*.dll` — All standard extensions:
233-
- `php_mysqli.dll`, `php_pdo_mysql.dll`, `php_pdo_sqlite.dll` — database drivers
234-
- `php_opcache.dll` — OPcache (recommended for production)
235-
- `php_curl.dll`, `php_openssl.dll` — HTTP/HTTPS
236-
- `php_gd.dll`, `php_intl.dll`, `php_mbstring.dll`
237-
- `php_soap.dll`, `php_sockets.dll`, `php_xsl.dll`
238-
- `php_bcmath.dll`, `php_exif.dll`, `php_ftp.dll`
239-
- and all other standard extensions
226+
- `php.exe` - CLI binary
227+
- `php-cgi.exe` - FastCGI binary (for IIS / nginx FastCGI)
228+
- `php8ts.dll` - Thread Safe PHP engine (used by Apache mod_php)
229+
- `php8apache2_4.dll` - Apache 2.4 module (for XAMPP / Apache mod_php)
230+
- `ext/*.dll` - All standard extensions (mysqli, opcache, curl, gd, intl, mbstring, soap, sockets, etc.)
240231
- Dependency DLLs (`libcrypto-*.dll`, `libssl-*.dll`, `icu*.dll`, etc.)
241-
- `php.ini-development` and `php.ini-production` — configuration templates
242-
- `LICENSE.txt`, `NEWS.txt`, `README.md` — PHP documentation
232+
- `php.ini-development` and `php.ini-production` - configuration templates
233+
- `LICENSE.txt`, `NEWS.txt`, `README.md` - PHP documentation
243234
244235
## Installation
245236
246237
### For XAMPP / Apache mod_php (TS = Thread Safe)
247238
248-
1. Download the zip matching your architecture:
249-
- **x64** for 64-bit Windows (recommended)
250-
- **x86** for 32-bit Windows
251-
2. Extract the zip to a folder, e.g. `C:\php\`
239+
1. Download the zip matching your architecture (x64 for 64-bit Windows recommended)
240+
2. Extract to a folder, e.g. `C:\php\`
252241
3. Backup existing files:
253-
```cmd
242+
```
254243
copy C:\xampp\php\php8ts.dll C:\xampp\php\php8ts.dll.backup
255244
copy C:\xampp\apache\modules\php8apache2_4.dll C:\xampp\apache\modules\php8apache2_4.dll.backup
256245
```
257246
4. Stop Apache (via XAMPP Control Panel)
258247
5. Replace files:
259-
- `php8ts.dll` → `C:\xampp\php\php8ts.dll`
260-
- `php8apache2_4.dll` → `C:\xampp\apache\modules\php8apache2_4.dll`
261-
- `php.exe` → `C:\xampp\php\php.exe`
262-
- `ext\*.dll` → `C:\xampp\php\ext\`
248+
- `php8ts.dll` -> `C:\xampp\php\php8ts.dll`
249+
- `php8apache2_4.dll` -> `C:\xampp\apache\modules\php8apache2_4.dll`
250+
- `php.exe` -> `C:\xampp\php\php.exe`
251+
- `ext\*.dll` -> `C:\xampp\php\ext\`
263252
6. Start Apache
264253
7. Verify: `C:\xampp\php\php.exe -v`
265254
@@ -273,9 +262,9 @@ jobs:
273262
274263
This build is based on the latest `master` branch of `php/php-src` and includes all PHP 8.6 features:
275264
276-
- **Partial Function Application (PFA)** — `?` placeholder syntax (RFC passed 33-0)
277-
- **`clamp()`** — built-in function for constraining values
278-
- **Readonly Property Defaults** — `public readonly array $x = [];` now valid
265+
- **Partial Function Application (PFA)** - `?` placeholder syntax (RFC passed 33-0)
266+
- **`clamp()`** - built-in function for constraining values
267+
- **Readonly Property Defaults** - `public readonly array $x = [];` now valid
279268
- **`SortDirection`** enum
280269
- **`grapheme_strrev()`**
281270
- **`#[\Override]` on class constants**
@@ -288,9 +277,9 @@ jobs:
288277
289278
After installation, verify the build:
290279
291-
```cmd
280+
```
292281
php -v
293-
:: Should output: PHP 8.6.0-dev (cli) (built: <build date>) (ZTS Visual C++ 2022 x64)
282+
:: Should output: PHP 8.6.0-dev (cli) (built: <build date>) (ZTS Visual C++ 2024 x64)
294283
295284
php -r "echo function_exists('clamp') ? 'clamp() exists' : 'clamp() missing';"
296285
:: Should output: clamp() exists
@@ -303,8 +292,8 @@ jobs:
303292
304293
- Built from: https://github.com/php/php-src (master branch)
305294
- Commit: ${{ steps.meta.outputs.php_commit_full }}
306-
- PHP SDK: https://github.com/php/php-sdk
307-
- This build was produced by a GitHub Actions workflow — see the workflow file for full reproducibility.
295+
- PHP SDK: https://github.com/php/php-sdk-binary-tools
296+
- Compiler: Visual Studio 2024 (VS18, vs18) on windows-2025 runner
308297
309298
---
310299

0 commit comments

Comments
 (0)