Skip to content

Commit 184077d

Browse files
committed
Fix OPcache loading on 8.5
1 parent 994a257 commit 184077d

File tree

3 files changed

+33
-8
lines changed

3 files changed

+33
-8
lines changed

.github/workflows/main-php-matrix-windows.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ on:
77
description: 'PHP version'
88
type: string
99
required: true
10+
opcache-shared:
11+
description: 'Whether OPcache needs a zend_extension option (not needed in 8.5+)'
12+
type: boolean
13+
default: false
1014
vs-arch:
1115
description: 'CPU arch to build for (x86 or x64)'
1216
type: string
@@ -204,7 +208,11 @@ jobs:
204208
$opcache = "${{ matrix.opcache }}"
205209
if ($opcache -ne "off") {
206210
echo "Enabling OPcache"
207-
echo "zend_extension=php_opcache.dll" >> php.ini
211+
$opcache_shared = "${{ inputs.opcache-shared }}"
212+
if ($opcache_shared -eq "true") {
213+
echo "OPcache is a shared extension in this version"
214+
echo "zend_extension=php_opcache.dll" >> php.ini
215+
}
208216
echo "opcache.enable=1" >> php.ini
209217
echo "opcache.enable_cli=1" >> php.ini
210218
echo "opcache.protect_memory=1" >> php.ini

.github/workflows/main-php-matrix.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ on:
77
description: 'PHP version'
88
required: true
99
type: string
10+
opcache-shared:
11+
description: 'Whether opcache needs a zend_extension option (not needed in 8.5+)'
12+
type: boolean
13+
default: false
1014
runs-on:
1115
description: 'GitHub runner'
1216
default: 'ubuntu-22.04'
@@ -122,7 +126,10 @@ jobs:
122126
echo "extension=pmmpthread.so" > $GITHUB_WORKSPACE/php.ini
123127
if [[ "${{ matrix.opcache }}" != "off" ]]; then
124128
echo "Enabling OPcache"
125-
echo "zend_extension=opcache.so" >> $GITHUB_WORKSPACE/php.ini
129+
if [[ "${{ inputs.opcache-shared }}" == "true" ]]; then
130+
echo "OPcache is a shared extension in this version"
131+
echo "zend_extension=opcache.so" >> $GITHUB_WORKSPACE/php.ini
132+
fi
126133
echo "opcache.enable=1" >> $GITHUB_WORKSPACE/php.ini
127134
echo "opcache.enable_cli=1" >> $GITHUB_WORKSPACE/php.ini
128135
echo "opcache.protect_memory=1" >> $GITHUB_WORKSPACE/php.ini

.github/workflows/main.yml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,17 @@ jobs:
1111
strategy:
1212
fail-fast: false
1313
matrix:
14-
php:
15-
- 8.1.33
16-
- 8.2.29
17-
- 8.3.25
18-
- 8.4.12
19-
- 8.5.0beta3
14+
include:
15+
- php: 8.1.33
16+
opcache-shared: true
17+
- php: 8.2.29
18+
opcache-shared: true
19+
- php: 8.3.25
20+
opcache-shared: true
21+
- php: 8.4.12
22+
opcache-shared: true
23+
- php: 8.5.0beta3
24+
opcache-shared: false
2025

2126
uses: ./.github/workflows/main-php-matrix.yml
2227
with:
@@ -31,14 +36,19 @@ jobs:
3136
include:
3237
- php: 8.1.33
3338
vs-crt: vs16
39+
opcache-shared: true
3440
- php: 8.2.29
3541
vs-crt: vs16
42+
opcache-shared: true
3643
- php: 8.3.25
3744
vs-crt: vs16
45+
opcache-shared: true
3846
- php: 8.4.12
3947
vs-crt: vs17
48+
opcache-shared: true
4049
- php: 8.5.0beta3
4150
vs-crt: vs17
51+
opcache-shared: false
4252

4353
uses: ./.github/workflows/main-php-matrix-windows.yml
4454
with:

0 commit comments

Comments
 (0)