Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/magento/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Opcache自清除并中断代码执行_Php_Magento_Opcache - Fatal编程技术网

Php Opcache自清除并中断代码执行

Php Opcache自清除并中断代码执行,php,magento,opcache,Php,Magento,Opcache,我有一个Magento 2存储,但这似乎是一个PHP问题,启用了opcache,有时opcache似乎会自行清除,如果无法执行某些操作,我最终会创建一个存储。有时,当我手动清除opcache时,我也会收到错误和存储,而不是完全脱机,根据错误,某些操作无法执行。有时我无法将产品添加到购物车或下订单。这些错误与下面的错误类似: [2020-06-09 18:20:38] main.CRITICAL: Warning: preg_match(): Compilation failed: unmatch

我有一个Magento 2存储,但这似乎是一个PHP问题,启用了opcache,有时opcache似乎会自行清除,如果无法执行某些操作,我最终会创建一个存储。有时,当我手动清除opcache时,我也会收到错误和存储,而不是完全脱机,根据错误,某些操作无法执行。有时我无法将产品添加到购物车或下订单。这些错误与下面的错误类似:

[2020-06-09 18:20:38] main.CRITICAL: Warning: preg_match(): Compilation failed: unmatched parentheses at offset 36 in /home/store/public_html/vendor/magento/zendframework1/library/Zend/Locale/Format.php on line 527 {"exception":"[object] (Exception(code: 0): Warning: preg_match(): Compilation failed: unmatched parentheses at offset 36 in /home/store/public_html/vendor/magento/zendframework1/library/Zend/Locale/Format.php on line 527 at /home/store/public_html/vendor/magento/framework/App/ErrorHandler.php:61)"} []

以下是我的opcache配置:

; Enable Zend OPcache extension module
zend_extension=opcache.so

; Determines if Zend OPCache is enabled
opcache.enable=1

; Determines if Zend OPCache is enabled for the CLI version of PHP
opcache.enable_cli=1

; The OPcache shared memory storage size.
opcache.memory_consumption=2048

; The amount of memory for interned strings in Mbytes.
opcache.interned_strings_buffer=16

; The maximum number of keys (scripts) in the OPcache hash table.
; Only numbers between 200 and 100000 are allowed.
opcache.max_accelerated_files=100000

; The maximum percentage of "wasted" memory until a restart is scheduled.
;opcache.max_wasted_percentage=5

; When this directive is enabled, the OPcache appends the current working
; directory to the script key, thus eliminating possible collisions between
; files with the same name (basename). Disabling the directive improves
; performance, but may break existing applications.
;opcache.use_cwd=1

; When disabled, you must reset the OPcache manually or restart the
; webserver for changes to the filesystem to take effect.
opcache.validate_timestamps=0

; How often (in seconds) to check file timestamps for changes to the shared
; memory storage allocation. ("1" means validate once per second, but only
; once per request. "0" means always validate)
;opcache.revalidate_freq=2

; Enables or disables file search in include_path optimization
;opcache.revalidate_path=0

; If disabled, all PHPDoc comments are dropped from the code to reduce the
; size of the optimized code.
opcache.save_comments=1

; If disabled, PHPDoc comments are not loaded from SHM, so "Doc Comments"
; may be always stored (save_comments=1), but not loaded by applications
; that don't need them anyway.
;opcache.load_comments=1

; If enabled, a fast shutdown sequence is used for the accelerated code
opcache.fast_shutdown=1

; Allow file existence override (file_exists, etc.) performance feature.
;opcache.enable_file_override=0

; A bitmask, where each bit enables or disables the appropriate OPcache
; passes
;opcache.optimization_level=0xffffffff

;opcache.inherited_hack=1
;opcache.dups_fix=0

; The location of the OPcache blacklist file (wildcards allowed).
; Each OPcache blacklist file is a text file that holds the names of files
; that should not be accelerated. The file format is to add each filename
; to a new line. The filename may be a full path or just a file prefix
; (i.e., /var/www/x  blacklists all the files and directories in /var/www
; that start with 'x'). Line starting with a ; are ignored (comments).
;opcache.blacklist_filename=/etc/php.d/opcache*.blacklist
opcache.blacklist_filename=/home/store/opcache.excluded.txt

; Allows exclusion of large files from being cached. By default all files
; are cached.
;opcache.max_file_size=0

; Check the cache checksum each N requests.
; The default value of "0" means that the checks are disabled.
opcache.consistency_checks=0

; How long to wait (in seconds) for a scheduled restart to begin if the cache
; is not being accessed.
;opcache.force_restart_timeout=180

; OPcache error_log file name. Empty string assumes "stderr".
;opcache.error_log=

; All OPcache errors go to the Web server log.
; By default, only fatal errors (level 0) or errors (level 1) are logged.
; You can also enable warnings (level 2), info messages (level 3) or
; debug messages (level 4).
;opcache.log_verbosity_level=1

; Preferred Shared Memory back-end. Leave empty and let the system decide.
;opcache.preferred_memory_model=

; Protect the shared memory from unexpected writing during script execution.
; Useful for internal debugging only.
;opcache.protect_memory=0

; Allows calling OPcache API functions only from PHP scripts which path is
; started from specified string. The default "" means no restriction
;opcache.restrict_api=

; Mapping base of shared memory segments (for Windows only). All the PHP
; processes have to map shared memory into the same address space. This
; directive allows to manually fix the "Unable to reattach to base address"
; errors.
;opcache.mmap_base=
这是我的
opcache\u get\u status(false)
功能的结果:

数组
(
[opcache_enabled]=>1
[缓存已满]=>
[重新启动\u挂起]=>
[正在重新启动]=>
[内存使用]=>阵列
(
[已用内存]=>152442416
[可用内存]=>1995041232
[浪费的内存]=>0
[当前\u浪费\u百分比]=>0
)
[interned_strings_usage]=>数组
(
[缓冲区大小]=>16777216
[已用内存]=>12353632
[可用内存]=>4423584
[字符串的数量]=>176637
)
[opcache_statistics]=>数组
(
[num\u缓存的\u脚本]=>6796
[num_cached_keys]=>13127
[最大缓存密钥]=>130987
[点击次数]=>15440094
[开始时间]=>1590744538
[上次重新启动时间]=>1591785370
[oom_重新启动]=>0
[哈希_重新启动]=>0
[手动重新启动]=>14
[未命中]=>8549
[黑名单未命中]=>15011
[blacklist_miss_ratio]=>0.097072787583064
[操作缓存命中率]=>99.847642736962
)
)
在我的opcache排除列表中是
/home/store/public\u html/pub/
目录

自动操作缓存代码刷新似乎每隔一周发生一次,但不是在一天中的特定日期或时间

我在PHP日志中没有关于opcache错误的日志

为什么opcache会在有大量可用空间和内存的情况下自行清除,为什么清除opcache可能会导致看起来像是坏掉的缓存代码

; Enable Zend OPcache extension module
zend_extension=opcache.so

; Determines if Zend OPCache is enabled
opcache.enable=1

; Determines if Zend OPCache is enabled for the CLI version of PHP
opcache.enable_cli=1

; The OPcache shared memory storage size.
opcache.memory_consumption=2048

; The amount of memory for interned strings in Mbytes.
opcache.interned_strings_buffer=16

; The maximum number of keys (scripts) in the OPcache hash table.
; Only numbers between 200 and 100000 are allowed.
opcache.max_accelerated_files=100000

; The maximum percentage of "wasted" memory until a restart is scheduled.
;opcache.max_wasted_percentage=5

; When this directive is enabled, the OPcache appends the current working
; directory to the script key, thus eliminating possible collisions between
; files with the same name (basename). Disabling the directive improves
; performance, but may break existing applications.
;opcache.use_cwd=1

; When disabled, you must reset the OPcache manually or restart the
; webserver for changes to the filesystem to take effect.
opcache.validate_timestamps=0

; How often (in seconds) to check file timestamps for changes to the shared
; memory storage allocation. ("1" means validate once per second, but only
; once per request. "0" means always validate)
;opcache.revalidate_freq=2

; Enables or disables file search in include_path optimization
;opcache.revalidate_path=0

; If disabled, all PHPDoc comments are dropped from the code to reduce the
; size of the optimized code.
opcache.save_comments=1

; If disabled, PHPDoc comments are not loaded from SHM, so "Doc Comments"
; may be always stored (save_comments=1), but not loaded by applications
; that don't need them anyway.
;opcache.load_comments=1

; If enabled, a fast shutdown sequence is used for the accelerated code
opcache.fast_shutdown=1

; Allow file existence override (file_exists, etc.) performance feature.
;opcache.enable_file_override=0

; A bitmask, where each bit enables or disables the appropriate OPcache
; passes
;opcache.optimization_level=0xffffffff

;opcache.inherited_hack=1
;opcache.dups_fix=0

; The location of the OPcache blacklist file (wildcards allowed).
; Each OPcache blacklist file is a text file that holds the names of files
; that should not be accelerated. The file format is to add each filename
; to a new line. The filename may be a full path or just a file prefix
; (i.e., /var/www/x  blacklists all the files and directories in /var/www
; that start with 'x'). Line starting with a ; are ignored (comments).
;opcache.blacklist_filename=/etc/php.d/opcache*.blacklist
opcache.blacklist_filename=/home/store/opcache.excluded.txt

; Allows exclusion of large files from being cached. By default all files
; are cached.
;opcache.max_file_size=0

; Check the cache checksum each N requests.
; The default value of "0" means that the checks are disabled.
opcache.consistency_checks=0

; How long to wait (in seconds) for a scheduled restart to begin if the cache
; is not being accessed.
;opcache.force_restart_timeout=180

; OPcache error_log file name. Empty string assumes "stderr".
;opcache.error_log=

; All OPcache errors go to the Web server log.
; By default, only fatal errors (level 0) or errors (level 1) are logged.
; You can also enable warnings (level 2), info messages (level 3) or
; debug messages (level 4).
;opcache.log_verbosity_level=1

; Preferred Shared Memory back-end. Leave empty and let the system decide.
;opcache.preferred_memory_model=

; Protect the shared memory from unexpected writing during script execution.
; Useful for internal debugging only.
;opcache.protect_memory=0

; Allows calling OPcache API functions only from PHP scripts which path is
; started from specified string. The default "" means no restriction
;opcache.restrict_api=

; Mapping base of shared memory segments (for Windows only). All the PHP
; processes have to map shared memory into the same address space. This
; directive allows to manually fix the "Unable to reattach to base address"
; errors.
;opcache.mmap_base=