90 questions
0
votes
1
answer
17
views
AWS ECS Docker automatic environment variables injections
I will share my experience about a crazy problem on one application that I manage, that is a Laravel application publish on AWS ECS, that need to use a shared redis to store sessions and developers ...
0
votes
0
answers
38
views
.env is being hashed? [duplicate]
I am resolving .env like this.
$dotenv = new Dotenv();
$dotenv->load(__DIR__ . '/../.env');
$_ENV seems to be loaded as expcted, when I dumping it. However getenv('') just returns false for any of ...
0
votes
1
answer
142
views
Polyfill warning from Google; PHPMailer and PHP dotenv affected [closed]
I got a warning from Google saying that my website is using Polyfill framework on Google Maps: "Notification Title: [Security Alert]: Polyfill.io Issue for Google Maps Platform users". It ...
1
vote
1
answer
616
views
PHP is not reading .env file
I am using PHP with PDO to connect to my database.
I want to start using environment variables, so I used the following terminal command:
composer require vlucas/phpdotenv
My .env file now contains ...
-1
votes
2
answers
700
views
Laravel 10 - Getting the env returns the entire .env file [closed]
I have tried a few different ways to do this, but if I do env("APP_ENV") I get the entires contents of the env file instead of the APP_ENV value
I know this is bad practice but I also get ...
1
vote
2
answers
183
views
Symfony framework.lock with .env set-up
Problem
I need to set up Symfony framework.yaml parameter framework.lock with 2+ memcached servers using .env. But when I try to do so, it does not recognize 2 servers, but only one, and with a glitch....
1
vote
1
answer
145
views
Bash: what delimiter to use for this string to array conversion to work? (Laravel/dotenv/Sail/Docker Compose)
Laravel Sail should support multiple docker-compose files by configuring them in a dotenv file (.env).
The line in my .env file...
SAIL_FILES='docker-compose.yml:docker-compose-arm.yml'
The part of ...
-1
votes
1
answer
147
views
how to properly load libraries in php? [duplicate]
I'm working with two libraries:
phpdotenv
spatie/async
This is what I'm executing:
<?php
require_once "/var/local/entrop/vendor/autoload.php";
include_once '/var/local/entrop/inc/...
-1
votes
1
answer
205
views
Heroku Symfony app Unable to read the "/tmp/build_2f06b5cf/.env" environment file
After updating composer to v1 to v2, my build on heroku is failing, error message :
Executing script cache:clear [KO]
[KO]
Script cache:clear returned with error code 255
!! PHP ...
0
votes
0
answers
826
views
load environment variables to the global scope
I am currently using vlucas/phpdotenv to load environment variables in my pure php application. I installed the package with composer then loaded it in the index page like:
//Load Composer's auto ...
-1
votes
1
answer
2k
views
How to limit a package's dependency to a certain PHP version in Composer? [duplicate]
Our production server is PHP 5.5.24. A package I need (vlucas/dotenv) requires in its composer.json:
"symfony/polyfill-ctype": "^1.17"
Unfortunately version 1.20 of that symfony ...
-1
votes
2
answers
4k
views
Symfony 5.3 Mailer setup env vars not reading correctly
In a Symfony 5.3 project I am using the Mailer (..\Symfony\Component\Mailer\MailerInterface) to send mails.
For devolopment I required "symfony/google-mailer" with composer and set it up in ....
2
votes
2
answers
3k
views
PHP cannot get the environment variables
I have some environment variables as bash variable and other environment variables into a .env file.
In my php script I load env variable using this
require __DIR__.'/vendor/autoload.php';
use Dotenv\...
1
vote
0
answers
902
views
Undefined type 'Dotenv\Dotenv\Dotenv'
Is this the way to use a package installed from composer?
<?php
use Dotenv\Dotenv;
require_once __DIR__ . '/../../../vendor/autoload.php';
$dotenv = Dotenv\Dotenv::createImmutable(dirname(...
5
votes
1
answer
7k
views
How to use phpdotenv library on my whole project?
I started a project using composer and donlowaded the package vlucas/phpdotenv. I would like to call the $_ENV['name'] for example in my whole project without needing to instantiate the dot env in ...