微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

$ _GET填充,但$ _REQUEST是空的

我最近在Windows 7中安装了Nginx 1.4.4和PHP 5.5.8。我运行Nginx.exe和php-cgi.exe运行服务器并运行。 当我在URL中发送查询string时,如果我print_r($_GET)它查询string的值 。 但是,如果我print_r($_REQUEST) $_REQUEST只是一个空的数组 。 我已经在stackoverflow中跟随了一些其他问题,我发现所有检查request_order和variables_order。 在PHP.ini下面是我在PHP.ini中对于request_order和variables_order的当前configuration:

; This directive determines which super global arrays are registered when PHP ; starts up. G,P,C,E & S are abbreviations for the following respective super ; globals: GET,POST,COOKIE,ENV and SERVER. There is a performance penalty ; paid for the registration of these arrays and because ENV is not as commonly ; used as the others,ENV is not recommended on productions servers. You ; can still get access to the environment variables through getenv() should you ; need to. ; Default Value: "EGPCS" ; Development Value: "GPCS" ; Production Value: "GPCS"; ; http://PHP.net/variables-order variables_order="GPCS" ; This directive determines which super global data (G,E & S) should ; be registered into the super global array REQUEST. If so,it also determines ; the order in which that data is registered. The values for this directive are ; specified in the same manner as the variables_order directive,EXCEPT one. ; Leaving this value empty will cause PHP to use the value set in the ; variables_order directive. It does not mean it will leave the super globals ; array REQUEST empty. ; Default Value: None ; Development Value: "GP" ; Production Value: "GP" ; http://PHP.net/request-order request_order="GP"

我也find了一个closuresauto_globals_jit的方法,但是它不起作用。 我有一个工作安装xampp 1.8.3,这是在Apache服务器上工作。 但是当Nginx使用xampp的PHP时, $_REQUEST也是空的。

一些文章告诉改变Nginxconfiguration在fastcgi_params添加query_string。 但情况是$_SERVER['QUERY_STRING']是空的。 但对于我的情况, $_SERVER['QUERY_STRING']包含值。 我仍然尝试,但它也不起作用。

还有什么缺失? 谢谢。

Django错误请求(400)Apache / Nginx部署错误

Node.js + Socket.IO使用redis + cluster进行缩放

Socket.io与Nginx

PHP5-fpm堆栈跟踪切断了string的结尾

如何使用Nginx将address.com/foo/barredirect到address.com:port/bar?

编辑

这里是我的Nginx服务器configuration(我使用Code Igniter,所以我按照http://wiki.Nginx.org/Codeigniter进行configuration:

server { listen 80; server_name local.dev.com; root html/dev; autoindex on; index index.PHP; location / { try_files $uri $uri/ /index.PHP; location = /index.PHP { fastcgi_pass 127.0.0.1:9000; fastcgi_param QUERY_STRING $query_string; fastcgi_param SCRIPT_FILENAME D:/Nginx/html/dev$fastcgi_script_name; include fastcgi_params; } } location ~ .PHP$ { return 444; } }

为服务器大量静态内容调整Nginx / CentOS

uwsgi + Nginx如何更改组?

Nginx CORS不适用于POST

Nginx +乘客+铁路 – 403禁止错误

无法启动Phusion乘客看门狗

当使用protocol REQUEST_URIAUTO (见$config['uri_protocol'] )时,CodeIgniter手动从$_SERVER['REQUEST_URI']建立$_GET 。

您应该修改Nginx的配置,替换行:

try_files $uri $uri/ /index.PHP;

try_files $uri $uri/ /index.PHP$is_args$args;

解决$_REQUEST为空的问题

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐