# PHP Fatal error: Uncaught Exception: Failed connect to api.zoom.us:443; Connection timed out

**URL:** <https://devforum.zoom.us/t/php-fatal-error-uncaught-exception-failed-connect-to-api-zoom-us-443-connection-timed-out/38233>\
**Category:** API and Webhooks\
**Created:** [December 12, 2020, 1:20am UTC](https://devforum.zoom.us/t/php-fatal-error-uncaught-exception-failed-connect-to-api-zoom-us-443-connection-timed-out/38233 "2020-12-12T01:20:19Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![eduardo.merino](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/eduardo.merino/32/20064_2.png) [@eduardo.merino](https://devforum.zoom.us/u/eduardo.merino)\
**Post date:** [December 12, 2020, 1:20am UTC](https://devforum.zoom.us/t/php-fatal-error-uncaught-exception-failed-connect-to-api-zoom-us-443-connection-timed-out/38233/1 "2020-12-12T01:20:19Z")

</div>

**Description**  
I am getting a connection timout error when running a PHP script that consumes the API to get cloud recordings. This error is killing the process execution.

This PHP scripts is running as a command line inside a virtual machine.

I am using this code:  
$url = ‘[https://api.zoom.us/v2/meetings/](https://api.zoom.us/v2/meetings/)’ . $meetingid . ‘/recordings’;  
$payload = array(  
‘iss’ =\> $this-\>apikey,  
‘exp’ =\> time() + 40  
);  
$token = \Firebase\JWT\JWT::encode($payload, $this-\>apisecret);

$curl = curl\_init();  
$curl\_header = array();  
$curl\_header = 'Authorization: Bearer ’ . $token;  
curl\_setopt($curl, CURLOPT\_URL, $url);  
curl\_setopt($curl, CURLOPT\_HTTPHEADER, $curl\_header);  
curl\_setopt($curl, CURLOPT\_RETURNTRANSFER, true);  
$response = curl\_exec($curl);  
$httpCode = curl\_getinfo($curl, CURLINFO\_HTTP\_CODE);  
curl\_close($curl);

**Error**  
PHP Fatal error: Uncaught Exception: Failed connect to [api.zoom.us:443](http://api.zoom.us:443); Connection timed out

**Which App Type (OAuth / Chatbot / JWT / Webhook)?**  
JWT

**Which Endpoint/s?**  
GET /meetings/{meetingId}/recordings

**How To Reproduce (If applicable)**  
After 7000 request to the API endpoint using differents meetingsId i am getting this error (the request rate is 1 per second aprox)

**Additional context**  
This script is part of a massive recordings backup project from a peruvian university.

---

<div class="post-metadata">

**Author:** ![will.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/will.zoom/32/14417_2.png) [@will.zoom](https://devforum.zoom.us/u/will.zoom)\
**Post date:** [December 14, 2020, 6:50pm UTC](https://devforum.zoom.us/t/php-fatal-error-uncaught-exception-failed-connect-to-api-zoom-us-443-connection-timed-out/38233/2 "2020-12-14T18:50:46Z")

</div>

Hi @eduardo.merino,

Do you run into this error when testing from Postman, cURL, etc?

This sounds like it could be an issue with your PHP configuration. Can you please check out these threads and let me know if it helps:  
[https://devforum.zoom.us/search?q=protocol%20api.zoom.us:443](https://devforum.zoom.us/search?q=protocol%20api.zoom.us:443)

Thanks,  
Will

---

<div class="post-metadata">

**Author:** ![eduardo.merino](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/eduardo.merino/32/20064_2.png) [@eduardo.merino](https://devforum.zoom.us/u/eduardo.merino)\
**Post date:** [December 14, 2020, 7:44pm UTC](https://devforum.zoom.us/t/php-fatal-error-uncaught-exception-failed-connect-to-api-zoom-us-443-connection-timed-out/38233/3 "2020-12-14T19:44:02Z")

</div>

Hi Will, thanks for your reply

This error is happening on production enviroment when running a PHP file from CLI, it is using cURL.

I don’t think this is an issue with PHP configuration because this same script have been ran on production enviroment 7 times between august and october without trouble.  
This error is recent, sometimes happens on request # 7717, # 10314, # 3326, # 7796, # 3200. That’s why we think something on Zoom’s side is blocking the connection.

---

<div class="post-metadata">

**Author:** ![will.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/will.zoom/32/14417_2.png) [@will.zoom](https://devforum.zoom.us/u/will.zoom)\
**Post date:** [December 15, 2020, 7:35pm UTC](https://devforum.zoom.us/t/php-fatal-error-uncaught-exception-failed-connect-to-api-zoom-us-443-connection-timed-out/38233/4 "2020-12-15T19:35:53Z")

</div>

Hi @eduardo.merino,

Thanks for clarifying. Can you share the exact requests themselves that failed? Please share the request URLs including the Meeting IDs. This will help me take a closer look!

Thanks,  
Will

---

<div class="post-metadata">

**Author:** ![eduardo.merino](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/eduardo.merino/32/20064_2.png) [@eduardo.merino](https://devforum.zoom.us/u/eduardo.merino)\
**Post date:** [December 15, 2020, 8:36pm UTC](https://devforum.zoom.us/t/php-fatal-error-uncaught-exception-failed-connect-to-api-zoom-us-443-connection-timed-out/38233/5 "2020-12-15T20:36:20Z")

</div>

Hi @will.zoom , thanks for your reply.

The following URLs generated the PHP Fatal Error on different runs:

[https://api.zoom.us/v2/meetings/97981975360/recordings](https://api.zoom.us/v2/meetings/97981975360/recordings)  
[https://api.zoom.us/v2/meetings/97133076470/recordings](https://api.zoom.us/v2/meetings/97133076470/recordings)  
[https://api.zoom.us/v2/meetings/98139171320/recordings](https://api.zoom.us/v2/meetings/98139171320/recordings)  
[https://api.zoom.us/v2/meetings/95064666909/recordings](https://api.zoom.us/v2/meetings/95064666909/recordings)  
[https://api.zoom.us/v2/meetings/95384797368/recordings](https://api.zoom.us/v2/meetings/95384797368/recordings)  
[https://api.zoom.us/v2/meetings/96535761075/recordings](https://api.zoom.us/v2/meetings/96535761075/recordings)

---

<div class="post-metadata">

**Author:** ![will.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/will.zoom/32/14417_2.png) [@will.zoom](https://devforum.zoom.us/u/will.zoom)\
**Post date:** [December 16, 2020, 9:26pm UTC](https://devforum.zoom.us/t/php-fatal-error-uncaught-exception-failed-connect-to-api-zoom-us-443-connection-timed-out/38233/6 "2020-12-16T21:26:36Z")

</div>

Hey @eduardo.merino,

Thanks for sharing this. In checking our logs, I can see that each of these Meetings were deleted some time back in October, which I believe is why these requests are failing. Is it possible you have a auto-delete turned on under your account for recordings?

Thanks,  
Will

---

<div class="post-metadata">

**Author:** ![eduardo.merino](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/eduardo.merino/32/20064_2.png) [@eduardo.merino](https://devforum.zoom.us/u/eduardo.merino)\
**Post date:** [December 16, 2020, 11:21pm UTC](https://devforum.zoom.us/t/php-fatal-error-uncaught-exception-failed-connect-to-api-zoom-us-443-connection-timed-out/38233/7 "2020-12-16T23:21:38Z")

</div>

Hi @will.zoom

In our code we are handling the case when a meeting doesn’t exists or it doens’t have recordings inside a try/catch block.

On the other hand, we decided to execute the script again today and until now we haven’t seen a connection timeout error yet, even when requesting the URLs posted before. So, is it possible for us to know if some server/connection issues happened on Zoom’s backend between December 10 and 15? (it doesn’t have to be very specific and can be sent to our institutional email address)  
We will be asked to write an internal report explaining the delay in our backup process and that information will help us a lot.

Thanks.

---

<div class="post-metadata">

**Author:** ![will.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/will.zoom/32/14417_2.png) [@will.zoom](https://devforum.zoom.us/u/will.zoom)\
**Post date:** [December 17, 2020, 4:58pm UTC](https://devforum.zoom.us/t/php-fatal-error-uncaught-exception-failed-connect-to-api-zoom-us-443-connection-timed-out/38233/8 "2020-12-17T16:58:06Z")

</div>

Hey @eduardo.merino,

Is it possible to provide the logs for this timeout error? We haven’t had any [known issues](https://status.zoom.us), but I’m happy to look into it further for you and share these details with our Engineering team.

Thanks,  
Will

---

<div class="post-metadata">

**Author:** ![eduardo.merino](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/eduardo.merino/32/20064_2.png) [@eduardo.merino](https://devforum.zoom.us/u/eduardo.merino)\
**Post date:** [December 17, 2020, 5:53pm UTC](https://devforum.zoom.us/t/php-fatal-error-uncaught-exception-failed-connect-to-api-zoom-us-443-connection-timed-out/38233/9 "2020-12-17T17:53:43Z")

</div>

Hi @will.zoom, thanks for your reply

This is what we captured in our logs (the image has been cut to hide internal files information):

 ![image](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/8/e/8ec67640ff761e571c52aa72ce5469701358ce93.png)

Just to clarify, even when it says “Uncaught Exception” we are actually handling it inside a try/catch block in our code.  
Additionally, since yesterday we haven’t seen the connection time out error again and our script is running correctly.

---

<div class="post-metadata">

**Author:** ![will.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/will.zoom/32/14417_2.png) [@will.zoom](https://devforum.zoom.us/u/will.zoom)\
**Post date:** [December 18, 2020, 5:33pm UTC](https://devforum.zoom.us/t/php-fatal-error-uncaught-exception-failed-connect-to-api-zoom-us-443-connection-timed-out/38233/10 "2020-12-18T17:33:11Z")

</div>

Hey @eduardo.merino,

Thanks for sharing this—is it possible to include logs that include the actual request and timestamp? This would be helpful in order for our team to be able to look into the specific instances of timeouts. Let me know if it’s possible to provide this.

Thanks,  
Will

---

<div class="post-metadata">

**Author:** ![eduardo.merino](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/eduardo.merino/32/20064_2.png) [@eduardo.merino](https://devforum.zoom.us/u/eduardo.merino)\
**Post date:** [December 18, 2020, 8:36pm UTC](https://devforum.zoom.us/t/php-fatal-error-uncaught-exception-failed-connect-to-api-zoom-us-443-connection-timed-out/38233/11 "2020-12-18T20:36:14Z")

</div>

Hi @will.zoom

excuse me, we don’t have logs containing the complete request and it’s timestamp.

---

<div class="post-metadata">

**Author:** ![will.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/will.zoom/32/14417_2.png) [@will.zoom](https://devforum.zoom.us/u/will.zoom)\
**Post date:** [December 18, 2020, 10:05pm UTC](https://devforum.zoom.us/t/php-fatal-error-uncaught-exception-failed-connect-to-api-zoom-us-443-connection-timed-out/38233/12 "2020-12-18T22:05:08Z")

</div>

Hi @eduardo.merino,

Thanks for clarifying. Without a request example and approximate time to narrow it down, it’s a bit hard to troubleshoot on our end. If you continue to see this issue intermittently, can you take note of the request/time the next time it happens so that we can take a closer look?

Let me know—thanks,  
Will

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [January 18, 2021, 8:05am UTC](https://devforum.zoom.us/t/php-fatal-error-uncaught-exception-failed-connect-to-api-zoom-us-443-connection-timed-out/38233/13 "2021-01-18T08:05:19Z")

</div>

Closed on January 18, 2021, 8:05am UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
