.magento.env.yaml changes not shown in env.php after deploy
opcache.enable_cli=1. If you don’t want to upgrade, then you would have to do the workaround steps as described below in the solution.This article provides a solution for the issue where changes in .magento.env.yaml file are not reflected in app/etc/env.php after deployment.
Affected products and versions
- Adobe Commerce on cloud infrastructure (all supported versions).
Issue
Changes made in the .magento.env.yaml file do not affect the app/etc/env.php generated.
Steps to reproduce:
Change any value in .magento.env.yaml and push to the server, where it should define the configuration (and deployment settings) for the currently checked-out environment. For steps, see Environment Variables > Deploy Variables in our developer documentation.
Expected result:
Changes made in the .magento.env.yaml file affect the app/etc/env.php generated.
Actual result:
The changes have no effect on the app/etc/env.php variables after deployment.
Cause
The issue could be caused by the incorrect value of the opcache.enable_cli parameter in the php.ini file.
Solution
- Check that the system is configured according to Adobe Commerce Performance Best Practices > Software recommendations.
- Check if
opcache.enable_clidirective inphp.iniis set to0by executing:php -i | grep opcache.enable_cli - If the output looks like
opcache.enable_cli=1, edit thephp.inifile in the project root directory and changeopcache.enable_cli=1toopcache.enable_cli=0 - Redeploy the project.