file_get_contents('php:// input')不起作用

I am posting json data to my demo site and file_get_contents('php://input'); is working but the same code is not working on my live site. Both site is hosted on same server. I could not find out the issue.

I have checked the allow_url_fopen is set to off on both site.

Can anyone help to find out the issue?

You will have to enable allow_url_fopen from php.ini on your host or talk to your hosting providers.

This option enables the URL-aware fopen wrappers that enable accessing URL object like files

set allow_url_fopen to 1 in your ini (use a php.ini file, use ini_set in php code, or talk to your host).

it's usually disabled to prevent abuse. If you paid for your hosting, get in contact with your host so they can enable it for you.

If changing that setting is not an option, then have a look at the cURL library.