Can’t Install Drupal Modules on IIS: modules is outside of the root


When attempting to install a module in Drupal via the admin tool / upload manager, I get the following error:

Installation failed! See the log below for more information.
Error installing / updating
File Transfer failed, reason: / is outside of the /

(Note this is from the Authorize.php)


I have installed Drupal on Windows 2012 R2 (IIS 8.5) on my DEV and TEST servers. They are clean / out-of-the-box installations. My DEV environment is working fine, but I can’t install modules on my TEST environment. I’ve gone over the installations trying to figure out what is different, but I’ve been beating my head against the wall and they seem identical.


As it turns out, this is a bug in Drupal running on IIS.  The checkPath method of is case-sensitive, so depending on how you setup the site in IIS, it might work or it might not work!  This explained why things work on my DEV environment but not TEST.

Edit the checkPath method in includes/filetransfer/ and add this code:

$full_path = strtolower($full_path);
$full_jail = strtolower($full_jail);

just before the path comparison:

if ($full_jail !== $full_path) { ... }



A HUGE thanks goes out to “sevenares” for posting the solution to this problem here:

I hope this helps someone.

Happy coding,
Tom Hundley

One response to “Can’t Install Drupal Modules on IIS: modules is outside of the root

What are your thoughts?

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.