You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I moved my application from using the standard apache mod-php5 to one run by php-fpm (for performance reasons), I discovered that Tonic subsequently failed to correctly parse the request URI.
The getURIFromEnvironment() in Request.php first looks for $_SERVER['REDIRECT_URL'], and if that exists, uses it for the request URI.
This may be correct when run within apache, but under fpm, it returns the URL to the dispatch script instead.
In Apache:
$_SERVER['REDIRECT_URL''] is '/myapp/web/category'
In FPM:
$_SERVER['REDIRECT_URL''] is '/myapp/web/dispatch.php'.
I would recommend that Request.php check for $_SERVER["REQUEST_URI"] first instead of $_SERVER["REDIRECT_URL"], as it always seems to contain the correct URI that's needed.
I've hacked around this issue temporarily by overwriting $_SERVER["REDIRECT_URL"] with $_SERVER["REQUEST_URI"] in my dispatch.php, but having this handled in the base code would be great!
The text was updated successfully, but these errors were encountered:
I've had problems getting the environment order correct to work for all servers, I can't remember how we arrived at the current ordering.
You can pass in the correct request URL when you create the Request object within the dispatcher.
It'd be great if you could add this and test it against mod_php. Ensure that you also update the Request object spec. Let me know if you need some help.
When I moved my application from using the standard apache mod-php5 to one run by php-fpm (for performance reasons), I discovered that Tonic subsequently failed to correctly parse the request URI.
The getURIFromEnvironment() in Request.php first looks for $_SERVER['REDIRECT_URL'], and if that exists, uses it for the request URI.
This may be correct when run within apache, but under fpm, it returns the URL to the dispatch script instead.
eg:
Original request: http://localhost/myapp/web/category
In Apache:
$_SERVER['REDIRECT_URL''] is '/myapp/web/category'
In FPM:
$_SERVER['REDIRECT_URL''] is '/myapp/web/dispatch.php'.
I would recommend that Request.php check for $_SERVER["REQUEST_URI"] first instead of $_SERVER["REDIRECT_URL"], as it always seems to contain the correct URI that's needed.
I've hacked around this issue temporarily by overwriting $_SERVER["REDIRECT_URL"] with $_SERVER["REQUEST_URI"] in my dispatch.php, but having this handled in the base code would be great!
The text was updated successfully, but these errors were encountered: