Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The PHP OPcache module is not configured correctly #1926

Closed
talesam opened this issue Feb 25, 2023 · 13 comments
Closed

The PHP OPcache module is not configured correctly #1926

talesam opened this issue Feb 25, 2023 · 13 comments

Comments

@talesam
Copy link

talesam commented Feb 25, 2023

"The PHP OPcache module is not configured correctly. See the documentation ↗ for more information.
The OPcache internal string buffer is almost full. To ensure that repeated strings can be effectively cached, it is recommended to apply opcache.interned_strings_buffer to your PHP configuration with a value greater than 16."

opcache.interned_strings_buffer The default is 16, could you set it to 32?

Nextcloud Version: 25.0.3

@rardcode
Copy link

rardcode commented Mar 2, 2023

This error is also in 25.0.4 version:

Sono presenti degli avvisi relativi alla tua configurazione.
Il modulo PHP OPcache non è configurato correttamente. Controlla la documentazione ↗ per maggiori informazioni.
The OPcache interned strings buffer is nearly full. To assure that repeating strings can be effectively cached, it is recommended to apply opcache.interned_strings_buffer to your PHP configuration with a value higher than 16.
Leggi attentamente le guide d'installazione ↗, e controlla gli errori o gli avvisi nel log.

Controlla la sicurezza del tuo Nextcloud con la nostra scansione di sicurezza ↗

Versione
Nextcloud Hub 3 (25.0.4)

I tried to add 'opcache.interned_strings_buffer' => '32', in Nextcloud config.php but doesn't work

@talesam
Copy link
Author

talesam commented Mar 2, 2023

I don't know if it's the best way, but I solved it like this:

Create a file (opcache-recommed.ini) somewhere place and mount it, just change the size and restart the docker.

Volumes:
 - ./opcache-recommed.ini:/usr/local/etc/php/conf.d/opcache-recommended.ini

File Contents "opcache-recommeded.ini"

opcache.enable=1
opcache.interned_strings_buffer=32
opcache.max_accelerated_files=10000
opcache.memory_consumption=128
opcache.save_comments=1
opcache.revalidate_freq=60

@rardcode
Copy link

rardcode commented Mar 2, 2023

I don't know if it's the best way, but I solved it like this:

Create a file (opcache-recommed.ini) somewhere place and mount it, just change the size and restart the docker.

Volumes:
 - ./opcache-recommed.ini:/usr/local/etc/php/conf.d/opcache-recommended.ini

File Contents "opcache-recommeded.ini"

opcache.enable=1
opcache.interned_strings_buffer=32
opcache.max_accelerated_files=10000
opcache.memory_consumption=128
opcache.save_comments=1
opcache.revalidate_freq=60

Thanks @talesam !!

@minderdl
Copy link

It seems this is already fixed in f8169f6. Just wait for the new release.

@J0WI J0WI closed this as completed Mar 28, 2023
@ghost
Copy link

ghost commented Apr 23, 2023

the problem still exists :latest. Is there any new information here?

@meonkeys
Copy link
Contributor

@R7JANV1 I thought your issue was with the general opcache memory consumption ( #1965 ). Or are you getting a warning about string buffers, specifically? What warning(s) are you seeing?

@ghost
Copy link

ghost commented Apr 26, 2023

I get the following error message:
The OPcache buffer is almost full. To ensure that all scripts can be kept in the cache, it is recommended to apply opcache.memory_consumption in your PHP configuration with a value higher than 128.

@talesam
Copy link
Author

talesam commented Apr 27, 2023

I get the following error message: The OPcache buffer is almost full. To ensure that all scripts can be kept in the cache, it is recommended to apply opcache.memory_consumption in your PHP configuration with a value higher than 128.

I posted above how to solve this

@flortsch
Copy link
Contributor

flortsch commented Nov 22, 2023

The issue still exists. IMHO this patch from nextcloud/all-in-one should be applied here as well: nextcloud/all-in-one#2762.

@rubo77
Copy link
Contributor

rubo77 commented Jun 8, 2024

still exists in NC 29.0.1

the workaround from #1926 (comment) still works

@rubo77 rubo77 reopened this Jun 8, 2024
@joshtrichards
Copy link
Member

This is mostly being discussed in #2184 and associated PR #2185 at the moment. And we're also working on some upstream docs improvements.

So to avoid spreading the discussions around, let's consolidate there.

@joshtrichards joshtrichards closed this as not planned Won't fix, can't repro, duplicate, stale Jun 8, 2024
@mighty-services
Copy link

mighty-services commented Sep 26, 2024

I have this error in my nextcloud docker environment too since several releases. I tried many things, but the error still persists.

I tried:

  • the method from above
  • using the php.ini-production and create a new php.ini config with the lines uncommented
  • using an Environment-Variable in the docker-compose file

This is my php --ini output:

Configuration File (php.ini) Path: /usr/local/etc/php
Loaded Configuration File:         (none)
Scan for additional .ini files in: /usr/local/etc/php/conf.d
Additional .ini files parsed:      /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini,
/usr/local/etc/php/conf.d/docker-php-ext-bcmath.ini,
/usr/local/etc/php/conf.d/docker-php-ext-exif.ini,
/usr/local/etc/php/conf.d/docker-php-ext-ftp.ini,
/usr/local/etc/php/conf.d/docker-php-ext-gd.ini,
/usr/local/etc/php/conf.d/docker-php-ext-gmp.ini,
/usr/local/etc/php/conf.d/docker-php-ext-imagick.ini,
/usr/local/etc/php/conf.d/docker-php-ext-intl.ini,
/usr/local/etc/php/conf.d/docker-php-ext-ldap.ini,
/usr/local/etc/php/conf.d/docker-php-ext-memcached.ini,
/usr/local/etc/php/conf.d/docker-php-ext-opcache.ini,
/usr/local/etc/php/conf.d/docker-php-ext-pcntl.ini,
/usr/local/etc/php/conf.d/docker-php-ext-pdo_mysql.ini,
/usr/local/etc/php/conf.d/docker-php-ext-pdo_pgsql.ini,
/usr/local/etc/php/conf.d/docker-php-ext-redis.ini,
/usr/local/etc/php/conf.d/docker-php-ext-sodium.ini,
/usr/local/etc/php/conf.d/docker-php-ext-sysvsem.ini,
/usr/local/etc/php/conf.d/docker-php-ext-zip.ini,
/usr/local/etc/php/conf.d/nextcloud.ini,
/usr/local/etc/php/conf.d/opcache-recommended.ini

This is my php -i | grep opcache output:

opcache.blacklist_filename => no value => no value
opcache.consistency_checks => 0 => 0
opcache.dups_fix => Off => Off
opcache.enable => On => On
opcache.enable_cli => Off => Off
opcache.enable_file_override => Off => Off
opcache.error_log => no value => no value
opcache.file_cache => no value => no value
opcache.file_cache_consistency_checks => On => On
opcache.file_cache_only => Off => Off
opcache.file_update_protection => 2 => 2
opcache.force_restart_timeout => 180 => 180
opcache.huge_code_pages => Off => Off
opcache.interned_strings_buffer => 32 => 32
opcache.jit => 1255 => 1255
opcache.jit_bisect_limit => 0 => 0
opcache.jit_blacklist_root_trace => 16 => 16
opcache.jit_blacklist_side_trace => 8 => 8
opcache.jit_buffer_size => 128M => 128M
opcache.jit_debug => 0 => 0
opcache.jit_hot_func => 127 => 127
opcache.jit_hot_loop => 64 => 64
opcache.jit_hot_return => 8 => 8
opcache.jit_hot_side_exit => 8 => 8
opcache.jit_max_exit_counters => 8192 => 8192
opcache.jit_max_loop_unrolls => 8 => 8
opcache.jit_max_polymorphic_calls => 2 => 2
opcache.jit_max_recursive_calls => 2 => 2
opcache.jit_max_recursive_returns => 2 => 2
opcache.jit_max_root_traces => 1024 => 1024
opcache.jit_max_side_traces => 128 => 128
opcache.jit_prof_threshold => 0.005 => 0.005
opcache.lockfile_path => /tmp => /tmp
opcache.log_verbosity_level => 1 => 1
opcache.max_accelerated_files => 10000 => 10000
opcache.max_file_size => 0 => 0
opcache.max_wasted_percentage => 5 => 5
opcache.memory_consumption => 128 => 128
opcache.opt_debug_level => 0 => 0
opcache.optimization_level => 0x7FFEBFFF => 0x7FFEBFFF
opcache.preferred_memory_model => no value => no value
opcache.preload => no value => no value
opcache.preload_user => no value => no value
opcache.protect_memory => Off => Off
opcache.record_warnings => Off => Off
opcache.restrict_api => no value => no value
opcache.revalidate_freq => 60 => 60
opcache.revalidate_path => Off => Off
opcache.save_comments => On => On
opcache.use_cwd => On => On
opcache.validate_permission => Off => Off
opcache.validate_root => Off => Off
opcache.validate_timestamps => On => On

When I check for installed modules with php -m i don't see the opchache module installed, only the Zend OPchache:

[PHP Modules]
apcu
bcmath
Core
ctype
curl
date
dom
exif
fileinfo
filter
ftp
gd
gmp
hash
iconv
imagick
intl
json
ldap
libxml
mbstring
memcached
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_pgsql
pdo_sqlite
Phar
posix
random
readline
redis
Reflection
session
SimpleXML
sodium
SPL
sqlite3
standard
sysvsem
tokenizer
xml
xmlreader
xmlwriter
Zend OPcache
zip
zlib

[Zend Modules]
Zend OPcache

If this is not the right place to discuss my problem, please go ahead and point me to the right place :)

@rubo77
Copy link
Contributor

rubo77 commented Oct 23, 2024

I had the problem with memory_consumption. When I set it to 256 the message is gone:

opcache.enable=1
opcache.interned_strings_buffer=32
opcache.max_accelerated_files=10000
opcache.memory_consumption=256
opcache.save_comments=1
opcache.revalidate_freq=60
opcache.jit=1255
opcache.jit_buffer_size=128M

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants