Questions tagged [phpdotenv]

PHP dotenv is a PHP library that loads environment variables from a text file named .env for easy access from PHP code. This library is based on the Ruby gem (see [ruby-dotenv] tag.) There is also a Node.js module (see [dotenv] tag.)

Loads environment variables from .env to getenv(), $_ENV and $_SERVER automagically.

Code repository: https://github.com/vlucas/phpdotenv

Packagist page: https://packagist.org/packages/vlucas/phpdotenv

83 questions
0
votes
1 answer

Desperately looking for a non empty $_ENV in Laravel

I have a console task ran through: $schedule->command('process:job') ->cron('* * * * *') ->withoutOverlapping(); The task is run, it can invoke different services, everything is fine in the world. However I have one…
AsTeR
  • 7,247
  • 14
  • 60
  • 99
0
votes
4 answers

How to override env variables in Laravel Dusk

Unfortunately config(['key' => 'newValue']) doesn't work in a Dusk setup (for overriding a config value), presumably because it would change the config of the system running the test rather than the experience of the headless browser that gets…
Ryan
  • 22,332
  • 31
  • 176
  • 357
0
votes
2 answers

PHPDoc references a dotenv entry

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 - access url for api */ public function…
Danilo Kobold
  • 2,562
  • 1
  • 21
  • 31
0
votes
2 answers

Class 'Dotenv\\Environment\\Adapter\\PutenvAdapter' not found

I have an Ubuntu installation on WSL. Everything was ok the last time I used it to develop the same website. Today I started apache2 and mysql as always but the website is not working. The two lines in apache log file are: PHP Warning: include():…
Fabio Sasso
  • 145
  • 1
  • 12
0
votes
1 answer

Cannot access dotenv variables from Symfony service

Using: "php": "^7.1.3", "ext-ctype": "*", "ext-iconv": "*", "doctrine/doctrine-bundle": "^1.11", "doctrine/doctrine-fixtures-bundle": "^3.1", "doctrine/doctrine-migrations-bundle": "^2.0", …
user10560159
0
votes
0 answers

After using docker-compose to build a dev copy of a server/website from a YML, I am getting fatal PHP errors related to dotenv?

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. Proceeding to run docker-compose up, both the website…
GDV
  • 3
  • 2
0
votes
0 answers

dotenv values are not read right

I'm wanting to put a secret pass_phrase value (0000) into .env.dev.local file (for lexik_jwt_authentication), but the authentication wasn't working. If I put the value directly into the file config/packages/lexik_jwt_authentication.yaml,…
smarber
  • 4,829
  • 7
  • 37
  • 78
0
votes
3 answers

laravel 5.8 returning false on getenv

I have updated application to Laravel latest version 5.8 and after update the getenv() function which returns env file variable value is returning false. However when i used env() I am able to get the env variable value. I have followed the…
Puneet Kushwah
  • 1,495
  • 2
  • 17
  • 35
0
votes
1 answer

How to put the private key contents in dotenv .env file for lumen app?

I want to work with SFTP server in my lumen app and therefore i need to store the private key to access the SFTP server in the .env file (dotenv) I tried this approach: SFTP_PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----\nHkVN9…\n-----END DSA PRIVATE…
Latheesan
  • 23,247
  • 32
  • 107
  • 201
0
votes
1 answer

Laravel: Update .env file by publishing a third-party package

I have a library which I want to wrap into Laravel package. My library uses two configs: the public config.php for some nonsensitive settings and .env private config for sensitive credentials. I'd like to vendor:publish my configs for end user. And…
Gino Pane
  • 4,740
  • 5
  • 31
  • 46
0
votes
2 answers

Can I set startRow to different values for different sheets using Maatwebsite's Laravel-Excel?

I'm using Maatwebsite's Laravel-Excel to import an Excel file with two sheets. This file is generated by another system; I can't change the way it is produced. On the first sheet, the first row is the column headings. This works fine. ...but the…
Brendan White
  • 435
  • 2
  • 8
  • 17
0
votes
1 answer

Laravel 5 multiple bootstrap/cache/config.php files

Let's say i have one codebase for 500+ clients, based on load balanced web-servers. Each client has their own database, and therefor their own set of credentials. The easy way here would be to have different .env files with each of the clients…
Jonas m
  • 2,646
  • 3
  • 22
  • 43
0
votes
1 answer

How to use dotenv variables into a class?

I just start learning PHP few days ago so forgive me if this question is a newbie one. What is wrong with my declaration of CRAWLER_URI ? The env() isn't working outside a method and I don't know why. namespace App\Http\Controllers; use…
TimothePearce
  • 1,128
  • 1
  • 11
  • 22
0
votes
1 answer

Laravel 5.1 not using correct .env values

I'm using Laravel 5.1.44, and even though I have both a .env.testing file setup with different values, as well as App::environment() returning 'testing', Laravel still seems to only be using values from the main .env file. Is there something else I…
0
votes
0 answers

.env data is not readable with config() function, nor \Config facade

I have a Laravel 5 application that works perfectly on multiple servers. But on a specific Server, the values of my .env file are not readable via the \Config facade, or the config() function. Let me give an example with the APP_DEBUG environment…
Stefan S
  • 650
  • 2
  • 10
  • 23