[SOLVED] Error when installing modules in Drupal 7 from admin/modules/install - Exception: Invalid checksum for file...calculated, 0 expected in Archive_Tar...line 635 of modules/system/system.tar.inc

Drupal 7 provides a feature that allows you to install a new module via the Drupal interface itself, without entering your hosting server's cPanel/alternative File Manager to upload files.

That works like a charm for most hosting servers and makes installing modules/themes a breeze on Drupal.

For some others, trying to install modules that way (from admin/modules/install) might just bring up something that looks like the following:
Exception: Invalid checksum for file ... calculated, 0 expected in Archive_Tar->_error() (line 635 of .../my-site.com/modules/system/system.tar.inc).

Here's how to fix this:

Quick Fix: Change the Temporary Directory used by Drupal as follows:

From admin/config/media/file-system,
change the "Temporary Directory" to something like "sites/default/files/tmp",
click the "Save Configuration" button, and just try again!

-

Story:


The error showed up when we tried to install Views module, using Drupal's web interface for the same (at admin/modules/install), after a migration to NixWinD's(www.nixwind.com) new hosting server.
When we checked, the problem existed both for existing as well as new Drupal installations on the server.

Googling for
Exception "Invalid checksum for file" "line 635" "modules/system/system.tar.inc"

I came across the following link at drupal.org:
http://drupal.org/node/1312904
which says the issue could be a hosting-server-related issue.

Realizing this could be something related to the way the new server was set up, I contacted the hosting provider (NixWinD), to check whether this was some problem with the folder ownership/permission/mask.

Joe, one of the admins there, was quick to come up with a correct reply:

We have a firewall that will zip and move out the files in a automated way if it finds anything suspicious inside /tmp. Can you try to set the tmp directory for your Drupal installation to a different path inside your account?
It can be done at application level or by modifying your php settings with a php.ini.

From the interface, I changed the path, and lo! That was fixed.

And NixWinD got one Happy customer who blogs about their excellent support and hosting service! :-)

--

P.S.:
1. I know these NixWinD guys personally.
And I can vouch for the expertise of the one at their top - Hossan, is one good "puli" ("superman") admin. And he delivers what he promises.

2. If you happen to buy one of their services after seeing my comments on them, and ever feel they were not that good, do let me know here itself, using the Comments box below. I'll whack him up myself for you.
And if you find they are real good, do post your good experiences here. I can feel a bit happy that I recommended them. :-)

--

And here's something for you to read next if you are one of the curious/wannabe-a-puli types:
Working with files in Drupal 7

Happy Drupaling!

randomness