curl 'http://i.niliu.me/xx/xxx'  -d 'salmonlqqqqqqqqqqqqqqq'PHP接口,POST请求参数字符长度小于等于16383, $_POST中就可以获取到,超过16383就获取不到,输出为空。提交小于等于10239个字符,nginx access log中能记录到post 参数,超过10239 access log中没记录post 参数。没有看到任何php和nginx错误。
请求示意图接收示意图
服务器环境:php-fpm + nginx模式(php version 7.2)php.ini中post相关设置
post_max_size 8M
upload_max_filesize 20M
max_execution_time = 100
max_input_time = 60
memory_limit = 32M
max_input_vars = 4000
nginx.conf中相关设置client_max_body_size 120M;
client_header_timeout 5s;
fastcgi_buffer_size 4k;
fpm.conf中相关设置request_terminate_timeout = 30

解决方案 »

  1.   

    重新弄环境吧,肯定是哪里配置错 了,默认的lnmp 环境就能发送post 50M
      

  2.   

    线上环境,Docker中,不方便轻易重装
      

  3.   

    补充如下php.ini信息,另外仿真环境可以接收,线上接收不到,仿真环境和线上php.ini配置对比一致。以下信息仿真环境和线上输出也一致echo ini_get('file_uploads') . "\n";   echo ini_get('max_input_time') . "\n";   echo ini_get('max_execution_time') . "\n";   echo ini_get('post_max_size') . "\n";   echo ini_get('upload_max_filesize') . "\n";   echo ini_get('memory_limit') . "\n"; 
    1
    60
    30
    8M
    5M
    256M
      

  4.   

    参考文章,没有结果,http://www.111cn.net/phper/31/61219.htm
      

  5.   

    你怎么就能认定不是 curl 命令的问题呢?
      

  6.   

    请求的时候测试了在header中设置Expect为空,也依旧传递不过去。curl 'http://i.niliu.me/xx/xxx'  -d 'salmonlqqqqqqqqqqq' -H 'Expect:'
    另外同事通过postman提交测试也是一样的问题
      

  7.   

    帮忙用curl请求看下效果哈
      

  8.   

    在仿真机测试curl 并且不在header中设置Expect为空,提交18000个字符PHP $_POST也能接收到,应该能排除curl本身的问题
    curl 'http://i.niliu.me/xx/xxx'  -d 'salmonlqqqqqqqqqqq...'  -x '仿真ip:端口'
    参数计数通过这个工具:http://www.eteste.com/
      

  9.   

    补充,通过php://input方式来接收,发现也接收不到var_dump(file_get_contents("php://input"));