# Http POST not working from php

**URL:** <https://forum.infinityfree.com/t/http-post-not-working-from-php/76430>\
**Category:** Hosting Support\
**Created:** [May 21, 2023, 7:44am UTC](https://forum.infinityfree.com/t/http-post-not-working-from-php/76430 "2023-05-21T07:44:01Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![TeeruKu](https://forum.infinityfree.com/letter_avatar/teeruku/32/6_449c533f586939b6e5f246632a46421f.png) [@TeeruKu](https://forum.infinityfree.com/u/TeeruKu)\
**Post date:** [May 21, 2023, 7:44am UTC](https://forum.infinityfree.com/t/http-post-not-working-from-php/76430/1 "2023-05-21T07:44:01Z")

</div>

Hi  
I am trying to call an API that is hosted OUTSIDE of your hosting service. the code that i am using a standard php post request using Json::decode($data).  
the api is working well as i have tested it.

I know you don’t allow API’s to be hosted on your side, but do you block outside API as well ?

---

<div class="post-metadata">

**Author:** ![Meishin](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/meishin/32/59902_2.png) [@Meishin](https://forum.infinityfree.com/u/Meishin)\
**Post date:** [May 21, 2023, 7:52am UTC](https://forum.infinityfree.com/t/http-post-not-working-from-php/76430/2 "2023-05-21T07:52:22Z")

</div>

To my knowledge this hosting supports outside apis.But you said “not working” in title and pretty much you didn’t tell why you think it isn’t working.Maybe you can share your url?

---

<div class="post-metadata">

**Author:** ![TeeruKu](https://forum.infinityfree.com/letter_avatar/teeruku/32/6_449c533f586939b6e5f246632a46421f.png) [@TeeruKu](https://forum.infinityfree.com/u/TeeruKu)\
**Post date:** [May 21, 2023, 8:05am UTC](https://forum.infinityfree.com/t/http-post-not-working-from-php/76430/3 "2023-05-21T08:05:08Z")

</div>

it’s not working because i don’t get the specfied response and as i don’t have access to the logs i can’t check the logs. the url is paste.malhotra [dot] me  
when i try to create a short cut URL i don’t really get anything. i don’t see it reaching the service

---

<div class="post-metadata">

**Author:** ![Meishin](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/meishin/32/59902_2.png) [@Meishin](https://forum.infinityfree.com/u/Meishin)\
**Post date:** [May 21, 2023, 8:35am UTC](https://forum.infinityfree.com/t/http-post-not-working-from-php/76430/4 "2023-05-21T08:35:02Z")

</div>

The url you shared works perfectly for me.Are you sharing the api provider’s site?Please share your own site if that’s the case. 😀

---

<div class="post-metadata">

**Author:** ![TeeruKu](https://forum.infinityfree.com/letter_avatar/teeruku/32/6_449c533f586939b6e5f246632a46421f.png) [@TeeruKu](https://forum.infinityfree.com/u/TeeruKu)\
**Post date:** [May 21, 2023, 9:32am UTC](https://forum.infinityfree.com/t/http-post-not-working-from-php/76430/5 "2023-05-21T09:32:35Z")

</div>

The issue is with shortning the URL … after a bit of digging in i found this warning in the php code

file\_get\_contents(): SSL operation failed with code 1. OpenSSL Error messages: error:1416F086:SSL routines:tls\_process\_server\_certificate:certificate verify failed

not sure why the webserver is caching the ssl certificate? i have recently moved this sites hosting and issued a new certificate. the cert is correct from what i can see on the browsers…

---

<div class="post-metadata">

**Author:** ![KangJL](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/kangjl/32/12130_2.png) [@KangJL](https://forum.infinityfree.com/u/KangJL)\
**Post date:** [May 21, 2023, 10:45am UTC](https://forum.infinityfree.com/t/http-post-not-working-from-php/76430/6 "2023-05-21T10:45:27Z")

</div>

> [@TeeruKu](#):
>
> server\_certificate:certificate verify failed

Sound like this

> [@SSL checker shows "certificate not trusted" warning](https://forum.infinityfree.com/t/warning-the-certificate-is-not-trusted-in-all-web-browsers/49697/):
>
> When you check your InfinityFree SSL certificate with online SSL checker tools, you might see a warning like this: The certificate is not trusted in all web browsers. You may need to install an Intermediate/chain certificate to link it to a trusted root certificate. This warning sounds scary, but it’s actually not a problem for your website visitors. What this warning means for your site You can safely ignore this warning. Your site will work perfectly fine with HTTPS for virtually all mode…

---

<div class="post-metadata">

**Author:** ![TeeruKu](https://forum.infinityfree.com/letter_avatar/teeruku/32/6_449c533f586939b6e5f246632a46421f.png) [@TeeruKu](https://forum.infinityfree.com/u/TeeruKu)\
**Post date:** [May 21, 2023, 10:51am UTC](https://forum.infinityfree.com/t/http-post-not-working-from-php/76430/7 "2023-05-21T10:51:44Z")

</div>

that doesn’t sound correct as the certificate is issued by let’sEncrypt. the same provider that this hosting is using. i have tried it on my own server / desktop and the cert is valid.

You can check the Cert on [ssl-checker](https://www.sslshopper.com/ssl-checker.html#hostname=https://vru.me/)

---

<div class="post-metadata">

**Author:** ![Meishin](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/meishin/32/59902_2.png) [@Meishin](https://forum.infinityfree.com/u/Meishin)\
**Post date:** [May 21, 2023, 11:02am UTC](https://forum.infinityfree.com/t/http-post-not-working-from-php/76430/8 "2023-05-21T11:02:31Z")

</div>

I have limited knowledge over the ssl stuff so sadly I can’t give more information.However,the php scripts are running on servers.If it is really caching certs,than you should wait.Or maybe you can use it without ssl?Then there won’t be any certificate issues any more.

---

<div class="post-metadata">

**Author:** ![TeeruKu](https://forum.infinityfree.com/letter_avatar/teeruku/32/6_449c533f586939b6e5f246632a46421f.png) [@TeeruKu](https://forum.infinityfree.com/u/TeeruKu)\
**Post date:** [May 21, 2023, 11:19am UTC](https://forum.infinityfree.com/t/http-post-not-working-from-php/76430/9 "2023-05-21T11:19:44Z")

</div>

I have never had this issue before when i have moved between hosts…

unfortunately can’t use this without the https ☹

Anyone from the server team can answer this?

---

<div class="post-metadata">

**Author:** ![KangJL](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/kangjl/32/12130_2.png) [@KangJL](https://forum.infinityfree.com/u/KangJL)\
**Post date:** [May 21, 2023, 11:26am UTC](https://forum.infinityfree.com/t/http-post-not-working-from-php/76430/10 "2023-05-21T11:26:29Z")

</div>

This is funny.  
You are having issues with something that is not hosted here.  
Seek help from the relevant party, not here

---

<div class="post-metadata">

**Author:** ![TeeruKu](https://forum.infinityfree.com/letter_avatar/teeruku/32/6_449c533f586939b6e5f246632a46421f.png) [@TeeruKu](https://forum.infinityfree.com/u/TeeruKu)\
**Post date:** [May 21, 2023, 11:54am UTC](https://forum.infinityfree.com/t/http-post-not-working-from-php/76430/11 "2023-05-21T11:54:54Z")

</div>

thanks for the response…  
the issue is not with the called API but the calling site. I have checked the API that is being called and i do get responses elsewhere.

---

<div class="post-metadata">

**Author:** ![Greenreader9](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/greenreader9/32/22847_2.png) [@Greenreader9](https://forum.infinityfree.com/u/Greenreader9)\
**Post date:** [May 21, 2023, 12:54pm UTC](https://forum.infinityfree.com/t/http-post-not-working-from-php/76430/12 "2023-05-21T12:54:57Z")

</div>

Can you please share your URL?

---

<div class="post-metadata">

**Author:** ![Meishin](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/meishin/32/59902_2.png) [@Meishin](https://forum.infinityfree.com/u/Meishin)\
**Post date:** [May 21, 2023, 1:22pm UTC](https://forum.infinityfree.com/t/http-post-not-working-from-php/76430/13 "2023-05-21T13:22:41Z")

</div>

> [@TeeruKu](#):
>
> paste.malhotra [dot] me

I believe that TeeruKu has already shared the url,but for some reason it was not properly formatted.

---

<div class="post-metadata">

**Author:** ![Greenreader9](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/greenreader9/32/22847_2.png) [@Greenreader9](https://forum.infinityfree.com/u/Greenreader9)\
**Post date:** [May 21, 2023, 1:58pm UTC](https://forum.infinityfree.com/t/http-post-not-working-from-php/76430/14 "2023-05-21T13:58:30Z")

</div>

Yep, that’s right. I think I got a bit confused 🙂

@TeeruKu, your account appears to be suspended. Can you check the client area for a reason?

---

<div class="post-metadata">

**Author:** ![TeeruKu](https://forum.infinityfree.com/letter_avatar/teeruku/32/6_449c533f586939b6e5f246632a46421f.png) [@TeeruKu](https://forum.infinityfree.com/u/TeeruKu)\
**Post date:** [May 21, 2023, 3:59pm UTC](https://forum.infinityfree.com/t/http-post-not-working-from-php/76430/15 "2023-05-21T15:59:25Z")

</div>

All clear now!

---

<div class="post-metadata">

**Author:** ![TeeruKu](https://forum.infinityfree.com/letter_avatar/teeruku/32/6_449c533f586939b6e5f246632a46421f.png) [@TeeruKu](https://forum.infinityfree.com/u/TeeruKu)\
**Post date:** [May 21, 2023, 4:00pm UTC](https://forum.infinityfree.com/t/http-post-not-working-from-php/76430/16 "2023-05-21T16:00:55Z")

</div>

Waiting seems to have fixed it!! or was it the disable → enable switch… anyway works now.

---

<div class="post-metadata">

**Author:** ![system](https://infinityfree-forum-uploads.s3.dualstack.eu-central-1.amazonaws.com/original/3X/b/0/b024fd3fa88bae093c9576e55c2c94e33f890206.svg) [@system](https://forum.infinityfree.com/u/system)\
**Post date:** [May 28, 2023, 4:01pm UTC](https://forum.infinityfree.com/t/http-post-not-working-from-php/76430/17 "2023-05-28T16:01:10Z")

</div>

Closed on May 28, 2023, 4:01pm UTC

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