我编写了一个简单的命令行程序,可以打开浏览器并将数据发布到给定的 URL。出于某种原因,一旦请求到达我的 Apache 服务器,Apache 就会看到发布数据,但无法将其发送到 PHP。当尝试
回显 var_dump ($_POST, true)
我看到一个空数组。我已经设置了 mod_dumpio,可以看到请求进来,并且 POST 数据肯定在那里(我将显示 apache 接收 post 数据的行加倍,以便在下面更容易找到):
[Thu Jul 07 08:24:48 2016] [notice] Apache/2.2.22 (Debian) PHP/5.4.36-0+deb7u3 configured -- resuming normal operations
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(113): mod_dumpio: dumpio_in [getline-blocking] 0 readbytes
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(55): mod_dumpio: dumpio_in (data-HEAP): 17 bytes
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(74): mod_dumpio: dumpio_in (data-HEAP): POST / HTTP/1.1\r\n
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(113): mod_dumpio: dumpio_in [getline-blocking] 0 readbytes
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(55): mod_dumpio: dumpio_in (data-HEAP): 47 bytes
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(74): mod_dumpio: dumpio_in (data-HEAP): Accept: text/html, application/xhtml+xml, */*\r\n
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(113): mod_dumpio: dumpio_in [getline-blocking] 0 readbytes
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(55): mod_dumpio: dumpio_in (data-HEAP): 49 bytes
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(74): mod_dumpio: dumpio_in (data-HEAP): Content-Type: application/x-www-form-urlencoded\r\n
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(113): mod_dumpio: dumpio_in [getline-blocking] 0 readbytes
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(55): mod_dumpio: dumpio_in (data-HEAP): 24 bytes
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(74): mod_dumpio: dumpio_in (data-HEAP): Accept-Language: en-US\r\n
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(113): mod_dumpio: dumpio_in [getline-blocking] 0 readbytes
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(55): mod_dumpio: dumpio_in (data-HEAP): 82 bytes
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(74): mod_dumpio: dumpio_in (data-HEAP): User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko\r\n
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(113): mod_dumpio: dumpio_in [getline-blocking] 0 readbytes
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(55): mod_dumpio: dumpio_in (data-HEAP): 32 bytes
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(74): mod_dumpio: dumpio_in (data-HEAP): Accept-Encoding: gzip, deflate\r\n
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(113): mod_dumpio: dumpio_in [getline-blocking] 0 readbytes
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(55): mod_dumpio: dumpio_in (data-HEAP): 19 bytes
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(74): mod_dumpio: dumpio_in (data-HEAP): Host: local.kiosk\r\n
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(113): mod_dumpio: dumpio_in [getline-blocking] 0 readbytes
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(55): mod_dumpio: dumpio_in (data-HEAP): 20 bytes
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(74): mod_dumpio: dumpio_in (data-HEAP): Content-Length: 34\r\n
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(113): mod_dumpio: dumpio_in [getline-blocking] 0 readbytes
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(55): mod_dumpio: dumpio_in (data-HEAP): 24 bytes
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(74): mod_dumpio: dumpio_in (data-HEAP): Connection: Keep-Alive\r\n
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(113): mod_dumpio: dumpio_in [getline-blocking] 0 readbytes
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(55): mod_dumpio: dumpio_in (data-HEAP): 25 bytes
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(74): mod_dumpio: dumpio_in (data-HEAP): Cache-Control: no-cache\r\n
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(113): mod_dumpio: dumpio_in [getline-blocking] 0 readbytes
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(55): mod_dumpio: dumpio_in (data-HEAP): 2 bytes
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(74): mod_dumpio: dumpio_in (data-HEAP): \r\n
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(113): mod_dumpio: dumpio_in [readbytes-blocking] 34 readbytes
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(55): mod_dumpio: dumpio_in (data-HEAP): 34 bytes
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(74): mod_dumpio: dumpio_in (data-HEAP): mm=7H235727A768&mn=JKIUYRHT0081563
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(143): mod_dumpio: dumpio_out
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(55): mod_dumpio: dumpio_out (data-HEAP): 271 bytes
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(74): mod_dumpio: dumpio_out (data-HEAP): HTTP/1.1 200 OK\r\nDate: Thu, 07 Jul 2016 13:25:22 GMT\r\nServer: Apache/2.2.22 (Debian)\r\nX-Powered-By: PHP/5.4.36-0+deb7u3\r\nVary: Accept-Encoding\r\nContent-Encoding: gzip\r\nContent-Length: 91\r\nKeep-Alive: timeout=5, max=100\r\nConnection: Keep-Alive\r\nContent-Type: text/html\r\n\r\n
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(143): mod_dumpio: dumpio_out
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(55): mod_dumpio: dumpio_out (data-IMMORTAL): 10 bytes
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(74): mod_dumpio: dumpio_out (data-IMMORTAL): \x1f\x8b\b
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(55): mod_dumpio: dumpio_out (data-HEAP): 73 bytes
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(74): mod_dumpio: dumpio_out (data-HEAP): \xcb\xc9ON\xcc\xb1I*\xd2\xb7\x83\x10\x05E\xa9v\x89EE\x89\x95\n\x1a\\\n\n\xea\xb9\xb9\xea\n\xb6v\n\xeaF\xceF\xe6.\xe6F\xe6\x8e\xc6ff\xea:`\x99<\x88\x8c\xbf\xa3\xa7\x97s\x88K\xa8\x81\x81\x85\xa1\x89\xa9)PR\x13
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(55): mod_dumpio: dumpio_out (data-POOL): 8 bytes
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(74): mod_dumpio: dumpio_out (data-POOL): \x89\x02;[T
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(55): mod_dumpio: dumpio_out (metadata-EOS): 0 bytes
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(113): mod_dumpio: dumpio_in [eatcrlf-nonblocking] 0 readbytes
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(127): mod_dumpio: dumpio_in - 11
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(143): mod_dumpio: dumpio_out
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(55): mod_dumpio: dumpio_out (metadata-FLUSH): 0 bytes
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(113): mod_dumpio: dumpio_in [getline-blocking] 0 readbytes
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(55): mod_dumpio: dumpio_in (data-HEAP): 16 bytes
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(74): mod_dumpio: dumpio_in (data-HEAP): GET / HTTP/1.1\r\n
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(113): mod_dumpio: dumpio_in [getline-blocking] 0 readbytes
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(55): mod_dumpio: dumpio_in (data-HEAP): 47 bytes
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(74): mod_dumpio: dumpio_in (data-HEAP): Accept: text/html, application/xhtml+xml, */*\r\n
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(113): mod_dumpio: dumpio_in [getline-blocking] 0 readbytes
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(55): mod_dumpio: dumpio_in (data-HEAP): 24 bytes
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(74): mod_dumpio: dumpio_in (data-HEAP): Accept-Language: en-US\r\n
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(113): mod_dumpio: dumpio_in [getline-blocking] 0 readbytes
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(55): mod_dumpio: dumpio_in (data-HEAP): 82 bytes
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(74): mod_dumpio: dumpio_in (data-HEAP): User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko\r\n
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(113): mod_dumpio: dumpio_in [getline-blocking] 0 readbytes
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(55): mod_dumpio: dumpio_in (data-HEAP): 32 bytes
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(74): mod_dumpio: dumpio_in (data-HEAP): Accept-Encoding: gzip, deflate\r\n
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(113): mod_dumpio: dumpio_in [getline-blocking] 0 readbytes
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(55): mod_dumpio: dumpio_in (data-HEAP): 19 bytes
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(74): mod_dumpio: dumpio_in (data-HEAP): Host: local.kiosk\r\n
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(113): mod_dumpio: dumpio_in [getline-blocking] 0 readbytes
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(55): mod_dumpio: dumpio_in (data-HEAP): 24 bytes
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(74): mod_dumpio: dumpio_in (data-HEAP): Connection: Keep-Alive\r\n
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(113): mod_dumpio: dumpio_in [getline-blocking] 0 readbytes
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(55): mod_dumpio: dumpio_in (data-HEAP): 2 bytes
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(74): mod_dumpio: dumpio_in (data-HEAP): \r\n
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(143): mod_dumpio: dumpio_out
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(55): mod_dumpio: dumpio_out (data-HEAP): 270 bytes
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(74): mod_dumpio: dumpio_out (data-HEAP): HTTP/1.1 200 OK\r\nDate: Thu, 07 Jul 2016 13:25:22 GMT\r\nServer: Apache/2.2.22 (Debian)\r\nX-Powered-By: PHP/5.4.36-0+deb7u3\r\nVary: Accept-Encoding\r\nContent-Encoding: gzip\r\nContent-Length: 44\r\nKeep-Alive: timeout=5, max=99\r\nConnection: Keep-Alive\r\nContent-Type: text/html\r\n\r\n
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(143): mod_dumpio: dumpio_out
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(55): mod_dumpio: dumpio_out (data-IMMORTAL): 10 bytes
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(74): mod_dumpio: dumpio_out (data-IMMORTAL): \x1f\x8b\b
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(55): mod_dumpio: dumpio_out (data-HEAP): 26 bytes
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(74): mod_dumpio: dumpio_out (data-HEAP): \xcb\xc9ON\xcc\xb1I*\xd2\xb7\x83\x10\x05E\xa9v\x89EE\x89\x95\n\x1a\\\x9a
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(55): mod_dumpio: dumpio_out (data-POOL): 8 bytes
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(74): mod_dumpio: dumpio_out (data-POOL): \xac\xb0\x89\xac\x1d
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(55): mod_dumpio: dumpio_out (metadata-EOS): 0 bytes
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(113): mod_dumpio: dumpio_in [eatcrlf-nonblocking] 0 readbytes
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(127): mod_dumpio: dumpio_in - 11
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(143): mod_dumpio: dumpio_out
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(55): mod_dumpio: dumpio_out (metadata-FLUSH): 0 bytes
[Thu Jul 07 08:25:22 2016] [debug] mod_dumpio.c(113): mod_dumpio: dumpio_in [getline-blocking] 0 readbytes
[Thu Jul 07 08:25:27 2016] [debug] mod_dumpio.c(127): mod_dumpio: dumpio_in - 70007
[Thu Jul 07 08:25:27 2016] [debug] mod_dumpio.c(143): mod_dumpio: dumpio_out
[Thu Jul 07 08:25:27 2016] [debug] mod_dumpio.c(55): mod_dumpio: dumpio_out (metadata-FLUSH): 0 bytes
[Thu Jul 07 08:25:27 2016] [debug] mod_dumpio.c(55): mod_dumpio: dumpio_out (metadata-EOC): 0 bytes
您对 PHP 为何无法识别帖子数据有什么想法吗?