我有一台带有NGNIX和PHP设置的服务器。 php脚本似乎没有填充$ _POST变量。我检查了通常的嫌疑人,NGINX配置,PHP.ini等。不确定我做错了什么
location /ffc {
include /etc/nginx/mime.types;
index index.html index.php;
root /var/www/;
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ \.php$ {
try_files $uri =404;
include fastcgi_params;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_pass_request_body on;
fastcgi_pass_request_headers on;
fastcgi_param REQUEST_BODY $request_body;
}
}
<?php
var_dump($HTTP_RAW_POST_DATA);
var_dump($file= file_get_contents('php://input'));
var_dump($_REQUEST);
var_dump($GLOBALS);
echo 'HEADERS <br/>';
var_dump(get_headers());
?>
string(64)“fullname = test email=john@gmail.com message = dfadfsasdfas”array(0){} array(8){[“HTTP_RAW_POST_DATA”] =&gt; string(64)“fullname = test email=john@gmail.com message = dfadfsasdfas”[“_ GET”] =&gt; array(0){} [“_ POST”] =&gt; array(0){} [“_COOKIE”] =&gt; array(7){[“uid”] =&gt; string(24)“CqQw7lMQ9JNQwkpwAwMpAg ==”[“_vis_opt_s”] =&gt; string(2)“1 |” [ “_vis_opt_test_cookie”] =&GT; string(1)“1”[“mp_f6e7292aa77905eaaf9137d271097d72_mixpanel”] =&gt; string(144)“{”distinct_id“:”1447a3b515f188-069aadc7a-1b10435d-1fa400-1447a3b51603ef“,”$ initial_referrer“:”$ direct“,”$ initial_referring_domain“:”$ direct“}”[“ip”] =&gt ; string(13)“”[“iso2”] =&gt; string(0)“”[“iso3”] =&gt; string(0)“”} [“_FILES”] =&gt; array(0){} [“GLOBALS”] =&gt; RECURSION [“_ SERVER”] =&gt; array(41){[“USER”] =&gt; string(8)“www-data”[“HOME”] =&gt; string(8)“/ var / www”[“FCGI_ROLE”] =&gt; string(9)“RESPONDER”[“QUERY_STRING”] =&gt; string(0)“”[“REQUEST_METHOD”] =&gt; string(4)“POST”[“CONTENT_TYPE”] =&gt; string(10)“text / plain”[“CONTENT_LENGTH”] =&gt; string(2)“64”[“SCRIPT_FILENAME”] =&gt; string(34)“/ var / www / test / fcc / sendmail.php”[“SCRIPT_NAME”] =&gt; string(17)“/ fcc/sendmail.php”[“REQUEST_URI”] =&gt; string(17)“/ fcc/sendmail.php”[“DOCUMENT_URI”] =&gt; string(17)“/ fcc/sendmail.php”[“DOCUMENT_ROOT”] =&gt; string(17)“/ var / www / test”[“SERVER_PROTOCOL”] =&gt; string(8)“HTTP / 1.1”[“GATEWAY_INTERFACE”] =&gt; string(7)“CGI / 1.1”[“SERVER_SOFTWARE”] =&gt; string(12)“nginx / 1.5.10”[“REMOTE_ADDR”] =&gt; string(13)“”[“REMOTE_PORT”] =&gt; string(4)“1572”[“SERVER_ADDR”] =&gt; string(13)“”[“SERVER_PORT”] =&gt; string(2)“80”[“SERVER_NAME”] =&gt; string(12)“test.com”[“REDIRECT_STATUS”] =&gt; string(3)“200”[“PATH_INFO”] =&gt; string(17)“/ fcc/sendmail.php”[“REQUEST_BODY”] =&gt; string(64)“fullname = test email=john@gmail.com message = dfadfsasdfas”[“HTTP_HOST”] =&gt; string(12)“test.com”[“HTTP_ACCEPT”] =&gt; string(74)“text / html,application / xhtml + xml,application / xml; q = 0.9,image / webp, / ; q = 0.8”[“HTTP_ACCEPT_ENCODING”] =&gt; string(17)“gzip,deflate,sdch”[“HTTP_ACCEPT_LANGUAGE”] =&gt; string(14)“en-US,en; q = 0.8”[“HTTP_CACHE_CONTROL”] =&gt; string(9)“max-age = 0”[“HTTP_CONTENT_TYPE”] =&gt; string(10)“text / plain”[“HTTP_COOKIE”] =&gt;串(344)“UID = CqQw7lMQ9JNQwkpwAwMpAg ==; _vis_opt_s = 1%7C; _vis_opt_test_cookie = 1; mp_f6e7292aa77905eaaf9137d271097d72_mixpanel =%7B%22distinct_id%22%3A%20%221447a3b515f188-069aadc7a-1b10435d-1fa400-1447a3b51603ef%22%2C%22% 24initial_referrer%22%3A%20%22%24direct%22%2C%22%24initial_referring_domain%22%3A%20%22%24direct%22%7D; ip =; iso2 =; iso3 =“[”HTTP_ORIGIN“] =&gt ; string(19)“http://test.com”[“HTTP_REFERER”] =&gt; string(36)“http://test.com/ffc/contact.html”[“HTTP_USER_AGENT”] =&gt; string(120)“Mozilla / 5.0(Macintosh; Intel Mac OS X 10_8_5)AppleWebKit / 537.36(KHTML,类似Gecko)Chrome / 33.0.1750.117 Safari / 537.36”[“HTTP_X_FORWARDED_FOR”] =&gt; string(14)“192.195.83.183”[“HTTP_X_FORWARDED_PORT”] =&gt; string(2)“80”[“HTTP_X_FORWARDED_PROTO”] =&gt; string(4)“http”[“HTTP_CONTENT_LENGTH”] =&gt; string(2)“64”[“HTTP_CONNECTION”] =&gt; string(10)“keep-alive”[“PHP_SELF”] =&gt; string(17)“/ fcc/sendmail.php”[“REQUEST_TIME_FLOAT”] =&gt; float(1394500698.6063)[“REQUEST_TIME”] =&gt; int(1394500698)} [“_REQUEST”] =&gt; array(0){}} HEADERS NULL POST array(0){}