Recently, there was an issue with a curl command that ran a script with php. The curl command would finish after a lengthy time as before it was completing within seconds.
The issue turned out to be that the command was using the IPV6 connection where in the data center the IPV6 was not active.
This was discovered with the -v option in curl.
curl -v "https://domain.com/path-to-php-script.php" /* About to connect() to domain.com port 443 (#0) /* Trying 2a09:2980:f0ee:a:fabe:b50c:0:2... /* Connection timed out /* Trying 126.96.36.1998...
As you can see – the IPV6 address times out. The solution is to disable IPV6 in the network setting for the Ethernet card.