Recently, when deploying a server environment, I encountered a Issues caused by backward incompatibility of Composer version are recorded.
Problem description
The background Api application is developed using the multi-application mode of ThinkPHP6.0
. When initially deployed, it always prompts that it cannot be found. to the controller.
I was quite depressed at the time, why couldn’t I find the controller? This exception usually only occurs when the multi-application mode is not turned on, but the multi-application mode is obviously turned on and the relevant extensions are installed (Composer 2.0.x does not directly throw an exception when executing composer install).
Just when I was puzzled, I accidentally saw that the version of Composer I am currently using is 2.0.x
.
I went back and compared it with my local version: 1.8
. After searching Google, I discovered that the Composer 2.0 series was only recently released, so I immediately thought whether it was caused by Composer’s backward incompatibility.
Hey guys, it’s really a problem caused by compatibility:
Solution
Since it’s a version Compatibility problems caused by excessively high values can be easily solved, just lower the version.
Composer downgrading is very simple. There is no need to recompile and install. Just use the following command:
composer self-update 1.8.0
If you don’t know which versions are available, you can check the official release history.