CodeIgniter:未指定输入文件:PATH_INFO:$_GET
当我使用:
RewriteEngine on
RewriteCond $1 !^(index\.php|images|favicon\.ico|robots\.txt|class|style|js)
RewriteRule ^(.*)$ /index.php/$1 [L]
在 .htaccess 和:
$config['uri_protocol'] = "PATH_INFO";
在 config.php 中 结果是: 我的 WINDOWS 服务器说:一切正常,我的 LINUX 服务器说未指定输入文件,
所以我以这种方式更改 .htaccess:
RewriteEngine on
RewriteCond $1 !^(index\.php|images|favicon\.ico|robots\.txt|class|style|js)
RewriteRule ^(.*)$ /index.php?/$1 [L]
并在 config.php 中:
$config['uri_protocol'] = "QUERY_STRING";
比: 一切正常,但 $_GET 不行!!!我怎样才能在这样的设置中使用 $_GET ?简单:
parse_str($_SERVER['QUERY_STRING'], $_GET);
现在不起作用
when I use:
RewriteEngine on
RewriteCond $1 !^(index\.php|images|favicon\.ico|robots\.txt|class|style|js)
RewriteRule ^(.*)$ /index.php/$1 [L]
in .htaccess and:
$config['uri_protocol'] = "PATH_INFO";
in config.php
the result is:
MY WINDOWS SERVER says: everything OK and MY LINUX SERVER says No input file specified
so I change .htaccess that way:
RewriteEngine on
RewriteCond $1 !^(index\.php|images|favicon\.ico|robots\.txt|class|style|js)
RewriteRule ^(.*)$ /index.php?/$1 [L]
and in config.php:
$config['uri_protocol'] = "QUERY_STRING";
than:
everything works BUT $_GET not!!! how can I use $_GET with such settings? simple:
parse_str($_SERVER['QUERY_STRING'], $_GET);
doesn't work now
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
解决了...我用过这个:
现在我可以再次使用 $_GET
solved... I used this:
now I can use $_GET again
您可能正在使用 fastcgi PHP,这意味着您应该查看 CI 的用户指南来进行故障排除: http:// /codeigniter.com/user_guide/installation/troubleshooting.html
- 编辑 -
我误解了这个问题。启用查询字符串应该通过 CI 配置来完成。
查看此用户指南页面的底部: http://codeigniter.com/user_guide/general/urls .html
You are probably using fastcgi PHP which means you should take a look at CI's user guide for troubleshooting: http://codeigniter.com/user_guide/installation/troubleshooting.html
-- EDIT --
I misunderstood the question. Enabling querystrings should be done through the CI config.
Look at the bottom of this user guide page: http://codeigniter.com/user_guide/general/urls.html
升级到 CodeIgniter Reactor 2.0,$_GET 适用于大多数安装。 2.0.1 将于本周发布,它有更好的支持。
Upgrade to CodeIgniter Reactor 2.0, $_GET works on most installations. 2.0.1 will be out this week which has even better support.