With the help of the support team of my dedicated server, I have setup Drush globally on my server. Now I can run multiple Drush versions like drush6 status, drush7 status, drush8 status with a little tweak in my .bashrc file

One problem I am unable to resolve is that when I download or update drupal it starts giving 500 Internal server error.

My Support Team Told me

When you use Drush to download Drupal, it gives files 664 permission. The PHP handler in the server is suPHP, which requires 644 file permission, so you need to run the file permission fixing script for the account after using Drush install/update commands.

Is there any way we can instruct Drush to download the files with 644 permission?


Drush does not handle platform-specific issues such as file permissions. To get rid of group write, just run chmod -R g-w /path/to/drupal. If you wanted to do this automatically, you could make a post-update hook for the pm-updatecode command. See the example Drush pm_update hook file for one example post hook function.

In your case, you would want something like this:

function drush_myhook_post_pm_updatecode() {
  passthru('chmod -R g-w .');

Save that in a file named myhook.drush.inc, and put it somewhere that Drush will find it, such as DRUPAL_ROOT/drush. Then run drush cc drush, and your hook should run the next time you call drush pm-update.


This isn't a Drush issue. It's about the configuration of your shell. The file creation mode is controlled by the umask. The correct solution is to set umask to 0022 (022) in the start up files of your shell. Or better, ask your hoster to add it to the global startup files which they already should have done if suPHP requires it ;-)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.