启用 PHP7 Opcache

2022-01-13 00:00:00 centos php wordpress opcache

我最近升级到 PHP 7.

I recently upgraded to PHP 7.

我把它放在/etc/php.d/opcache.ini

I placed this in /etc/php.d/opcache.ini

opcache.file_cache = /var/www/html/.opcache
opcache.file_cache_only = 1

并创建目录(以 root 身份)

and created the directory (as root)

当我访问该站点时,.opcache 文件夹中没有创建任何内容

When I visit the site there is nothing created in the .opcache folder

a phpinfo(); 反映了我在 opcache.ini 中所做的更改

a phpinfo(); reflects the changes I made in opcache.ini

如何让 PHP 7 Opcache 与 WordPress 一起以最佳性能运行?

How can I get PHP 7 Opcache working at optimal performance with WordPress?

更新问题是女巫文件夹权限.'确定 Apache 可以写入它.

update The problem was witch folder permissions. 'Ale sure the Apache can write to it.

它的最佳设置是什么?安全和速度明智?

What are the optimal settings for it? Security and speed wise?

推荐答案

我通过确保 apache 写入我创建的文件夹来解决这个问题.一旦完成,重新启动 httpd 就可以了.

I fixed this by making sure apache get write to the folders I created. Once that was done restarting httpd made it work.

相关文章