-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Add FrankenPHP Configuration Instructions #9932
base: 11.x
Are you sure you want to change the base?
Add FrankenPHP Configuration Instructions #9932
Conversation
This really should be added to the docs. @olliescase and I searched hours to find a solution to increase frankenphp's memory limit |
octane.md
Outdated
<a name="frankenphp-configuration"></a> | ||
## Configuring FrankenPHP | ||
|
||
When using FrankenPHP with Laravel, note that the default system `php.ini` does not apply to the FrankenPHP worker environment. To configure PHP settings, create a `php.ini` file in your project's root directory: |
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.
This is not exact. The system default is taken into account, but FrankenPHP uses the default system path (hardcoded in the PHP source code) which is /lib/php.ini
. Most distributions change this default path to /etc
, hence the confusion.
If you use the static binary (default with Octane), you can use /lib/php.ini
or the root directory of the project. If you use the Docker image, you should use $PHP_INI_DIR
. If you compile PHP by yourself, you can specify the path you want by passing --with-config-file-path
option to ./configure
.
This is documented here: https://frankenphp.dev/docs/config/
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 @dunglas, I've rewritten to hopefully be a little more precise on this matter. Are you able to take a look and check if you think it covers it?
Co-authored-by: Kévin Dunglas <[email protected]>
I feel like this maybe doesn't belong in our documentation? |
Sorry, been a pretty intense week. I disagree that this doesn't belong in the Laravel docs, because Laravel is explicitly supporting FrankenPHP. At the very least I think this should come down to a mention in the documentation. This is a vital piece of knowledge that everyone using Laravel with FrankenPHP should know (and beyond - be warned of). I understand that its fairly logical to assume that the installed PHP's configuration won't apply to the standalone binary of FrankenPHP, but this is a facet that people making the switch won't necessarily realise the implications of. Switching from Swoole to FrankenPHP is made out in the Laravel documentation to be as simple as doing the This can cause some serious problems that are often not visible in dev/testing and only come to fruition in production when you deal with a more intensive load |
For the record, we're working with the PHP Cli team to improve the default experience: crazywhalecc/static-php-cli#553 Once this PR is merged, maybe a simple note hinting that another |
Yeah, I think that would be good - this is perhaps a little verbose for the Larvel documentation - I can agree on that. But a small note. Maybe an additional flag to the install command to be A template along the lines of: # Place your project-specific FrankenPHP ini variables here. Server-level configuration can be done in /usr/local/etc/php/php.ini
# For more information, see https://frankenphp.dev/docs/config/ (haven't invested much time towards an elegant wording) I think this could make the process more elegant and also serve as an extra tidbit of in-code documentation to point people in the right direction. |
This PR adds a new section to the Octane documentation explaining how to configure PHP settings for FrankenPHP. It instructs users to create a php.ini file in the project root to override system-wide PHP settings.