good night, I’m hosting a wordpress site using ECS FARGATE and I need to define database variables (rds) within my WP-CONFIG.PHP file, I’m a beginner and I’m having a lot of difficulty
What have you tried? What exactly have you set up? What is working, and did you use it without Docker? Many more details will increase your chances for help.
hello dear, good afternoon. so far I created the dockerfile (see the attachment) configuring the variables of my RDS database. I also have my wordpress files that are inside an AWS EFS file system. What I would like to do is make my wordpress php use these variables
I think Arjan asked the right question which you did not answer
but your code shows that you did not try it without Docker because it would not work that way either. Take a look at the PHP documentation
If you want to use environment variables in PHP then you need to search for “PHP environment variables” to find an other part of the PHP documentation:
And see the recommended See also section to find
So you either use
If you want to use PHP-FPM later, you will also want to read the documentation of the PHP configuration:
Clear environment in FPM workers. Prevents arbitrary environment variables from reaching FPM worker processes by clearing the environment in workers before env vars specified in this pool configuration are added. Default value: Yes.