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

support sapi options php_ini_ignore, php_ini_ignore_cwd #1391

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bashkarev
Copy link

This PR adds support for php_ini_ignore and php_ini_ignore_cwd while maintaining the current behavior.

However, I suggest changing the default value of php_ini_ignore_cwd to true, similar to how FPM handles it (reference).

This change would improve consistency with FPM and ensure that php.ini is not loaded based on the current working directory by default.

@dunglas
Copy link
Owner

dunglas commented Feb 19, 2025

Could you give us more info about your use case?

Apache+mod_php, which is more similar to FrankenPHP than FPM, seems to behave as FrankenPHP. I also find it convenient (and it was requested by users) to read a php.ini file in the current working directory. It's confusing for FPM because FPM is generally not started from the main app directory, but as FrankenPHP is a single binary starting a single process, it's quite expected.

Generally speaking, we try to keep the number of options low and to make the tool defaults the most user-friendly possible.

@bashkarev
Copy link
Author

Could you give us more info about your use case?

We are trying to use FrankenPHP as a library to integrate Go and PHP applications. Since the application may run in uncontrolled environments, we want to completely disable php.ini discovery and explicitly define the configuration at startup.

I was also working on changes to specify the ini explicitly, but I noticed that this functionality is already partially implemented in this PR.

@dunglas
Copy link
Owner

dunglas commented Feb 19, 2025

Ok that's a valid use case!
Can't you modify the global sapi_module variable in a custom extension to do that?

@bashkarev
Copy link
Author

Can't you modify the global sapi_module variable in a custom extension to do that?

That’s probably possible. But disabling php.ini discovery would also be useful for static builds.

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 this pull request may close these issues.

2 participants