Mastodon

Drupal "Updating modules and themes requires FTP access to your server"

“Just updating your Drupal modules” can become a time-consuming task. I just spend two hours doing that and fixing a misconfiguration on my server that caused the well-known error “Updating modules and themes requires FTP access to your server”.

Normally, updating modules in Drupal is as easy as it can be because there’s a nice overview of modules that need an update at admin/modules/update. The admin just selects modules and hits “update”. After a few seconds and no further input, all modules are updated and everything is fine. That’s the way I updated my modules since using Drupal 7. However, today was different. Trying to update this way, I came around this little bugger:

Drupal FTP Access Error

Of course sending your ftp credentials in plain text through the internet is just insane. The comments at the “installing contributed modules”-article at drupal.org directed me to the solution:

  1. If you have a single-site Drupal, you want to change the owner of sites/default to the PHP-user (www-data).
  2. If you have a multi-site Drupal, you want to change the owner of the whole /sites folder to the PHP-user (www-data).

I hope this short article helps a few lost souls spending less time searching. A huge thanks to the Drupal-community!