首先查看一下服务器的composer版本
composer -V
Composer version 1.10.22 2021-04-27 13:10:45
为了保证兼容性,暂时不能将composer 的版本升级至2.x
但是可以通过 yum 安装一下
yum install composer
然后切换用户,并进入项目目录,拉取最新的代码,然后执行
composer install --ignore-platform-reqs
执行命令:composer install --ignore-platform-reqs
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Package operations: 1 install, 0 updates, 0 removals
- Installing getuilaboratory/getui-pushapi-php-client (dev-master ba1b525): Downloading (100%)
Package fzaninotto/faker is abandoned, you should avoid using it. No replacement was suggested.
Package phpunit/php-token-stream is abandoned, you should avoid using it. No replacement was suggested.
Generating optimized autoload files
Warning: Ambiguous class resolution, "GTConfig" was found 2x: in "/home/program/vendor/getuilaboratory/getui-pushapi-php-client/igetui/utils/GTConfig.php" and "/home/program/vendor/getuilaboratory/getui-pushapi-php-client-v2/utils/GTConfig.php", the first will be used.
此时需要删除v1版本,仅保留v2版本,就可以解决“"GTConfig" was found 2x”的错误
[www@server program]$ rm -rf vendor/getuilaboratory/getui-pushapi-php-client
[www@server program]$ cd vendor/getuilaboratory/
[www@server getuilaboratory]$ ll
total 4
drwxrwxr-x 6 www www 4096 Mar 21 16:32 getui-pushapi-php-client-v2
#再次回到项目根目录
[www@server getuilaboratory]$ cd ../../
[www@server program]$ composer dump-autoload
Generating optimized autoload files
Generated optimized autoload files containing 5707 classes
好的,到这里问题就解决了