douzhao6584 2010-11-02 16:23
浏览 63
已采纳

$ _POST为空

I'm posting data from a Flex app to a php script. GET works fine but POST doesn't seem to transmit anything. as3httpclintlib is the library I'm working with, however, I kind of doubt that is the problem, because replicating the request in php gives me the same result. I've looked around and while there seem to be multiple issues similar to this, none of the proposed suggestions worked.

My php.ini looks good from what I can tell, however I did recently recompile Apache and PHP.

//php.ini
...
variables_order = "EGPCS"
register_globals = off
register_argc_argv = On
post_max_size = 8M
gpc_order = "GPC"
...

the request body is pretty simple:

data={\"id\":0,\"password\":\"abcdefg\",\"name\":\"testUser\",\"createdOn\":null,\"apikey\":\"hijklmn\"}

it looks weird w/ all the slashes, but I stripslashes() and it works fine... usually.

So, it's not Flash, because a request from PHP acts the same way. It's not the request -- seemingly -- because an identical GET works fine, Content-Type is set to 'application/x-www-form-urlencoded'. I'm pretty sure it has something to do with the recent compilation but that's about as far as I have been able to take it. Thank you for any suggestions.

Apache 2.2 PHP 5.3.3

UPDATE: Still haven't gotten it working, but it looks like it might be apart of my Apache configuration. I didn't think anything I did was substandard, but I am not seeing many other solutions. Is there anything in particular I should look for to check against my config?

UPDATE 2: After recompiling Apache and PHP with only the required modules and extensions it worked fine. I had some extra stuff loaded for future use, perhaps.... perhaps it was one of those that was throwing things off.

  • 写回答

3条回答 默认 最新

  • doushaiyu5065 2011-11-04 22:47
    关注

    I had the same problem with PHP 5.3.2 Suhosin-Patch and a htaccess file overriding:

    php_value post_max_size = 150M
    

    Here is a one line workaround :

    parse_str(file_get_contents('php://input'), $_POST);
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥20 求数据集和代码#有偿答复
  • ¥15 关于下拉菜单选项关联的问题
  • ¥20 java-OJ-健康体检
  • ¥15 rs485的上拉下拉,不会对a-b<-200mv有影响吗,就是接受时,对判断逻辑0有影响吗
  • ¥15 使用phpstudy在云服务器上搭建个人网站
  • ¥15 应该如何判断含间隙的曲柄摇杆机构,轴与轴承是否发生了碰撞?
  • ¥15 vue3+express部署到nginx
  • ¥20 搭建pt1000三线制高精度测温电路
  • ¥15 使用Jdk8自带的算法,和Jdk11自带的加密结果会一样吗,不一样的话有什么解决方案,Jdk不能升级的情况
  • ¥15 画两个图 python或R