-
Notifications
You must be signed in to change notification settings - Fork 324
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
How are the MySQL sockets getting read by PHP? #1494
Comments
It sounds like environment variables are not getting passed through. Is there a difference if ran with PHP's Is there a possibility that |
No that didn't help.
It's legacy code which we would rather not touch. |
I don't use php, but this is a totally reasonable solution. I imagine the only reason this wasn't done in the first place was to make the env var the single "source of truth" for the port. @shyim, do you have any ideas/thoughts on this? |
you could inline the env var in the ini if it's not changing 🤔, but yea |
I think there is a bit of a misunderstanding here. However I discovered that in devenv PHP is already configured in a way that it should get the values from the environment variable Edit: This isn't a problem either, I'm just trying to understand how things are working together. |
I see that there is a reference to the environment variables but when I look at the generated ini file the actual lines don't contain a value.
https://github.com/cachix/devenv/blob/main/src/modules/languages/php.nix#L323-L325
We the mysql service enabled and running.
We recently had a case where a child PHP process wasn't able to access the database.
It was called within PHP like this
exec("php ./somefile.php")
but the code insomefile.php
wasn't able to access the database until we set the following in theini
section of devenv.So I was a bit surprised to discover that the variables are already present in the devenv code.
One thing I noticed is that the parent PHP process is able to access the DB without a problem, only the child doesn't see the env variables.
The text was updated successfully, but these errors were encountered: