Well, according to the stack trace you posted it actually does.
So illuminate/support
has a PHP file helpers.php
that actually tries to use the class Dotenv\Environment\DotenvFactory
.
When you go one level down the stacktrace you see that roots/acorn
( 2.0.6
) broadcasting.php
called the part from helpers.php
:
And indeed, roots/acorn
2.0.6
has illuminate/support
version range ^8.70
as dependency:
https://github.com/roots/acorn/blob/b6eeae53bcac7d321b06b9fb4316c67240e8b48b/composer.json#L52
illuminate/support
on packagist.org: https://packagist.org/packages/illuminate/support#v8.70.1
illuminate/support
v8.70.1
on GitHub:
https://github.com/illuminate/support/tree/v8.70.1
illuminate/support
v8.70.1
helpers.php
:
https://github.com/illuminate/support/blob/88939afba5b60d6bd53084ee0bd06c5e2534501f/helpers.php
And that’s strange: In the error line 646
is mentioned at where the non-existing Dotenv\Environment\DotenvFactory
class is attempted to be used,
because the helpers.php
of illuminate/support
version v8.70.1
only has a total of 377
lines.
illuminate/support
doesn’t require vlucas/phpdotenv
but at least suggests
that package within version range ^5.4.1
:
https://github.com/illuminate/support/blob/3c1ab546c7de1f3176060b1d4d28feb100d0a37b/composer.json#L50
And the only version of illuminate/support
I found that has at least 646
lines is v5.8.36
:
https://github.com/illuminate/support/blob/df4af6a32908f1d89d74348624b57e3233eea247/helpers.php
So one version of illuminate/support
is required (8.70.1
), but another one is used (5.8.36
or similar in 5.8.x
).
Very similar discussion here:
https://discourse.roots.io/t/php-fatal-error-dotenv-not-found-cannot-use-wp-cli-because-of-it-any-ideas/18844/2