Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating env files on openai:install #120

Open
ralphschindler opened this issue Oct 2, 2024 · 2 comments · May be fixed by #135
Open

Updating env files on openai:install #120

ralphschindler opened this issue Oct 2, 2024 · 2 comments · May be fixed by #135

Comments

@ralphschindler
Copy link

This is more of a DX problem.

By the time I went to install openai, I had already renamed my .env to .env.local, additionally .env.example is already gone too.

Both of these situations lead to exceptions during openai:install:

file_get_contents(/app/.env): Failed to open stream: No such file or directory

file_get_contents(/app/.env.example): Failed to open stream: No such file or directory
@professorval
Copy link

Aren't you supposed to have an .env file before installing?

@ralphschindler
Copy link
Author

If you are using Laravel in a docker environment, it is advisable to rename .env to .env.local to avoid docker (compose) using the file to inject/interpolate those variables at container startup time.

Laravel supports environment specific files via .env.{environment-name}.

https://laravel.com/docs/11.x/configuration#additional-environment-files

evosite-ltd added a commit to evosite-ltd/openai-php-laravel that referenced this issue Feb 6, 2025
It's common to use env.{environment-name} and when that's the case, the installer throws exceptions which this resolves.

Fixes openai-php#120
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants
@ralphschindler @professorval and others