运行 Composer 提示:exceeded the timeout of 300 seconds,一般是由于下载太慢导致的,解决办法如下:

1、查看默认超时时间

composer config --list

2、设置超时时间

composer config -p process-timeout 600

3、清除缓存

composer clear-cache

如果上述修改后仍然报错,那么修改 composer 镜像源为国内(如阿里云)即可:

composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/