PHP and not connecting with Composer

My PC is unable to reach certain websites like composer’s website with PHP and composer. To install composer I had to use a VPN which I dislike and therefore wanted to find the fix. I installed XAMPP on my laptop (seperate from this PC) and the installation of composer worked and no errors were shown. How can I fix this PC to work like my laptop does?

curl -vvv result:

curl -vvv https://getcomposer.org/versions
* timeout on name lookup is not supported
* Trying 2001:41d0:a:7b19::2…
* TCP_NODELAY set
* Connected to getcomposer.org (2001:41d0:a:7b19::2) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
* CAfile: C:/laragon/bin/git/mingw64/ssl/certs/ca-bundle.crt
CApath: none
* TLSv1.2 (OUT), TLS header, Certificate Status (22):
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* NPN, negotiated HTTP1.1
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Unknown (67):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
* ALPN, server did not agree to a protocol
* Server certificate:
* subject: C=DE; L=Berlin; O=Packagist Conductors UG (haftungsbeschränkt); CN=getcomposer.org
* start date: Jul 12 00:00:00 2017 GMT
* expire date: Aug 25 12:00:00 2020 GMT
* subjectAltName: host “getcomposer.org” matched cert’s “getcomposer.org”
* issuer: C=US; O=DigiCert Inc; CN=DigiCert SHA2 Secure Server CA
* SSL certificate verify ok.

GET /versions HTTP/1.1
Host: getcomposer.org
User-Agent: curl/7.53.0
Accept: /

< HTTP/1.1 200 OK < Server: nginx < Date: Tue, 25 Jul 2017 20:59:10 GMT < Content-Type: application/json < Content-Length: 317 < Last-Modified: Tue, 25 Jul 2017 20:55:08 GMT < Connection: keep-alive < ETag: "5977b02c-13d" < Accept-Ranges: bytes < { "stable": [{"path": "/download/1.4.2/composer.phar", "version": "1.4.2", "min-php": 50300}], "preview": [{"path": "/download/1.4.2/composer.phar", "version": "1.4.2", "min-php": 50300}], "snapshot": [{"path": "/composer.phar", "version": "189ba423aedc387a0487df40afc2428947406327", "min-php": 50300}] } * Connection #0 to host getcomposer.org left intact


Sometimes it connects, most of the time it doesn’t. It always works on my laptop but not on my PC.