2019-07-28 23:19
浏览 320

如何在opcache中启用优化(在官方的php-fpm docker镜像中)

The container is built from a trivial Dockerfile:

FROM php:7.2.19-fpm

RUN docker-php-ext-configure opcache --enable-opcache \
    && docker-php-ext-install opcache

I did not change php.ini, so all the settings are default.

What's unexpected is that now phpinfo shows (the excerpt):

Opcode Caching  Up and Running
Optimization    Disabled
SHM Cache   Enabled
File Cache  Disabled

opcache.enable  On  On
opcache.optimization_level  0   0x7FFFBFFF

The question: what else do I need to do to have optimisations enabled?

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • duanfangbunao36970
    duanfangbunao36970 2019-07-28 23:32

    Well, my apologies, I over-simplified the question to a degree when it's impossible to answer it. I'm really sorry for that.

    The real reason it's not enabled is because xdebug is installed and enabled as well.

    点赞 评论