request_uri() checks for a valid REQUEST_URI header (which Apache apparently provides) and returns it if found, otherwise it builds its own. Thttpd provides this header, but differently from Apache. It doesn't append the QUERY_STRING. Under Drupal, this means that all request_uris look like 'index.php' without the module. Since this is used for the form actions, all forms break under Thttpd (they just redirect back to index without doing anything). To work around this locally, I've hacked common.inc to always build its own request_uri.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | request_uri.patch | 466 bytes | Anonymous (not verified) |
Comments
Comment #1
moshe weitzman commentedSince this is a very unpoplar web server, you are going to have to provide a patch along with this report if you want it fixed.
Comment #2
(not verified) commentedUpdate to request_uri() method definition from bootstrap.inc for HTTP servers (such as IIS or the above mentioned thttpd) that do not provide the REQUEST_URI header and do provide the information through QUERY_STRING.
function request_uri() {
/*
** Since request_uri() is only available on Apache, we generate
** equivalent using other environment vars.
*/
if (isset($_SERVER["REQUEST_URI"])) {
$uri = $_SERVER["REQUEST_URI"];
}
else if (isset($_SERVER["QUERY_STRING"])) {
$uri = $_SERVER["QUERY_STRING"];
}
else {
$uri = $_SERVER["PHP_SELF"] ."?". $_SERVER["argv"][0];
}
return check_url($uri);
}
Comment #3
(not verified) commentedrequest_uri() is also broken under Xitami: neither _SERVER["REQUEST_URI"] nor _SERVER["argv"] are valued. However, the standard CGI environment variables _SERVER["SCRIPT_NAME"] and _SERVER["QUERY_STRING"] are valued. (These are probably the lowest-common-denominator variables for obtaining the URI.)
The attached patch adds support for servers that provide standard CGI environment variables. Note that the test must be for the presence of SCRIPT_NAME since QUERY_STRING is not always valued.
Based on the original poster's remarks, I doubt that this patch will work for thttpd, since its REQUEST_URI seems to be broken. This could be remedied by putting the new test first.
Comment #4
dries commented$_SERVER["SCRIPT_NAME"] . "?" . $_SERVER["QUERY_STRING"];... works for Apache too but it does not respect the clean URL setting so you break out the clean URLs occasionally (eg. after submitting a form). In other words: it works but is not optimal.I wonder if this patch interfers with IIS ... ?
Comment #5
dries commentedWaiting for follow up. Making this 'active' in the mean time because the patch's status is unsure.
Comment #6
dries commentedComment #7
robin monks commentedI can run Xitami with Drupal fine, I take it this has been cleared up somewhere along the patch from 4.4.1 to 4.6.1...
Robin
Comment #8
(not verified) commentedComment #9
dfaulkner commentedI have experienced the same problem using SunOne (AKA iPlanet) Enterprise 6.0. I solved the problem in what I believe to be a server-independent manner, and so have created a differently titled issue for the patch. (Also, this patch was closed, and I didn't want to re-open it)
View my notes and patch at http://drupal.org/node/87310
Comment #10
dfaulkner commented