craftcms / nitro

Speedy local dev environment for @craftcms.
https://getnitro.sh
MIT License
178 stars 24 forks source link

can´t disable opcache via Nitro CLI #298

Closed aloco closed 3 years ago

aloco commented 3 years ago

Description

Hi,

we experienced some issues with opcache configuration. We enabled opcache via nitro iniset and opcache_enable. We experienced issues with PHP files which were not invalidated and therefore wanted to disable opcache. After going through the configuration steps, opcache is still enabled. It seems like the container env vars are not updating correctly since PHP_OPCACHE_ENABLE is still set to 1 after disabling via the nitro CLI

  1. display_errors
  2. max_execution_time
  3. max_input_vars
  4. max_input_time
  5. max_file_upload
  6. memory_limit
  7. opcache_enable
  8. opcache_revalidate_freq
  9. post_max_size
  10. upload_max_file_size
Enter your selection: 7
Should we enable OPCache [false]? false
Apply changes now [Y/n]? Y

Steps to reproduce

  1. enable opcache via nitro iniset
  2. disable opcache via nitro iniset
  3. PHP_OPCACHE_ENABLE in container env is still 1

Additional info

macOS 11.2 Docker Desktop 3.2.1

Nitro CLI: 2.0.5 Nitro gRPC: 2.0.5 Docker API: 1.41 (1.12 min) Docker CLI: 1.41

jasonmccallister commented 3 years ago

I can confirm this and will get started on a fix for the next release.

aloco commented 3 years ago

Thanks a lot!!

Can you also confirm that PHP files in opcache are not invalidating? Do you need more information on this?

jasonmccallister commented 3 years ago

I have not checked the invalidation yet, but the docker container is not recreated when the setting is changed. To work around this now you can perform the following steps:

  1. Update the setting to disable opcache (should update the nitro.yaml)
  2. Manually remove the container (using Docker Desktop or docker container rm -f <yoursite.nitro>)
  3. Run nitro apply to recreate the container