-
-
Notifications
You must be signed in to change notification settings - Fork 251
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
feat: better default for the php.ini path #553
feat: better default for the php.ini path #553
Conversation
Do you think this happens often? I just found out there is a PR about this before switching to |
It could be convenient to provide an easier way to change the path, indeed. Changing the default and adding a new option looks like the best option to me. |
@crazywhalecc great! How would you like to proceed? Change the default value in the option definition directly and add a new option to set |
TLDR: Yes (only if we use command options). Off topic: My personal preference for various inputs and variables:
If we use the same default location for macOS, Linux, and FreeBSD, then just use the command option defaults. But if there are different defaults for different systems, it may be better to use env.ini with For the |
c64eaec
to
f94d9bb
Compare
Code and docs updated. I used DeepL for the Chinese translation, it may be totally wrong! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution. I will adjust the documentation section after finish modifications.
I also found that it seems that I missed Windows support, and Windows configure does not seem to be able to modify the default config-file-path
, only config-file-scan-dir
. And Windows cli will look for php.ini in C:\Windows\
and $(cwd)
.
What does this PR do?
By default, the
php.ini
path is/lib/php.ini
. This value is "hardcoded" in PHP but can be changed with configure flags. Most (all?) Linux distributions as well as the official PHP Docker images change this default path to/usr/local/etc/php/php.ini
or/etc/php.ini
.This default value is very confusing for end users (see for instance dunglas/frankenphp#1066, it's a recurrent issue we have with FrankenPHP).
Additionally,
/lib
doesn't even exist by default on Mac, and cannot be created because because the system filesystem is read-only.This PR aligns the default path to the one used by official Docker images:
/usr/local/etc/php/php.ini
In addition, it loads all files defined in
/usr/local/etc/php/conf.d
, as the Docker images do.It can still be changed easily by end users if needed by overriding
SPC_CMD_PREFIX_PHP_CONFIGURE
.