what are the alternatives for php://input and $HTTP_RAW_POST_DATA when file_get_contents and always_populate_raw_post_data are disabled

前端 未结 1 1381
隐瞒了意图╮
隐瞒了意图╮ 2020-12-11 07:54

My hosting comp has disabled all the socket functionality except curl. They are so irresponsible on my questions for enabling it. i can think of another hosting yet i want t

相关标签:
1条回答
  • 2020-12-11 08:48

    When file_get_contents() is disabled you can use the great functionality of PEAR::PHP_Compat. It consists of an replacement for file_get_contents().

    Simply download the latest package, extract it and use it like this:

    require_once '/path/to/PHP_Compat-1.6.0a3/Compat/Function/file_get_contents.php';
    
    $content = php_compat_file_get_contents('http://example.com');
    
    0 讨论(0)
提交回复
热议问题