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
- Magento Commerce Cloud, 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, refer to Magento DevDocs Environment Variables > Deploy Variables.
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 Magento Performance Best Practices > Software recommendations.
- Check if
opcache.enable_cli
directive inphp.ini
is set to0
by executing:php -i | grep opcache.enable_cli
- If the output looks like
opcache.enable_cli=1
, edit thephp.ini
file in the project root directory and changeopcache.enable_cli=1
toopcache.enable_cli=0
- Redeploy the project.