Issue Description
I am using a library to extract data from a ZKT attendance machine. The package works correctly on my local environment, but when I deployed it to my cPanel, it is not functioning as expected.
I am encountering the following error:
cURL error 28: Connection timed out after 10001 milliseconds (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for http://192.168.100.88/jwt-api-token-auth/
public function getTokenFromApi()
{
$url = "http://192.168.100.88:80/jwt-api-token-auth/";
$username = $this->getUsername();
$password = $this->getPassword();
$data = [
'username' => $username,
'password' => $password,
];
try {
$response = Http::withHeaders([
'Content-Type' => 'application/json',
])->post($url, $data)->json();
return $response['token'] ?? null;
} catch (\Exception $e) {
\Log::error('API Request Error: ' . $e->getMessage());
throw $e;
}
}
Problem Analysis
The error message indicates that the request to http://192.168.100.88/jwt-api-token-auth/ is timing out after 10 seconds. This suggests that the cPanel environment is unable to establish a connection to the specified IP address.