I was trying to do the following
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"php://input" );
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1 );
$result=curl_exec ($ch);
echo curl_error($ch);
echo $result;
to get raw post data using curl because my hosting com disabled all socket functions except curl so i cannot do file_get_contents("php://input");
i get an error like
Protocol php not supported or disabled in libcurl1
what shall i do?
You can use $HTTP_RAW_POST_DATA
instead of "php://input". For details see the php://input section at http://php.net/manual/wrappers.php.php
Other solution: what are the alternatives for php://input and $HTTP_RAW_POST_DATA when file_get_contents and always_populate_raw_post_data are disabled
您不需要套接字函数来访问php://input
,它可以通过标准fopen
访问,如果您的托管公司阻止fopen
那么您应该考虑更改提供程序而不是代码。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.