1 (edited by rom1z 2014-01-16 17:47:12)

Topic: PHP 5.5.8 (remi-php55) comment activer zend opcache?

Bonjour, je tourne avec la version PHP 5.5.8 (remi-php55) et CentOs 6.5

Je souhaite faire fonctionné le Cache Opcode de Zend

J'ai donc installer opcache.so mais il reste sur "disable" dans mon phpinfo.php

Je n'arrive pas a trouver comment il faut faire pour qu'il soit en "enable"

Avez-vous une idée de comment faire? merci

Dans mon php.ini j'ai ajouté

zend_extension=opcache.so
opcache.enable = On



et dans mon php.info j'ai cela:

Opcode Caching    Disabled
Optimization    Disabled

Directive    Local Value    Master Value
opcache.blacklist_filename    /etc/php.d/opcache*.blacklist    /etc/php.d/opcache*.blacklist
opcache.consistency_checks    0    0
opcache.dups_fix    Off    Off
opcache.enable    On    On
opcache.enable_cli    On    On
opcache.enable_file_override    Off    Off
opcache.error_log    no value    no value
opcache.fast_shutdown    1    1
opcache.file_update_protection    2    2
opcache.force_restart_timeout    180    180
opcache.inherited_hack    On    On
opcache.interned_strings_buffer    8    8
opcache.load_comments    1    1
opcache.log_verbosity_level    1    1
opcache.max_accelerated_files    4000    4000
opcache.max_file_size    0    0
opcache.max_wasted_percentage    5    5
opcache.memory_consumption    128    128
opcache.optimization_level    0xFFFFFFFF    0xFFFFFFFF
opcache.preferred_memory_model    no value    no value
opcache.protect_memory    0    0
opcache.restrict_api    no value    no value
opcache.revalidate_freq    60    60
opcache.revalidate_path    Off    Off
opcache.save_comments    0    0
opcache.use_cwd    On    On
opcache.validate_timestamps    On    On

Re: PHP 5.5.8 (remi-php55) comment activer zend opcache?

> J'ai donc installer opcache.so ...
Comment ?
(=> yum install php-opcache)

> Dans mon php.ini j'ai ajouté
Inutile !
=> /etc/php.d/opcache.ini

$ php -d opcache.enable_cli=1 -i
...
Opcode Caching => Up and Running
Optimization => Enabled
Startup => OK
Shared memory model => mmap
Cache hits => 0
Cache misses => 0
Used memory => 10935080
Free memory => 123282648
Wasted memory => 0
Cached scripts => 0
Cached keys => 0
Max keys => 7963
OOM restarts => 0
Hash keys restarts => 0
Manual restarts => 0

Directive => Local Value => Master Value
opcache.blacklist_filename => /etc/php.d/opcache*.blacklist => /etc/php.d/opcache*.blacklist
opcache.consistency_checks => 0 => 0
opcache.dups_fix => Off => Off
opcache.enable => On => On
opcache.enable_cli => On => On
opcache.enable_file_override => Off => Off
opcache.error_log => no value => no value
opcache.fast_shutdown => 1 => 1
opcache.file_update_protection => 2 => 2
opcache.force_restart_timeout => 180 => 180
opcache.inherited_hack => On => On
opcache.interned_strings_buffer => 8 => 8
opcache.load_comments => 1 => 1
opcache.log_verbosity_level => 1 => 1
opcache.max_accelerated_files => 4000 => 4000
opcache.max_file_size => 0 => 0
opcache.max_wasted_percentage => 5 => 5
opcache.memory_consumption => 128 => 128
opcache.optimization_level => 0xFFFFFFFF => 0xFFFFFFFF
opcache.preferred_memory_model => no value => no value
opcache.protect_memory => 0 => 0
opcache.restrict_api => no value => no value
opcache.revalidate_freq => 2 => 2
opcache.revalidate_path => Off => Off
opcache.save_comments => 1 => 1
opcache.use_cwd => On => On
opcache.validate_timestamps => On => On
...
Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: PHP 5.5.8 (remi-php55) comment activer zend opcache?

Merci de cette réponse ultra rapide

Je dois donc retiré "zend_extension=opcache.so" et "opcache.enable = On" de mon php.ini c'est cela?

Ensuite y t'il une autre manip a effectuer?

Désolé pour mon ignorance , je suis pas un pro dans le domaine, je gere mon serveur en auto-dictate.

Re: PHP 5.5.8 (remi-php55) comment activer zend opcache?

Relire ma réponse, je l'ai complétée

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: PHP 5.5.8 (remi-php55) comment activer zend opcache?

Super j'ai réussi a l'activer!!
je n'avais pas entré la commande: php -d opcache.enable_cli=1 -i

Mille merci

Re: PHP 5.5.8 (remi-php55) comment activer zend opcache?

Remarque : activer opcache en ligne de commande n'a aucun intérêt (sauf pour des tests)

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: PHP 5.5.8 (remi-php55) comment activer zend opcache?

ce n'est donc pas activer correctement? ou definitivement?

Re: PHP 5.5.8 (remi-php55) comment activer zend opcache?

La configuration fournie par défaut (celle recommandé par le projet PHP) l'active dans les moteurs web (mod_php, fpm), là ou elle est utile.

On peut l'activer en ligne de commande (mon test précédent), c'est utile pour diagnostiquer son fonctionnement.

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi