Code Monkey home page Code Monkey logo

Comments (10)

bernhardh avatar bernhardh commented on June 8, 2024 5

You can modify the location by setting the following to your .env

XDG_CONFIG_HOME=/path/to/new/location

best regards

from nova-tinker-tool.

95jonpet avatar 95jonpet commented on June 8, 2024

The user that appache/php-fpm runs under must have the required read/write access to the mentioned file. This user is not always the same as the user that you are using to connect with. Try altering the permissions for a www-data user if one exists.

chown www-data:www-data /usr/share/httpd/.config/psysh
chmod u+w /usr/share/httpd/.config/psysh

from nova-tinker-tool.

gdpa avatar gdpa commented on June 8, 2024

There is no .config directory on the path. Why it doesn't use local laravel project directory for saving psysh file?

from nova-tinker-tool.

95jonpet avatar 95jonpet commented on June 8, 2024

That is the issue then. It tries to create a new file/directory (write permission required) in a folder where write permissions are not held.

from nova-tinker-tool.

ragingdave avatar ragingdave commented on June 8, 2024

This appears to be broken now with the release of Laravel 5.8 and phpdotenv 3. The $_ENV is populated correctly, but the old behavior of phpdotenv put the .env variables into a place where getenv() had access to them, now .env variables no longer make it there and this fix is now broken. Not sure if it's something to fix here, but I feel like I stumbled across a fairly large breaking change.

from nova-tinker-tool.

GrahamCampbell avatar GrahamCampbell commented on June 8, 2024

Instead of using getenv, use Laravel's env function. It is threadsafe, unlike PHP's getenv function.

from nova-tinker-tool.

GrahamCampbell avatar GrahamCampbell commented on June 8, 2024

NB The env function has existed since Laravel 5.4 and is the recommended way to access environment variables when needed. Finally, in Laravel 5.8, the long-standing issue of the thread-safety has been fixed. That is, if someone forgets to use cached config in production, and there are other sites running, then secrets may be leaked to the other sites. Laravel 5.8 is no longer vulnerable to this, and I'd be strongly against changing the framework defaults back to populating using putenv also.

from nova-tinker-tool.

ragingdave avatar ragingdave commented on June 8, 2024

This doesn't appear to be something that we can control as the usage is in Xdg, so I don't believe this can even be fixed since that (I would assume) is not only used in laravel apps.

Specifically https://github.com/dnoegel/php-xdg-base-dir/blob/master/src/Xdg.php Which is the failing code (aka broken) as a result of this change, and shouldn't really have to adhere to ONLY the laravel ecosystem. I love laravel, but it's not the only framework out there that might be using some sort of REPL environment. I understand the change from a security perspective, but I'm just confused as to both how to address this (I would argue) breaking change. As a result, this package basically ends up being dead in the water....and it was a REALLY useful package.

from nova-tinker-tool.

GrahamCampbell avatar GrahamCampbell commented on June 8, 2024

You can still recover the old behaviour of Laravel 5.7 if you need it, in 5.8, by using your own bootstrapper. Just define the following class in your app:

<?php namespace App\Foundation;

use Dotenv\Dotenv;
use Illuminate\Foundation\Bootstrap\LoadEnvironmentVariables as BaseLoadEnvironmentVariables;

class LoadEnvironmentVariables extends BaseLoadEnvironmentVariables
{
    /**
     * Create a Dotenv instance.
     *
     * @param  \Illuminate\Contracts\Foundation\Application  $app
     * @return \Dotenv\Dotenv
     */
    protected function createDotenv($app)
    {
        return Dotenv::create($app->environmentPath(), $app->environmentFile());
    }
}

And then in your console and http kernel files in your app, overwrite the bootstrappers property, replacing \Illuminate\Foundation\Bootstrap\LoadEnvironmentVariables::class, with \App\Foundation\LoadEnvironmentVariables::class,.

from nova-tinker-tool.

bsormagec avatar bsormagec commented on June 8, 2024

XDG_CONFIG_HOME=/tmp working on vapor @gdpa

from nova-tinker-tool.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.