Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@fabpot
Copy link
Contributor

@fabpot fabpot commented Sep 2, 2020

No description provided.

Copy link
Contributor

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beware, I think the name changed from 4.4 to 5.1

@fabpot fabpot force-pushed the php-ini-preloading branch from e39d025 to e8573bf Compare September 2, 2020 15:14
@fabpot
Copy link
Contributor Author

fabpot commented Sep 2, 2020

@nicolas-grekas fixed

@OskarStark
Copy link
Contributor

@localheinz we should add this to our php.ini, too 👌🏻

@fabpot fabpot merged commit 2d316dc into master Sep 2, 2020
@fabpot fabpot deleted the php-ini-preloading branch September 2, 2020 16:50
OskarStark added a commit to sonata-project/dev-kit that referenced this pull request Sep 3, 2020
This PR

* [x] adds an `opcache.preloading` configuration

Follows symfonycorp/cloud-templates#15.
OskarStark added a commit to sonata-project/dev-kit that referenced this pull request Sep 3, 2020
This PR

* [x] adds an `opcache.preloading` configuration

Follows symfonycorp/cloud-templates#15.
@OskarStark
Copy link
Contributor

OskarStark commented Sep 4, 2020

@fabpot it looks like this does not work on SfCloud in combination with symfony env:debug 🤔

Afterwards my logs are showing:

[app] [04-Sep-2020 06:24:13 UTC] PHP Warning:  PHP Startup: failed to open stream: No such file or directory in Unknown on line 0
[app] [04-Sep-2020 06:24:13 UTC] PHP Fatal error:  PHP Startup: Failed opening required '/app/var/cache/prod/srcApp_KernelProdContainer.preload.php' (include_path='.:') in Unknown on line 0
[app] [04-Sep-2020 06:24:14 UTC] PHP Warning:  PHP Startup: failed to open stream: No such file or directory in Unknown on line 0
[app] [04-Sep-2020 06:24:14 UTC] PHP Fatal error:  PHP Startup: Failed opening required '/app/var/cache/prod/srcApp_KernelProdContainer.preload.php' (include_path='.:') in Unknown on line 0
[app] [04-Sep-2020 06:24:15 UTC] PHP Warning:  PHP Startup: failed to open stream: No such file or directory in Unknown on line 0
[app] [04-Sep-2020 06:24:15 UTC] PHP Fatal error:  PHP Startup: Failed opening required '/app/var/cache/prod/srcApp_KernelProdContainer.preload.php' (include_path='.:') in Unknown on line 0
[app] [04-Sep-2020 06:24:16 UTC] PHP Warning:  PHP Startup: failed to open stream: No such file or directory in Unknown on line 0
[app] [04-Sep-2020 06:24:16 UTC] PHP Fatal error:  PHP Startup: Failed opening required '/app/var/cache/prod/srcApp_KernelProdContainer.preload.php' (include_path='.:') in Unknown on line 0
[app] [04-Sep-2020 06:24:17 UTC] PHP Warning:  PHP Startup: failed to open stream: No such file or directory in Unknown on line 0
[app] [04-Sep-2020 06:24:17 UTC] PHP Fatal error:  PHP Startup: Failed opening required '/app/var/cache/prod/srcApp_KernelProdContainer.preload.php' (include_path='.:') in Unknown on line 0

Which is correct, it is not in var/cache/prod, but in var/cache/dev. Is it somehow possible (in FPM) to provide two paths and try the second if the first is not available?

Another option would be todo some "magic" on SfCloud side and replace prod by dev or depend on an env var in the config? 🤔 Not sure this would work.

cc @localheinz

@OskarStark
Copy link
Contributor

We had to remove the setting, we had some strange side effects:
Bildschirmfoto 2020-09-04 um 08 35 53

and it looks like FPM died:
Bildschirmfoto 2020-09-04 um 08 36 37

If you need some help to investigate, we can provide a "failing environment"

@nicolas-grekas
Copy link
Contributor

That's for bugs.php.net...

@nicolas-grekas
Copy link
Contributor

About the warnings in your first screenshot @OskarStark, you should investigate them, that's possibly on your side to fix.

@OskarStark
Copy link
Contributor

Will do, thanks

fabpot added a commit to symfony/symfony that referenced this pull request Sep 7, 2020
…ache.preload predictable (nicolas-grekas)

This PR was merged into the 4.4 branch.

Discussion
----------

[FrameworkBundle] generate preload.php in src/ to make opcache.preload predictable

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

As seen in symfonycorp/cloud-templates#15, having the path of the preload file vary by env+debug makes configuring PHP.ini settings impossible.

This PR dump a new `preload.php` file in `src/` when `cache:clear` is called.
This makes the path predictable.

This is submitted as a bugfix because the current behavior is barely usable without this change.

Commits
-------

54c965c [FrameworkBundle] generate preload.php in src/ to make opcache.preload predictable
symfony-splitter pushed a commit to symfony/framework-bundle that referenced this pull request Sep 7, 2020
…ache.preload predictable (nicolas-grekas)

This PR was merged into the 4.4 branch.

Discussion
----------

[FrameworkBundle] generate preload.php in src/ to make opcache.preload predictable

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

As seen in symfonycorp/cloud-templates#15, having the path of the preload file vary by env+debug makes configuring PHP.ini settings impossible.

This PR dump a new `preload.php` file in `src/` when `cache:clear` is called.
This makes the path predictable.

This is submitted as a bugfix because the current behavior is barely usable without this change.

Commits
-------

54c965c7d0 [FrameworkBundle] generate preload.php in src/ to make opcache.preload predictable
@fabpot
Copy link
Contributor Author

fabpot commented Sep 7, 2020

See 1656fdb for an update of the default values.

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.

4 participants