简体   繁体   中英

PHP file_get_contents(“php://input”) missing request content

I have an issue in php codeigniter, Posting data from client to server like below, and in server i used to read post data by file_get_contents("php://input"). It truncate the data and displaying only first 50 character. It was working fine in my previous server, now we have changed to new server after that it getting an issue.

var base_url = "http://www.mydomain.in/";
$.ajax({
             url:base_url+ "index.php/api/transactions/status",
             data: {"username":"logimax","passwd":"pass@2015","status":"Y"},
             dataType:"JSON",
             type:"POST",
             success:function(data){
                console.log(data);
                      },
                      error:function(error)  
                      {
                console.log(err);       
                      }  
          });

Firebug Report: We could monitor the post data and response in firebug like the below,

Request URL: http://www.mydomain.in/index.php/api/transactions/status Request Method:POST

Request header: Accept:application/json, text/javascript,

Form Data username:logimax passwd:pass@2015 status:Y

Response: string(50) "username=l

In server Server side code: using codeigniter REST service.

public function transactionsByStatus_post()
{
    var_dump(file_get_contents('php://input')); // Its getting truncate. Not fully displaying the values.

//Response sending as JSON Format
}

Check to see if the xdebug extension is enabled in your php.ini.

If so, perhaps try these settings:

xdebug.var_display_max_data=-1
xdebug.var_display_max_children=-1
xdebug.var_display_max_depth=-1

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM