opcache_reset 通过 cli 是否也重置 apache opcache
Does opcache_reset via cli also resets apache opcache
我必须实现通过终端重置 opcache 的功能。
这是我目前的配置
/etc/php/7.1/apache2/php.ini
[opcache]
opcache.enable = 1
opcache.enable_cli = 1
opcache.memory_consumption = 256
opcache.interned_strings_buffer = 16
opcache.max_accelerated_files = 12850
opcache.validate_timestamps = 1
opcache.revalidate_freq = 0
opcache.fast_shutdown = 1
/etc/php/7.1/cli/php.ini
[opcache]
opcache.enable = 1
opcache.enable_cli = 1
opcache.memory_consumption = 256
opcache.interned_strings_buffer = 16
opcache.max_accelerated_files = 12850
opcache.validate_timestamps = 1
opcache.revalidate_freq = 0
opcache.fast_shutdown = 1
我的问题是,当我 运行 一些 shell 脚本时,它将执行类似于这个 php 脚本的东西 php -r "opcache_get_status();"
这会重置一些 "global" opcache 或者这将只重置 cli opcache,你必须为 apache 实现其他东西。
如果您需要任何其他信息,请告诉我,我会提供。谢谢!
Op_cache(对于 apache)需要通过 url 或 curl 请求重置。如果你通过 cli 运行 php -r "opcache_reset();"
就不一样了,这意味着 Apache 上的 op_cache 不会被重置。我的解决方案 was/is 创建简单的虚拟主机,它正在执行用于重置 op_cache.
的小 php 脚本
我的虚拟主机
<VirtualHost 127.0.0.1:80>
DocumentRoot /var/www/html/opcache
ServerName localhost
DirectoryIndex index.php
<Directory /var/www/html/opcache>
Options All
Order Deny,Allow
Deny from all
Allow from 127.0.0.1 ::1
Allow from localhost
</Directory>
</VirtualHost>
我的php脚本
<?php
opcache_reset();
然后我通过终端
用curl执行脚本
curl -o -I -L -s -w "Response code %{http_code}\n" http://127.0.0.1/opcache/index.php
我必须实现通过终端重置 opcache 的功能。
这是我目前的配置 /etc/php/7.1/apache2/php.ini
[opcache]
opcache.enable = 1
opcache.enable_cli = 1
opcache.memory_consumption = 256
opcache.interned_strings_buffer = 16
opcache.max_accelerated_files = 12850
opcache.validate_timestamps = 1
opcache.revalidate_freq = 0
opcache.fast_shutdown = 1
/etc/php/7.1/cli/php.ini
[opcache]
opcache.enable = 1
opcache.enable_cli = 1
opcache.memory_consumption = 256
opcache.interned_strings_buffer = 16
opcache.max_accelerated_files = 12850
opcache.validate_timestamps = 1
opcache.revalidate_freq = 0
opcache.fast_shutdown = 1
我的问题是,当我 运行 一些 shell 脚本时,它将执行类似于这个 php 脚本的东西 php -r "opcache_get_status();"
这会重置一些 "global" opcache 或者这将只重置 cli opcache,你必须为 apache 实现其他东西。
如果您需要任何其他信息,请告诉我,我会提供。谢谢!
Op_cache(对于 apache)需要通过 url 或 curl 请求重置。如果你通过 cli 运行 php -r "opcache_reset();"
就不一样了,这意味着 Apache 上的 op_cache 不会被重置。我的解决方案 was/is 创建简单的虚拟主机,它正在执行用于重置 op_cache.
我的虚拟主机
<VirtualHost 127.0.0.1:80>
DocumentRoot /var/www/html/opcache
ServerName localhost
DirectoryIndex index.php
<Directory /var/www/html/opcache>
Options All
Order Deny,Allow
Deny from all
Allow from 127.0.0.1 ::1
Allow from localhost
</Directory>
</VirtualHost>
我的php脚本
<?php
opcache_reset();
然后我通过终端
用curl执行脚本curl -o -I -L -s -w "Response code %{http_code}\n" http://127.0.0.1/opcache/index.php