OPcache and PHP 8.4

Stephen <[email protected]> Sat, 5 Jul 2025 09:22:26 +1200
Newsgroups gmane.comp.php.general
Message-ID <CALWTg09BY=WQHmeqZxeMpzcA9y3Z-x6yNhuqQbHdN0kaZ9Rkug@mail.gmail.com>
--000000000000e565aa0639211712
Content-Type: text/plain; charset="UTF-8"

Hi, I've been experiencing numerous issues (502 errors, memory allocation
exhausted, classes not found) with recent PHP 8.4 updates, which are
resolved by disabling OPcache or reverting to PHP 8.3 - it was working
until a couple of weeks ago, where clearing the OPcache seemed to help, but
became unworkable with the 8.4.10 update.

I'm not sure if this is an issue with settings, multiple versions of PHP,
or something specific to PHP 8.4 - any suggestions would be appreciated.

The setup is multiple websites using Nginx 1.29.0 on Linux 5.15.0 (Ubuntu
server), where some sites use PHP 8.3, and others 8.4, and all websites use
php files located on a NFS.

I don't believe it's an issue with settings (or the NFS) as it works fine
when all sites use 8.3 (with the same settings).

I guess my main question is how OPcache handles multiple versions of PHP,
could this be the cause of the issue, and is there anything I can do?

The main recent change I made (other than updates) was to turn off
opcache.validate_timestamps, in favour of refreshing the cache with any
update to PHP files, however enabling that again didn't resolve the issue.

Thank you.

--000000000000e565aa0639211712
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi, I&#39;ve been experiencing numerous issues (502 errors=
, memory allocation exhausted, classes not found) with recent PHP 8.4 updat=
es, which are resolved by disabling OPcache or reverting to PHP 8.3 - it wa=
s working until a couple of weeks ago, where clearing the OPcache seemed to=
 help, but became unworkable with the 8.4.10 update.<div><br></div><div>I&#=
39;m not sure if this is an issue with settings, multiple versions of PHP, =
or something specific to PHP 8.4 - any suggestions would be appreciated.</d=
iv><div><br></div><div>The setup is multiple websites using Nginx 1.29.0 on=
=C2=A0Linux 5.15.0 (Ubuntu server), where some sites use PHP 8.3, and other=
s 8.4, and all websites use php files located on a NFS.</div><div><br></div=
><div>I don&#39;t believe it&#39;s an issue with settings (or the NFS) as i=
t works fine when all sites use 8.3 (with the same settings).<br><br>I gues=
s my main question is how OPcache handles multiple versions of PHP, could t=
his be the cause of the issue, and is there anything I can do?<br><br>The m=
ain recent change I made (other than updates) was to turn off opcache.valid=
ate_timestamps, in favour of refreshing the cache with any update to PHP fi=
les, however enabling that again didn&#39;t resolve the issue.<br><br>Thank=
 you.</div></div>

--000000000000e565aa0639211712--