$kite->getProfile() works fine on localhost, there is no issue. but on live server this function not work. try { $kite = new KiteConnect($api_key); $kite->setAccessToken($token); $kite->getProfile(); } catch (Exception $e) { echo "Authentication failed: " . $e->getMessage(); header("location: token.php"); throw $e; }