Skip to content

Commit b7c5696

Browse files
authored
Merge pull request #63 from flownative/task/opcache-ext-loading
Do not try to load opcache extension in PHP 8.5+
2 parents 1c560ed + 9fdf734 commit b7c5696

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

root-files/build.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,13 @@ init)
403403
fi
404404

405405
build_create_directories
406+
407+
# opcache is no longer loaded via zend_extension in PHP 8.5+
408+
php_major="${PHP_VERSION%%.*}"
409+
php_minor="${PHP_VERSION#*.}"; php_minor="${php_minor%%.*}"
410+
if (( php_major >= 9 || (php_major == 8 && php_minor >= 5) )); then
411+
sed -i 's/^zend_extension=opcache\.so/;zend_extension=opcache.so/' "${PHP_BASE_PATH}/etc/php.ini"
412+
fi
406413
;;
407414
prepare)
408415
packages_install $(build_get_runtime_packages) 1>$(debug_device)

root-files/opt/flownative/php/etc/php.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ date.timezone = ${PHP_DATE_TIMEZONE}
160160

161161

162162
[opcache]
163-
; Load the opcache extension
163+
; Load the opcache extension - only needed in PHP up to 8.4
164164
zend_extension=opcache.so
165165

166166
; Determines if Zend OPCache is enabled

0 commit comments

Comments
 (0)