Has anyone installed drupal successfully on Windows Server 2008 and IIS7? The install script runs fine (no errors) for both 5.x and 6.x, but I cannot create new users, wich poses a problem quickly in version 5.x. Im not even able to create an admin user account. I dont get any errors, but when i click the "Create new account" button from the user account screen it drops me back to the welcome screen.

in version 6, the installer creates the admin account for me, and im able to log in, but i cant add new users, or make any changes to the site, whenever i click the button to save changes (any changes to site config, new users, etc) i end up at the "Welcome" screen as if id just logged in.

does anyone have any idea how to fix this issue?

Comments

bdiekmann’s picture

liljester,

I have been having the exact same issue and I have not been able to resolve this yet. If you manually make changes to the database, such as add a user, it works, but it does not work through web interface. I am therefore working under the assumption that it is a call or write issue to the database that involves IIS7.

Let me know if you end up with any answers, I have not gotten any.

newsguy

liljester’s picture

Im not sure how drupal handles its database communication, php and mysql work perfectly for all other apps ive tried (joomla for example).

I suspect however, its not a database connectivity issue, as the you are always redirected back to the "Welcome" page. A friend of mine suggested maybe a session or cookie handling issue?

EDIT:
http://drupal.org/node/171353 same issue on vista, ill be testing the isapi module later today to see if its only a fastcgi issue.

sepeck’s picture

I still haven't had time to test on IIS7. Too busy.

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

liljester’s picture

Confirmed. If you install PHP as an ISAPI module in IIS7, Drupal will work.

ruslany’s picture

The issue is caused by the fact that FastCGI module in IIS 7.0 sets the REQUEST_URI server variable incorrectly. IIS team is aware of this problem and is planning to release a hotfix shortly.

Meanwhile, one way to workaround this issue is to modify the request_uri() function in "includes/bootstrap.php" file as follows:

function request_uri() {

/* Comment out the condition that uses REQUEST_URI server variable
if (isset($_SERVER['REQUEST_URI'])) {
$uri = $_SERVER['REQUEST_URI'];
}
else { */
if (isset($_SERVER['argv'])) {
$uri = $_SERVER['SCRIPT_NAME'] .'?'. $_SERVER['argv'][0];
}
elseif (isset($_SERVER['QUERY_STRING'])) {
$uri = $_SERVER['SCRIPT_NAME'] .'?'. $_SERVER['QUERY_STRING'];
}
else {
$uri = $_SERVER['SCRIPT_NAME'];
}
// }

return $uri;
}

jostein’s picture

I replaced the request_uri in my bootstrap and it worked.

5 days of troubleshooting read\write access across the board and this was the mistake... :)

dfinkeldei’s picture

I traced the problem with IIS7 and forms not submitting because the form action is "index.php" and doesn't contain the query string. I backtracked the code to the bootstrap function "request_uri()" in bootstrap.inc.

Whew! The problem I think is that IIS7 now has a server variable "REQUEST_URI", but, it doesn't include the query string like Apache does.

Then, I googled "Drupal IIS7 request_uri" and found this post after I figured out after about 8 hours that the If statement "if (isset($_SERVER['REQUEST_URI']))" has to be commented out because IIS7 uses the variable now, but doesn't include the query_string.

This could have been better written by Drupal. And Microsoft IIS7 is also to blame because they should use the standard of other servers like Apache and include the query_string in the REQUEST_URI server variable.

Geez! Drupal is not easy to back trace to find problems like this since it's an endless trail of functions using other functions, using other functions.... a mess to find a simple problem.

Don Finkeldei

ruslany’s picture

The update for the IIS 7.0 FastCGI module, that fixes the issue with Drupal not working on IIS 7.0, is now available from Microsoft. You can download the update from here:

http://www.microsoft.com/downloads/results.aspx?pocId=&freetext=954946&DisplayLang=en

With this update the FastCGI module now sets the REQUEST_URI server variable to include query string and path info. Also, if URL rewriting is used on the web server then the REQUEST_URI will contain the originally requested URL, not the rewritten one.

More information about the update is available here: http://ruslany.net/2008/08/update-for-iis-70-fastcgi-module/

jmgriess’s picture

Just delete file [[ .htaccess ]] in folder DRUPAL for install...

Enjoy.

Broicher’s picture

see this node : http://drupal.org/node/354640

happy hack!

regards Andreas