John Davidson

php - Can't enable Zend OpCache on AlmaLinux and PHP8

0 comments
Message:


I'm using AlmaLinux 8.4, and I'm trying to install Zend Opcache and verify that it's running.


In Easy Apache, php8 and php80-php-opcache are installed. php -1 shows Zend is not enabled, while php -a does, and 10-opcache.ini is loaded. (I see that CLI is not enabled, but I don't need it.)


Apache and PHP-FPM have been restarted several times.


Is this configuration correct?


How do I determine if Zend Opcode is actually running?




[root}# php -i shows:


Zend OPcache

Opcode Caching => Disabled
Optimization => Disabled
SHM Cache => Enabled
File Cache => Disabled
JIT => On
Startup Failed => Opcode Caching is disabled for CLI



Loaded Configuration File => /opt/cpanel/ea-php80/root/etc/php.ini
Additional .ini files parsed => /opt/cpanel/ea-php80/root/etc/php.d/10-opcache.ini



Core

PHP Version => 8.0.9

zend.assertions => -1 => -1
zend.detect_unicode => On => On
zend.enable_gc => On => On
zend.exception_ignore_args => Off => Off
zend.exception_string_param_max_len => 15 => 15
zend.multibyte => Off => Off
zend.script_encoding => no value => no value
zend.signal_check => Off => Off

The file /opt/cpanel/ea-php80/root/etc/php.d/10-opcache.ini shows


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=0

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

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

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

php -a shows


php > print_r(opcache_get_configuration());
Array
(
[directives] => Array
(
[opcache.enable] => 1
[opcache.enable_cli] =>
[opcache.use_cwd] => 1
[opcache.validate_timestamps] => 1
[opcache.validate_permission] => 1
[opcache.validate_root] =>
[opcache.dups_fix] =>
[opcache.revalidate_path] =>
[opcache.log_verbosity_level] => 1
[opcache.memory_consumption] => 134217728
[opcache.interned_strings_buffer] => 8
[opcache.max_accelerated_files] => 4000
[opcache.max_wasted_percentage] => 0.05
[opcache.consistency_checks] => 0
[opcache.force_restart_timeout] => 180
[opcache.revalidate_freq] => 2
[opcache.preferred_memory_model] =>
[opcache.blacklist_filename] => /opt/cpanel/ea-php80/root/etc/php.d/opcache*.blacklist
[opcache.max_file_size] => 0
[opcache.error_log] =>
[opcache.protect_memory] =>
[opcache.save_comments] => 1
[opcache.record_warnings] =>
[opcache.enable_file_override] =>
[opcache.optimization_level] => 2147401727
[opcache.lockfile_path] => /tmp
[opcache.file_cache] =>
[opcache.file_cache_only] =>
[opcache.file_cache_consistency_checks] => 1
[opcache.file_update_protection] => 2
[opcache.opt_debug_level] => 0
[opcache.restrict_api] =>
[opcache.huge_code_pages] =>
[opcache.preload] =>
[opcache.preload_user] =>
[opcache.jit] => tracing
[opcache.jit_buffer_size] => 0
[opcache.jit_debug] => 0
[opcache.jit_bisect_limit] => 0
[opcache.jit_blacklist_root_trace] => 16
[opcache.jit_blacklist_side_trace] => 8
[opcache.jit_hot_func] => 127
[opcache.jit_hot_loop] => 64
[opcache.jit_hot_return] => 8
[opcache.jit_hot_side_exit] => 8
[opcache.jit_max_exit_counters] => 8192
[opcache.jit_max_loop_unrolls] => 8
[opcache.jit_max_polymorphic_calls] => 2
[opcache.jit_max_recursive_calls] => 2
[opcache.jit_max_recursive_returns] => 2
[opcache.jit_max_root_traces] => 1024
[opcache.jit_max_side_traces] => 128
[opcache.jit_prof_threshold] => 0
)

[version] => Array
(
[version] => 8.0.9
[opcache_product_name] => Zend OPcache
)

[blacklist] => Array
(
)

)


My Answer:
you please provide more context or clarify your question?

Rate this post

4 of 5 based on 4652 votes

Comments




© 2024 Hayatsk.info - Personal Blogs Platform. All Rights Reserved.
Create blog  |  Privacy Policy  |  Terms & Conditions  |  Contact Us