Skip to main content
Filter by
Sorted by
Tagged with
1 vote
1 answer
83 views

I am trying to set a custom directory for the .env file in Laravel 11. I've seen various solutions and it half working, but not loading the right env file in the controller. app.php: use Illuminate\...
samiles's user avatar
  • 3,932
0 votes
0 answers
39 views

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 ...
lenchester's user avatar
2 votes
1 answer
832 views

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 ...
John Beasley's user avatar
  • 3,099
1 vote
2 answers
221 views

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....
Yury A.'s user avatar
  • 13
-1 votes
1 answer
209 views

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 ...
Dezz H's user avatar
  • 462
-1 votes
1 answer
2k views

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 ...
Vael Victus's user avatar
  • 4,182
2 votes
2 answers
3k views

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\...
Vito Lipari's user avatar
5 votes
1 answer
7k views

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 ...
Raul Perez Tosa's user avatar
0 votes
1 answer
1k views

In my test cases, I try to change some of the environment variables to create better test case coverage. Laravel by default, only support get environment variable by env($key, $default = null), I ...
Zac's user avatar
  • 1,072
1 vote
1 answer
620 views

I have this console command code: class MyCommand extends Command { protected $signature = 'custom:mycommand {domain}'; // ... public function handle() { $domain = $this->...
netdjw's user avatar
  • 6,101
0 votes
2 answers
5k views

So I am using vlucas/phpdotenv in my php application to store and use environment variables. I have created a db.php file which contains the configuration of my database connection. The folder ...
MajesticOverlord's user avatar
-1 votes
3 answers
2k views

Im new to this, and have been trying for a few hours to get this to work. I have a project with this structure: /API -.env /Processor -index.php The contents of my .env file is this: ...
Dirty Bird Design's user avatar
0 votes
0 answers
436 views

I'm having a problem setting up phpdotenv in my PHP project. Notice: Undefined index: APP_NAME in /media/undefined/work/Php/miniframework/bootstrap/app.php on line 17 My folder structure miniframework ...
Ittisafur's user avatar
2 votes
1 answer
8k views

I'm new to slim framework. I'd try to add .env file in root folder project and then I want to access the value inside .env file. I've tried use this package https://github.com/vlucas/phpdotenv and ...
Alkana's user avatar
  • 53
2 votes
0 answers
2k views

After installing Postfix on my Ubuntu server and getting my Symfony application running, I'm attempting to have the system send emails via Postfix. I tested it out in the terminal to make sure that it ...
UXerUIer's user avatar
  • 2,344
8 votes
1 answer
7k views

I am using Laravel 6.x for client's project wherein I have built an API in the Artisan Command for syncing data. Now client wants the configuration to be discreet, out of main source code and without ...
Vicky Dev's user avatar
  • 2,243
1 vote
3 answers
5k views

I need help with this error in the screenshot below I am using PHP 7.2 and a 3rd party composer - "composer require vlucas/phpdotenv" v4.1.4. I define the base path but there is an error in the ...
Emmanuel Oga's user avatar
6 votes
1 answer
4k views

I want to have dynamic seeders based on my environment. (eg in testing I want so only seed 100 rows, whereas local it would be 10'000). I've created seeder.php in the config, which is calling values ...
n8udd's user avatar
  • 741
0 votes
1 answer
258 views

I have a console task ran through: $schedule->command('process:job') ->cron('* * * * *') ->withoutOverlapping(); The task is run, it can invoke different services, ...
AsTeR's user avatar
  • 7,591
0 votes
2 answers
73 views

How should i reference on a PHPdoc block that if the variable is not present it will check a dotenv setting for it? /** * Class constructor. * * Created Class Object. * * @param null $url -...
Danilo Kobold's user avatar
3 votes
4 answers
22k views

How to use dotenv variables set in the Docker file, passed to a Php application? Recently tried to use a ".env" file with a set of key paired values to use across different configuration files, but ...
punkbit's user avatar
  • 7,737
2 votes
1 answer
8k views

I have a small console command where I'd like to read some environment variables, but it does not seem to read the vars from the .env file or the server configs in the console (php file works) The ...
PrimuS's user avatar
  • 2,711
3 votes
1 answer
12k views

I have a simple Symfony project, using "symfony/dotenv": "4.3.*", in the composer.json and trying to read in the value of an environment variable. This is my command: var_dump($_ENV['MY_NEW_VAR']); ...
Manse's user avatar
  • 38.1k
0 votes
0 answers
163 views

I was given a docker-compose.yml file from the agency that created our website in order to build a local dev copy of our existing website now that I've taken over managing our Wordpress e-com. ...
GDV's user avatar
  • 3
1 vote
2 answers
3k views

In my .env file I have two variables App_id: 12345 App_secret: abc123 But I'm wondering if there's a way so that if user userNo2 logs in then it would instead use App_id: 45678 App_secret: abc456 Is ...
Geoff_S's user avatar
  • 5,125