Welcome Guest, Not a member yet? Register   Sign In
GET Parameters and Apache+FastCGI
#1

[eluser]Unknown[/eluser]
Hi guys! Let me tell you my story.

I am developing an application and locally and on staging I have this configuration:

* Local and Staging: Apache 2.2 + mod_php + php 5.3
* 2 Servers: Apache 2.2 + FastCGI + php 5.3

On mod_php enviroments, I tested the following request: http://hostname/index.php/user/index?name=John

On local and Stg the request works perfectly (display users filtered by name). But on the servers I got redirected to default controller/action, and the log says:

Code:
...
DEBUG - 2011-05-13 15:43:24 --> URI Class Initialized
DEBUG - 2011-05-13 15:43:24 --> Router Class Initialized
DEBUG - 2011-05-13 15:43:24 --> No URI present. Default controller set.
DEBUG - 2011-05-13 15:43:24 --> Output Class Initialized
DEBUG - 2011-05-13 15:43:24 --> Input Class Initialized
DEBUG - 2011-05-13 15:43:24 --> Global POST and COOKIE data sanit
...

What I found digging into the core is that on the FastCGI enviroment the request sets $_SERVER['argv'] = array(0 => 'name=John') and that caused URI and Router class to resolve the request wrong. While in local and stg the array key is empty.

Finally, I fixed adding the following line to /index.php file:

Code:
unset($_SERVER['argv'])

Bug I dont know how this would affect codeigniter, and if this a bug on my and, a bug on apache, or a bug on codeigniter on how it resolves the controller/action

Any Ideas?
#2

[eluser]Unknown[/eluser]
Actually the question would be, shoudl I post it on BitBucker?




Theme © iAndrew 2016 - Forum software by © MyBB