You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PHP Fatal error: Cannot redeclare React\Promise\resolve() (previously declared in /root/.composer/vendor/react/promise/src/functions.php:5) in /app/vendor/react/promise/src/React/Promise/functions.php on line 12
PHP Fatal error: Cannot redeclare React\Promise\resolve() (previously declared in /root/.composer/vendor/react/promise/src/functions.php:5) in /app/vendor/react/promise/src/React/Promise/functions.php on line 12
[...]
We have a composer packages installed globally and per project which both depend on react/promise.
I think the composer autoloader always loads the file specified here which looks to me like the source of the error.
I don't know if composer should handle that...
You could wrap the definitions in a function_exists() call if you have to use the legacy files autoloading.
Autoloading via files isn't by any means deprecated and currently the only way to load functions. You should define your dependencies explicitely in your composer.json per project and don't rely on global packages (and I can't think of any reason why you should do that).
Autoloading via files isn't by any means deprecated and currently the only way to load functions.
Yeah, sorry. I never saw the function loading before, but I also thought that this is the only way in the end.
You should define your dependencies explicitely in your composer.json per project and don't rely on global packages (and I can't think of any reason why you should do that).
The problem is, that I have the dependency defined in a dependency - I do not have control about it.
I didn't track it down 100%, but in my case I have Codeception (testing-suite) installed globally, just because it is rather large and takes a while to install.
Other issues might come from composer plugins, which have to be installed globally. This would be related to composer/composer#3082
And guzzle had something similar guzzle/guzzle#676. They solved it with an if statement ;). But for sure it would be better to have the fix in composer.
@bhajan903 check your server logs, that error is so generic we can't do anything with it. Also please open a new ticket for if the error is ReactPHP related.
Activity
jsor commentedon Dec 2, 2014
Autoloading via
filesisn't by any means deprecated and currently the only way to load functions. You should define your dependencies explicitely in your composer.json per project and don't rely on global packages (and I can't think of any reason why you should do that).schmunk42 commentedon Dec 2, 2014
Yeah, sorry. I never saw the function loading before, but I also thought that this is the only way in the end.
The problem is, that I have the dependency defined in a dependency - I do not have control about it.
I didn't track it down 100%, but in my case I have Codeception (testing-suite) installed globally, just because it is rather large and takes a while to install.
Other issues might come from composer plugins, which have to be installed globally. This would be related to composer/composer#3082
...
There's already an issue about it in composer composer/composer#3003
And guzzle had something similar guzzle/guzzle#676. They solved it with an if statement ;). But for sure it would be better to have the fix in composer.
Conditionally require functions.php
bhajan903 commentedon Apr 9, 2020
hey ,
how solved this
"Sorry, that didn’t work.
Please try again or come back later.
500 Error. Internal Server Error."
please!
WyriHaximus commentedon Apr 18, 2020
@bhajan903 check your server logs, that error is so generic we can't do anything with it. Also please open a new ticket for if the error is ReactPHP related.