Repository navigation
Closed
Labels
Description
PROBLEMS
I am not sure if this is a problem with ncp, php/raspbian or not a problem at all. Simply running php -v gives an error:
$ php -v
Cannot load Zend OPcache - it was already loaded
PHP 7.0.27-0+deb9u1 (cli) (built: Jan 5 2018 13:51:52) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.0.27-0+deb9u1, Copyright (c) 1999-2017, by Zend Technologies
Looking into some other log files as well, the error gets thrown at sys log every 30 min:
root@nextcloudpi:/var/log# cat syslog | grep OPcache
Feb 15 06:39:09 nextcloudpi sessionclean[10872]: Cannot load Zend OPcache - it was already loaded
Feb 15 06:39:09 nextcloudpi sessionclean[10872]: Cannot load Zend OPcache - it was already loaded
Feb 15 07:09:09 nextcloudpi sessionclean[11044]: Cannot load Zend OPcache - it was already loaded
Feb 15 07:09:09 nextcloudpi sessionclean[11044]: Cannot load Zend OPcache - it was already loaded
Feb 15 07:39:09 nextcloudpi sessionclean[11204]: Cannot load Zend OPcache - it was already loaded
Feb 15 07:39:10 nextcloudpi sessionclean[11204]: Cannot load Zend OPcache - it was already loaded
Feb 15 08:09:09 nextcloudpi sessionclean[11315]: Cannot load Zend OPcache - it was already loaded
...
Paste the output of sudo ncp-report:
NextCloudPi diagnostics
Cannot load Zend OPcache - it was already loaded
NextCloudPi version v0.46.10
NextCloudPi image NextCloudPi_12-04-17
distribution Raspbian GNU/Linux 9 \n \l
automount yes
USB devices sda
datadir /media/USBdrive/ncdata
data in SD no
data filesystem ext2/ext3
data disk usage 182G/917G
rootfs usage 1.7G/3.6G
swapfile /media/wd1/swap
Nextcloud check ok
Nextcloud version 12.0.4.3
HTTPD service up
PHP service up
MariaDB service up
Redis service up
Postfix service up
internet check ok
port check 80 open
port check 443 open
IP 192.168.1.20
gateway 192.168.1.1
interface eth0
certificates $HOSTNAME
certs due 25 days
NAT loopback no
uptime 2days
Nextcloud configuration
Cannot load Zend OPcache - it was already loaded
{
"system": {
"passwordsalt": "***REMOVED SENSITIVE VALUE***",
"secret": "***REMOVED SENSITIVE VALUE***",
"trusted_domains": {
"0": "$HOSTNAME:443",
"1": "192.168.1.20",
"4": "$HOSTNAME",
"2": "$HOSTNAME"
},
"datadirectory": "\/media\/USBdrive\/ncdata",
"overwrite.cli.url": "https:\/\/$HOSTNAME",
"dbtype": "mysql",
"version": "12.0.4.3",
"dbname": "nextcloud",
"dbhost": "localhost",
"dbport": "",
"dbtableprefix": "oc_",
"mysql.utf8mb4": true,
"dbuser": "***REMOVED SENSITIVE VALUE***",
"dbpassword": "***REMOVED SENSITIVE VALUE***",
"installed": true,
"instanceid": "ocs86rkb5syt",
"memcache.local": "\\OC\\Memcache\\Redis",
"memcache.locking": "\\OC\\Memcache\\Redis",
"redis": {
"host": "\/var\/run\/redis\/redis.sock",
"port": 0,
"timeout": 0,
"password": "***REMOVED SENSITIVE VALUE***"
},
"mail_smtpmode": "php",
"mail_smtpauthtype": "LOGIN",
"mail_from_address": "admin",
"mail_domain": "$HOSTNAME",
"overwriteprotocol": "https",
"maintenance": false,
"loglevel": "2",
"logfile": "\/media\/wd1\/ncdata\/nextcloud.log",
"log_type": "file"
}
}
HTTPd logs
[Thu Feb 15 06:25:05.002191 2018] [mpm_event:notice] [pid 859:tid 1992183808] AH00489: Apache/2.4.25 (Raspbian) OpenSSL/1.0.2l configured -- resuming normal operations
[Thu Feb 15 06:25:05.002289 2018] [core:notice] [pid 859:tid 1992183808] AH00094: Command line: '/usr/sbin/apache2'
Database logs
tail: cannot open '/var/log/mysql/*.log' for reading: No such file or directory
Nextcloud logs
{"reqId":"WoCkVX8AAQEAAAG4u6UAAA4B","level":2,"time":"2018-02-11T20:15:18+00:00","remoteAddr":"137.226.113.20","user":"--","app":"core","method":"GET","url":"\/","message":"Trusted domain error. \"137.226.113.20\" tried to access using \"79.75.141.71\" as host.","userAgent":"Mozilla\/5.0 (X11; Ubuntu; Linux x86_64; rv:50.0) Gecko\/20100101 Firefox\/50.0","version":"12.0.4.3"}
{"reqId":"WoCkVn8AAQEAAAG4u60AAA4J","level":2,"time":"2018-02-11T20:15:19+00:00","remoteAddr":"137.226.113.20","user":"--","app":"core","method":"GET","url":"\/index.php\/js\/core\/merged-template-prepend.js?v=2793255a2c31f4b4c2eab906af15ce25-1","message":"Trusted domain error. \"137.226.113.20\" tried to access using \"79.75.141.71\" as host.","userAgent":"Mozilla\/5.0 (X11; Ubuntu; Linux x86_64; rv:50.0) Gecko\/20100101 Firefox\/50.0","version":"12.0.4.3"}
{"reqId":"WoDQD38AAQEAAAHFrL4AAABS","level":2,"time":"2018-02-11T23:21:51+00:00","remoteAddr":"107.170.227.152","user":"--","app":"core","method":"GET","url":"\/","message":"Trusted domain error. \"107.170.227.152\" tried to access using \"79.75.141.71\" as host.","userAgent":"Mozilla\/5.0 zgrab\/0.x","version":"12.0.4.3"}
{"reqId":"WoF0O38AAQEAAB-8900AAAAA","level":3,"time":"2018-02-12T11:02:19+00:00","remoteAddr":"210.16.189.29","user":"--","app":"PHP","method":"GET","url":"\/admin\/config.php","message":"Exception: The requested uri(\/admin\/config.php) cannot be processed by the script '\/core\/templates\/404.php') at \/var\/www\/nextcloud\/lib\/private\/AppFramework\/Http\/Request.php#729","userAgent":"curl\/7.19.7 (i386-redhat-linux-gnu) libcurl\/7.19.7 NSS\/3.27.1 zlib\/1.2.3 libidn\/1.18 libssh2\/1.4.2","version":"12.0.4.3"}
{"reqId":"WoHJ6H8AAQEAAB-893IAAAAO","level":2,"time":"2018-02-12T17:07:53+00:00","remoteAddr":"164.52.6.150","user":"--","app":"core","method":"GET","url":"\/","message":"Trusted domain error. \"164.52.6.150\" tried to access using \"79.75.151.21:443\" as host.","userAgent":"Mozilla\/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko\/20100101 Firefox\/52.0","version":"12.0.4.3"}
{"reqId":"WoHjsn8AAQEAAB-8948AAAAS","level":2,"time":"2018-02-12T18:57:55+00:00","remoteAddr":"209.126.136.7","user":"--","app":"core","method":"GET","url":"\/","message":"Trusted domain error. \"209.126.136.7\" tried to access using \"79.75.151.21\" as host.","userAgent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/57.0.2987.133 Safari\/537.36","version":"12.0.4.3"}
{"reqId":"WoH69X8AAQEAACAK1dIAAABE","level":2,"time":"2018-02-12T20:37:09+00:00","remoteAddr":"139.162.78.135","user":"--","app":"core","method":"GET","url":"\/","message":"Trusted domain error. \"139.162.78.135\" tried to access using \"79.75.151.21\" as host.","userAgent":"Mozilla\/5.0 (Windows NT 10.0; WOW64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/45.0.2454.101 Safari\/537.36","version":"12.0.4.3"}
{"reqId":"WoJC9H8AAQEAACAK9L8AAABL","level":2,"time":"2018-02-13T01:44:20+00:00","remoteAddr":"34.214.38.179","user":"--","app":"core","method":"GET","url":"\/","message":"Trusted domain error. \"34.214.38.179\" tried to access using \"92.4.153.185:443\" as host.","userAgent":"Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/50.0.2661.102 Safari\/537.36","version":"12.0.4.3"}
{"reqId":"WoLhKn8AAQEAAD5A4SIAAABL","level":2,"time":"2018-02-13T12:59:22+00:00","remoteAddr":"139.162.78.135","user":"--","app":"core","method":"GET","url":"\/","message":"Trusted domain error. \"139.162.78.135\" tried to access using \"92.4.153.185\" as host.","userAgent":"Mozilla\/5.0 (Windows NT 10.0; WOW64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/45.0.2454.101 Safari\/537.36","version":"12.0.4.3"}
{"reqId":"WoLrIn8AAQEAAD4wuFkAAAAH","level":2,"time":"2018-02-13T13:41:54+00:00","remoteAddr":"184.105.139.69","user":"--","app":"core","method":"GET","url":"\/","message":"Trusted domain error. \"184.105.139.69\" tried to access using \"92.4.153.185\" as host.","userAgent":"--","version":"12.0.4.3"}
{"reqId":"WoMy238AAQEAAD4wxZkAAAAS","level":2,"time":"2018-02-13T18:47:55+00:00","remoteAddr":"107.170.227.37","user":"--","app":"core","method":"GET","url":"\/","message":"Trusted domain error. \"107.170.227.37\" tried to access using \"79.75.128.116\" as host.","userAgent":"Mozilla\/5.0 zgrab\/0.x","version":"12.0.4.3"}
{"reqId":"WoOZQX8AAQEAAANxI7kAAAAT","level":2,"time":"2018-02-14T02:04:49+00:00","remoteAddr":"89.248.160.199","user":"--","app":"core","method":"GET","url":"\/","message":"Trusted domain error. \"89.248.160.199\" tried to access using \"79.75.128.116\" as host.","userAgent":"libwww-perl\/6.31","version":"12.0.4.3"}
{"reqId":"WoQxAn8AAQEAAA2rWeEAAABQ","level":2,"time":"2018-02-14T12:52:19+00:00","remoteAddr":"184.105.139.69","user":"--","app":"core","method":"GET","url":"\/","message":"Trusted domain error. \"184.105.139.69\" tried to access using \"79.75.128.116\" as host.","userAgent":"--","version":"12.0.4.3"}
{"reqId":"WoR7bH8AAQEAAA2rWg8AAABV","level":2,"time":"2018-02-14T18:09:48+00:00","remoteAddr":"60.191.38.77","user":"--","app":"core","method":"GET","url":"\/","message":"Trusted domain error. \"60.191.38.77\" tried to access using \"79.75.128.116:443\" as host.","userAgent":"Mozilla\/5.0 (Macintosh; Intel Mac OS X 10.11; rv:47.0) Gecko\/20100101 Firefox\/47.0","version":"12.0.4.3"}
{"reqId":"WoSXW38AAQEAAA2rWicAAABE","level":3,"time":"2018-02-14T20:08:59+00:00","remoteAddr":"163.172.192.121","user":"--","app":"PHP","method":"GET","url":"\/a2billing\/common\/javascript\/misc.js","message":"Exception: The requested uri(\/a2billing\/common\/javascript\/misc.js) cannot be processed by the script '\/core\/templates\/404.php') at \/var\/www\/nextcloud\/lib\/private\/AppFramework\/Http\/Request.php#729","userAgent":"python-requests\/2.18.4","version":"12.0.4.3"}
{"reqId":"WoT5@38AAQEAAA2rWzoAAABJ","level":2,"time":"2018-02-15T03:09:47+00:00","remoteAddr":"139.162.78.135","user":"--","app":"core","method":"GET","url":"\/","message":"Trusted domain error. \"139.162.78.135\" tried to access using \"79.75.128.116\" as host.","userAgent":"Mozilla\/5.0 (Windows NT 10.0; WOW64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/45.0.2454.101 Safari\/537.36","version":"12.0.4.3"}
{"reqId":"WoUEsX8AAQEAAA2rWzwAAABM","level":3,"time":"2018-02-15T03:55:29+00:00","remoteAddr":"163.172.192.121","user":"--","app":"PHP","method":"GET","url":"\/a2billing\/common\/javascript\/misc.js","message":"Exception: The requested uri(\/a2billing\/common\/javascript\/misc.js) cannot be processed by the script '\/core\/templates\/404.php') at \/var\/www\/nextcloud\/lib\/private\/AppFramework\/Http\/Request.php#729","userAgent":"python-requests\/2.18.4","version":"12.0.4.3"}
{"reqId":"WoUVEH8AAQEAAA2i0dsAAAAL","level":2,"time":"2018-02-15T05:05:20+00:00","remoteAddr":"80.82.77.139","user":"--","app":"core","method":"GET","url":"\/","message":"Trusted domain error. \"80.82.77.139\" tried to access using \"79.75.128.116\" as host.","userAgent":"Mozilla\/5.0 (X11; Linux x86_64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/34.0.1847.137 Safari\/537.36","version":"12.0.4.3"}
{"reqId":"WoV-C38AAQEAACmpy1YAAAAU","level":2,"time":"2018-02-15T12:37:31+00:00","remoteAddr":"216.218.206.66","user":"--","app":"core","method":"GET","url":"\/","message":"Trusted domain error. \"216.218.206.66\" tried to access using \"79.75.156.41\" as host.","userAgent":"--","version":"12.0.4.3"}
{"reqId":"WoX18X8AAQEAACmpzJsAAAAH","level":2,"time":"2018-02-15T21:04:50+00:00","remoteAddr":"60.191.38.77","user":"--","app":"core","method":"GET","url":"\/","message":"Trusted domain error. \"60.191.38.77\" tried to access using \"79.75.156.41:443\" as host.","userAgent":"Mozilla\/5.0 (Macintosh; Intel Mac OS X 10.11; rv:47.0) Gecko\/20100101 Firefox\/47.0","version":"12.0.4.3"}
Reacted by Jan Vlug
Activity
nachoparker commentedon Feb 16, 2018
(edited, wrong tab)
nachoparker commentedon Feb 16, 2018
I think I found it. Some update duplicated the symlink for the opcache configuration
Can you replicate this finding?
It is just a harmless warning.
[-]PhP error ?[/-][+]PhP warning - Cannot load Zend OPcache - it was already loaded[/+]Iolaum commentedon Feb 16, 2018
Yes I can replicate that:
Is the solution to just delete the second symlink?
nachoparker commentedon Feb 16, 2018
yes, I fixed it in the update, please reopen if it still happens after
v0.46.16thanks!
Iolaum commentedon Oct 27, 2018
It looks like this bug reappeared as we moved to php7.2:
ovpc commentedon Oct 27, 2018
Strange, it only happens on my rpi3B+ , not on my Debian9 install
Iolaum commentedon Oct 27, 2018
I think this bug creeped in after @nachoparker enabled the buster sources, not php7.2 but I am not 100% sure
nachoparker commentedon Oct 27, 2018
probably with the jump to PHP7.2. Thanks for the PR!
ovpc commentedon Nov 17, 2018
Back again ;-( 2 simlinks in /etc/php/7.2/cli/conf.d/ (10- and 20-) both pointing to /etc/php/7.2/mods-available/opcache.ini
eogut commentedon Nov 23, 2018
I have that error, too!
nachoparker commentedon Nov 23, 2018
should be fixed now again. Note that this is a harmless warning, that appears with updates. Not much we can do about it.
17 remaining items
Knubbel commentedon Feb 9, 2023
Yes, same with me.
Update to PHP 8.1 seems to have generated new entries again.
It does seem an regular recurring issue as that happened a week ago already with an update. Ev ery single PHP update recreates the lines.
So I did
NCP Panel reports everything is up and running, but so far I could not reach the NC login screen.
And then
That worked.
token0 commentedon Jul 25, 2023
Manual fix.
Find all occurrences:
And then remove oldest duplicates. In my case those that was dated 2020.
torstenzenk commentedon Nov 8, 2023
Or if
shows you a list like this:
lrwxrwxrwx 1 root root 39 Nov 2 15:31 /etc/php/8.2/fpm/conf.d/10-opcache.ini -> /etc/php/8.2/mods-available/opcache.ini -rw-r--r-- 1 root root 95 Jun 9 21:37 /etc/php/8.2/mods-available/opcache.ini lrwxrwxrwx 1 root root 39 Nov 2 15:31 /etc/php/8.2/embed/conf.d/10-opcache.ini -> /etc/php/8.2/mods-available/opcache.ini lrwxrwxrwx 1 root root 39 Nov 2 15:31 /etc/php/8.2/phpdbg/conf.d/10-opcache.ini -> /etc/php/8.2/mods-available/opcache.ini lrwxrwxrwx 1 root root 39 Nov 2 15:31 /etc/php/8.2/cli/conf.d/10-opcache.ini -> /etc/php/8.2/mods-available/opcache.ini lrwxrwxrwx 1 root root 39 Nov 2 15:31 /etc/php/8.2/cgi/conf.d/10-opcache.ini -> /etc/php/8.2/mods-available/opcache.ini lrwxrwxrwx 1 root root 39 Nov 2 15:31 /etc/php/8.2/apache2/conf.d/10-opcache.ini ->/etc/php/8.2/mods-available/opcache.ini`rename the opcache.ini from Apache
Server:/etc/apache2/sites-available$ sudo mv /etc/php/8.2/apache2/conf.d/10-opcache.ini /etc/php/8.2/apache2/conf.d/10-opcache.originaland restart Apache
`
miri64 commentedon Jun 10, 2024
This showed up again after updating the PHP packages to 8.1.29-1+0
20240606.65+debian121.gbp2ddf4e last Saturday (2024-06-08). I am on NCP v1.52.2:The usual workaround fixed it again:
$ sudo rm /etc/php/8.1/*/conf.d/20-opcache.iniMatthionine commentedon Jul 31, 2026
This appears again with the update to php 8.3 and is resolved as before on ncp 1.58:
and can be fixed by deleting the additional .ini-file:
janvlug commentedon Oct 17, 2026
I saw the "Cannot load Zend OPcache - it was already loaded" already for a long time, but only today took action to investigate.
I have:
Note that the
20-opcache.iniis the newest. I would expect it is best to remove the oldest link. But in the comments above some people remove the newest link. What is recommended?Should this issue be reopened?
Knubbel commentedon Oct 17, 2026
I guess so. I let DeepSeek do an analysis on my installation and here is the summary of findings and advice:
deb.sury.org(8.3.x-1+0~<date>...+debian13~1)php8.3-fpmphp8.3-*package upgrade since the NCP install (2024-09-24)TL;DR
NCP writes
/etc/php/8.3/mods-available/opcache.iniwithout the; priority=10header linethat the original sury template contains.
php-helperfalls back to priority 20 when theheader is missing, so the
php8.3-opcachepostinstcreates an additional20-opcache.inisymlink next to the existing
10-opcache.inion the next package update. Both symlinks resolveto the same file and both contain
zend_extension=opcache.so→ PHP loads OPcache twice andprints the warning.
Permanent fix: add
; priority=10as the first line of/etc/php/8.3/mods-available/opcache.ini(and to the NCP template/usr/local/etc/ncp-templates/php/opcache.ini.sh). After that,phpenmodupdates the existing10-priority symlink instead of creating a 20-priority duplicate.
The warning itself is harmless (no performance loss, OPcache stays active) — it is log noise
plus recurring manual cleanup after each PHP update.
1. Symptom
PHP prints a startup warning whenever a SAPI initialises:
Where it shows up:
php -voutput (CLI), e.g. when cron or monitoring scripts invoke PHPjournalctl -u php8.3-fpm(at every FPM start / reload)The duplicate symlinks are visible directly:
Impact assessment:
php -vstill reportswith Zend OPcache v8.3.x.removed manually (
sudo rm …/20-opcache.ini) — unless the actual cause is fixed.2. Environment details
The box runs unattended NCP and Nextcloud updates daily (
nc-autoupdate-ncp,nc-autoupdate-nc), Debian/Armbian security updates viaunattended-upgrades, while sury PHPpackages are only installed manually.
3. Root cause (verified chain)
Original content that triggers the default:
Historical context on this system:
10-opcache.inisymlinks (cli + fpm)mods-available/opcache.iniwithout the priority headerphp8.3-opcacheupgrade adds a20-opcache.ini; manualrmafter each updateNote: the two symlinks are identical targets, so no configuration is lost or changed by
removing either of them. The duplicate link is purely a naming/priority artefact.
4. Who is affected / how to check
Any NextcloudPi (or any system using Debian's
php-helper) wheremods-available/opcache.iniwas rewritten by a template without the priority header.Expected healthy state: exactly one
10-opcache.iniper SAPI, header present, no warning.5. Workarounds and fix
5.1 Immediate cleanup (what we did after every update so far)
sudo rm -f /etc/php/8.3/*/conf.d/20-opcache.ini sudo systemctl restart php8.3-fpm apache2This removes the warning until the next PHP package update — not a permanent fix.
5.2 Permanent fix – local file (takes effect immediately)
Result:
phpenmod/php_invoke enmodnow derive priority 10, so the existing10-opcache.inisymlink is updated in place and no20-opcache.iniis created anymore.5.3 Permanent fix – NCP template (survives template re-runs)
/usr/local/etc/ncp-templates/php/opcache.ini.shwrites the file during NCP operations(Nextcloud update,
ncp-restore, data directory change). Add the same header there, as thefirst line emitted by the heredoc, directly before
zend_extension=opcache.so:sudo cp /usr/local/etc/ncp-templates/php/opcache.ini.sh \ /usr/local/etc/ncp-templates/php/opcache.ini.sh.bak-$(date +%Y%m%d) sudo nano /usr/local/etc/ncp-templates/php/opcache.ini.sh # inside the "cat <<EOF" block, insert as first line: ; priority=10Then verify:
grep -n 'priority' /usr/local/etc/ncp-templates/php/opcache.ini.shCaveat: an NCP self-update may overwrite the template again. Re-check the file after NCP
updates (a simple
grepis enough). The local file fix (5.2) remains active regardless.5.4 Important when dpkg/UCF asks about
opcache.iniOn a PHP update, if dpkg or UCF presents a conffile prompt for
opcache.ini:keep the local version. Taking the package template drops NCP-specific settings such as
opcache.file_cachepointing to the Nextcloud data directory. Re-check step 5.2 afterwards.5.5 Optional: reproduce the root cause on a disposable system
With the header missing,
20-opcache.inireappears immediately.6. Verification after the fix (live, 2026-10-01)
Sequence performed: set the header in
mods-available/opcache.iniand in the NCP template(backups as
.bak-20261001), then upgrade 17 ×php8.3-*from 8.3.32 to 8.3.35 pluslibgd3.ls -la /etc/php/8.3/*/conf.d/*opcache*20-opcache.ini, only10-opcache.iniper SAPIphp -vjournalctl -u php8.3-fpm -n 30 --no-pagergrep -c 'already loaded' /var/log/syslogsystemctl is-active apache2 mariadb redis-server php8.3-fpm AdGuardHome kopia-serveractivepgrep -c php8.3-fpmcurl -sk https://localhost/status.php"installed":true, ~80 msNo configuration prompts appeared during the upgrade; the fix has held since.
The same pre-emptive fix was also applied to a second NCP box before its distribution upgrade
(NCP v1.57.1 → v1.58.0, Debian 12 → 13); no duplicate symlink occurred there either.
7. Suggested upstream change
The bug is not in Debian's
php-helper(defaulting to 20 for a missing header is documentedbehaviour) and not in the sury package (its original template contains the header). The
divergence is in the NCP template:
ncp-templates/php/opcache.ini.shshould emit; priority=10as its first line, matchingthe sury template. That is a one-line change and fixes the issue for every NCP installation
using sury PHP, regardless of PHP version.
Optional hardening: after a PHP update, NCP could check for duplicate
*opcache*symlinks inconf.dand remove stale ones — but with the header in place this should never be necessary.ph818 commentedon Oct 27, 2026
This bug appeared for me after running
ncp-dist-upgradefrom bookwork to trixie. I noticed the problem because of all the new root mail. Thank you for the fixes -- I am implementing them on my system.@Knubbel
I would like to verify, the text to insert into
/usr/local/etc/ncp-templates/php/opcache.ini.shiswith the # commenting it out, and not
without the comment?
Thank you :)
FadeFx commentedon Nov 19, 2026
Yesterday I had an update to the mail app, I installed it and apache stopped. The reason was the 20-opcache.ini was placed in the PHP 8.5 fpm config, which caused PHP to refuse from starting, as opcache is not a module anymore in PHP 8.5. I had to delete the file to get apache and nextcloud to work again
FadeFx commentedon Nov 19, 2026
Followup
error.log is full of:
AH02454: FCGI: attempt to connect to Unix domain socket /run/php/php8.5-fpm.sock (localhost:8000) failed
AH01079: failed to make connection to backend: localhost
php8.5-fpm was dead (status=254). The journal shows this on every start attempt:
PHP Warning: Failed loading Zend extension 'opcache.so' (tried: /usr/lib/php/20250925/opcache.so (...: cannot open shared object file: No such file or directory), ...)
Fatal Error opcache.file_cache must be a full path of an accessible directory
until systemd gives up with "Start request repeated too quickly".
My /etc/php/8.5/mods-available/opcache.ini (written by NCP) starts with zend_extension=opcache.so and also has opcache.fast_shutdown=1 and opcache.file_cache=/media/myCloudDrive/ncdata/data/.opcache. There was a 20-opcache.ini in /etc/php/8.5/fpm/conf.d/ pointing to it.
OPcache is built into PHP 8.5, so there is no opcache.so anymore (dpkg -S finds no package owning the ini, and no opcache package is installed).
Deleting /etc/php/8.5/fpm/conf.d/20-opcache.ini, then
systemctl reset-failed php8.5-fpm
and
systemctl start php8.5-fpm
fixed it.
I grepped /usr/local: ncp-update-nc.d/upgrade-php-trixie-8.5.sh runs phpenmod -v "${PHPVER_NEW}" -s fpm opcache (line 58), so I guess that's where the link comes from. The template php/opcache.ini.sh hardcodes the zend_extension line. I haven't read the whole script though.
Probably the same root cause as here, only the symptom is different: "already loaded" there, missing opcache.so here.
Not sure whether the failed zend_extension or the file_cache check is what actually kills fpm. /media/myCloudDrive was mounted.
Suggestion: don't run phpenmod opcache on 8.5, and leave zend_extension=opcache.so (and fast_shutdown) out of the template for 8.5.
NCP 1.59.0, Raspberry Pi 5 on raspberrypios trixie, PHP 8.5, Apache 2.4.71
janvlug commentedon Nov 19, 2026
@theCalcaholic: It seems that this issue reappeared, or was not totally solved. Should it be reopened?
Knubbel commentedon Nov 19, 2026
Correct: no
#.The
#in my snippet was only a shell comment used to separate my instructions from the file content — it must not be copied into the template.Insert exactly this as the first line inside the
cat <<EOFblock:Why it matters: the heredoc writes its lines verbatim into
/etc/php/<ver>/mods-available/opcache.ini, butget_priority()in/usr/lib/php/php-helperonly recognises a line starting with; priority=. With a leading#the generated file would contain# ; priority=10, PHP would still default to priority 20 and20-opcache.iniwould reappear on the nextphp*-opcacheupdate.Note that
grep -n 'priority'matches in both cases, so use a stricter check:Also keep in mind that the template edit alone only takes effect the next time NCP regenerates the file (Nextcloud update,
ncp-restore, data-dir change). For the current state you still need step 5.2 on the live file, plus removing the stale duplicate:sudo rm -f /etc/php/8.3/*/conf.d/20-opcache.ini sudo systemctl restart php8.3-fpm apache2Verification that the cause is gone (the postinst should no longer create a 20-priority link):
One more caveat: upstream
ncp-templates/php/opcache.ini.shstill lacks the priority header (checked today), so an NCP self-update can overwrite your template edit — re-check it after eachncp-update. The livemods-available/opcache.inifix (5.2) stays active regardless.Knubbel commentedon Nov 19, 2026
Thanks, that's a good catch — and your diagnosis is right, but the two errors are not equally severe, and on 8.5 the mechanism is slightly different from the 8.3 case above.
What actually kills FPM is the second line, not the first. Since PHP 8.5 OPcache is compiled into the binary and always loaded, and the build no longer produces an
opcache.so(PHP 8.5UPGRADING, sections 1 and 9: "the build does not produce opcache.so … Usingzend_extension=opcache.so… will emit a warning"). SoFailed loading Zend extension 'opcache.so'is anE_WARNINGonly. TheFatal Error opcache.file_cache must be a full path of an accessible directoryis a core error during module startup: OPcache tries to initialise its file cache, the path is not reachable (missing directory / mount not up yet / not writable), the module aborts, the FPM master exits with status 254, and systemd gives up with "Start request repeated too quickly". Removing the20-opcache.ini"fixed" it only because that link is what made the broken ini load in the first place.Why the priority theory does not apply here: on 8.5 there is no
php8.5-opcachepackage, so there is nopostinstcreating a 20-priority symlink. NCP creates both artefacts itself —upgrade-php-trixie-8.5.shrunsinstall_template "php/opcache.ini.sh" .../mods-available/opcache.iniand thenphpenmod -v 8.5 -s fpm opcache. With no; priority=10header in the template,php-helperpicks 20, hence20-opcache.ini. Adding the header would only rename it to10-opcache.ini— thezend_extensionline would still be there, and thefile_cachefatal would still happen. The header fix from above is for ≤ 8.4; on 8.5 the file simply has to go away.Stable setup on PHP 8.5 (running like this since 08.11.2026, 8.5.12 → current, through several
php8.5-*upgrades):Notes on the three template lines:
zend_extension=opcache.so— drop it, OPcache is always loaded on 8.5.opcache.fast_shutdown=1— no-op since PHP 7.2 (directive removed), just noise.opcache.file_cache=/media/.../.opcache— drop it, or make sure the directory exists and is writable at the moment PHP starts, i.e. after the mount is up (systemctl show -p RequiresMountsFor php8.5-fpm,x-systemd.automountfor/media/myCloudDrive). Check withsudo -u www-data test -w <dir>. On my box the file cache was practically unused (12 KB), so it was removed — one less way to take the whole web server down at boot.Also relevant on 8.5:
opcache.memory_consumptioncan no longer be changed after startup — aphp_admin_value[opcache.memory_consumption]in the FPM pool config now logs a warning instead of silently being ignored (documented change in PHP 8.5). Keep the values inconf.d.Verification:
Suggested upstream change — the script is nearly there (
PHP_PACKAGES_NEWalready omitsopcache); only the template call and thephpenmodare left:Same for the rollback branch. With the
; priority=10header in the ≤ 8.4 template (from above) and no template/phpenmodfor ≥ 8.5, both variants of this bug are gone for good. Until that lands,ncp-updatere-installs the template, so re-check/etc/php/$(php -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')/mods-available/opcache.iniafter every NCP self-update.FadeFx commentedon Nov 19, 2026
The output of the verification script, if needed:
PHP 8.5.12 (cli) (built: Oct 21 2026 08:09:42) (NTS)
Copyright (c) The PHP Group
Built by Debian
Zend Engine v4.5.12, Copyright (c) Zend Technologies
with Zend OPcache v8.5.12, Copyright (c), by Zend Technologies
Zend OPcache
Zend OPcache
99-opcache-tuning.ini
99-opcache-tuning.ini
opcache.file_cache => no value => no value
opcache.file_cache_consistency_checks => On => On
opcache.file_cache_only => Off => Off
opcache.file_cache_read_only => Off => Off
opcache.interned_strings_buffer => 32 => 32
opcache.max_accelerated_files => 20000 => 20000
active
active
{"installed":true,"maintenance":false,"needsDbUpgrade":false,"version":"33.0.11.2","versionstring
FadeFx commentedon Nov 22, 2026
I have to take back that part of the analysis... I guess these messages were from a reboot of the server