You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The previous issue was not respected, so I open a new issue here.
The symptom is that getenv_docker function does not read any environment from docker-compose, thus causing the failure to connect to the database.
mkdir run
docker-compose up
docker exec -it nginx-php bash
> usermod -u 82 www-data && groupmod -g 82 www-data && nginx -s reload
> exit
echo "your_ip testwp.ok" >> /etc/hosts
import `nginx/ssl/testwp.crt `to your browser (or keychain on macOS) so that you can use https
open URL testwp.ok in your browser.
a bit of explanation
We must change the user & group in nginx container because it has to be the same with the user, and its uid & gid also has to be the same. And that's why we need to login to nginx-php container to make the changes.
In browser, you will see this symptom:
The reason is getenv_docker function in wp-config.php failed to read environment variables passed in docker-compose.yml.
You can verify this by entering php-fpm container,
As I noted in #576 (comment), if you're going to overwrite the entire php-fpm configuration, you'll need to make sure you configure it in a compatible way (namely, setting clear_env = no).
The previous issue was not respected, so I open a new issue here.
The symptom is that
getenv_docker
function does not read any environment from docker-compose, thus causing the failure to connect to the database.The symptom is repeatable, for simplicity, I uploaded my
docker-compose.yml
and related source file into a repo: https://github.com/winkee01/docker-nginx-php-fpm.After you clone it to your local directory.
Follow the below steps:
a bit of explanation
We must change the user & group in nginx container because it has to be the same with the user, and its uid & gid also has to be the same. And that's why we need to login to nginx-php container to make the changes.
In browser, you will see this symptom:
The reason is
getenv_docker
function inwp-config.php
failed to read environment variables passed in docker-compose.yml.You can verify this by entering php-fpm container,
the variables are correctly shown, but
wp-config.php
failed to read them.If you change the variables' value in
wp-config.php
to the correct ones, you will load the site successfully.The text was updated successfully, but these errors were encountered: