CURL error 28 while downloading Connection timed out after 10000 milliseconds

34.2k Views Asked by At

I'm trying to install Yajra, a Laravel package to handle server-side works of DataTables jQuery Plugin via AJAX option. But I got this problem and I can't fix this. Please do you have anything to help me?

[Composer\Downloader\TransportException] curl error 28 while downloading https://repo.packagist.org/packages.json: Connection timed out after 10000 milliseconds

4

There are 4 best solutions below

3
HamzaKhalid273 On

I remember i run this command

composer install --ignore-platform-reqs

then CURL error 28 while downloading was resolved.

2
dnpg On

In my case, the issue happened when I was hotspotting, once I moved to a Wifi network it worked.

0
Sotmir Laci On

My solution to this error, when I was trying to build a Laravel app with docker, was to change the MTU on the network configuration of the docker container. This depends on the MTU configuration that the host has, in our case was 1400. We had to apply this configuration for the network on the docker-compose.yaml file:

networks:
  my-net:
    driver: bridge
    driver_opts:
      com.docker.network.driver.mtu: 1400

As suggested in this article: Docker MTU Configuration

And then applied this network to all images in the file like this:

MySQL:
  image: mariadb:10.11
  networks:
    - my-net
1
waziriDev On

The problem might be caused by DNS issue, try To Flush the DNS Cache by running this command ipconfig /flushdns if you are using Windows.