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

Skip to content

Conversation

akyrey
Copy link
Contributor

@akyrey akyrey commented Sep 4, 2025

Related to #56922 PHP_CLI_SERVER_WORKERS environment variable did not work correctly in laravel sail due to phpServerWorkers being set to false instead of the set number.
In normal environment the logic is preserved, since LARAVEL_SAIL environment variable wouldn't be set

PHP_CLI_SERVER_WORKERS environment variable did not work correctly
in laravel sail due to phpServerWorkers being set to false instead
of the set number
@taylorotwell taylorotwell merged commit aa1ee57 into laravel:12.x Sep 4, 2025
65 checks passed
@akyrey akyrey deleted the fix-laravel-sail-issue-with-php-workers branch September 4, 2025 21:17
return $workers > 1 && ! $this->option('no-reload') ? false : $workers;
if ($workers > 1 &&
! $this->option('no-reload') &&
! (int) env('LARAVEL_SAIL', 0)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Question

I'm not a Sail user, but should we use env() here, or would it be better to rely on config() instead?

See

https://github.com/laravel/docs/blob/27d9c9328e1514dc109f89fa903d9a0f9912bc41/configuration.md?plain=1#L249

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I used env here for two reasons:

  • it was used a couple lines before to retrieve workers configuration
  • since this command is used to start the server, it wouldn't really matter over config

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.

3 participants