File Transfer failed, reason: Cannot create directory /var/www/html/modules I have installed Drupal 8 on EC2. I am trying to install a module (simple_sitemap-8.x-2.5.tar.gz).

When I use the interface, I get a failed transfer message:



I have chmod a+x the directory (which already exists), but to no avail.

How should I solve this one? Is there a workaround to install modules without FTP?
The chmod a+x isn't enough, the directory should have write permission for HTTP server user, so try:

chmod 755 /var/www/html


Prefix with sudo if it's necessary.

or if you've already some files in it, try:

chmod -R u+rwX,go+rX,go-w /var/www/html


and if you're using Apache, you should change the ownership by:

chown -R www-data:www-data /var/www/html


If www-data is not correct, you can find the Apache user by the following command:

ps axho user,comm|grep -E "httpd|apache"|uniq|grep -v "root"|awk 'END {if ($1) print $1}