Permissions Problem For New AWS Lightsail Instance?

[IMPORTANT, please fill the questions]

  • Lightsail WP Instance - Latest

-Lightsail

  • Operative system/Platform (Linux, Windows, OSX)(x86/x64): Linux

  • Was it installed as the root user? Bitnami

  • Is there anything you’ve done and/or tried with the application before posting here?
    E.g. changed permissions or installed a plugin:
    ---------- Updated plugins after updating permissions through SFTP

We assume you are using Bitnami to deploy your application.
Describe here your question/suggestion/issue and how to reproduce it.

I have this message at the top of every admin screen:

“Upload folder is not writable. Export and file upload features will not be functional.”

I have gone throgh each of the wp-content folders and manually set the permissions. I have also run these two commands in Putty:
To make the uploads folder writeable:
sudo chown -R bitnami:daemon /opt/bitnami/apps/wordpress/htdocs/wp-content/uploads

To make all folders writeable:
sudo chown -R bitnami:daemon /opt/bitnami/apps/wordpress/htdocs

I have not tested an image upload yet.
Any suggestions?
Thanks,
Frank

Hello @franksurget

Could you share with us the output of running the command below?

ls -la /opt/bitnami/apps/wordpress/htdocs/wp-content/plugins/

Maybe the owner permissions is right but you’re not using the right permissions. You can make sure that the permissions are right running:

sudo find /opt/bitnami/apps/wordpress/htdocs/wp-content/plugins/ -type f -exec chmod 664 {} \;
sudo find /opt/bitnami/apps/wordpress/htdocs/wp-content/plugins/ -type d -exec chmod 775 {} \;

Best Regards,

Juan Ariza

Hi Juan
Ran both of your commands before running the ls. Line is still in the admin area:

“Upload folder is not writable. Export and file upload features will not be functional.”

Here is the ls:

total 104
drwxrwxr-x 25 bitnami daemon 4096 Jan 10 14:38 .
drwxrwxr-x 10 bitnami daemon 4096 Jan 10 11:36 …
drwxrwxr-x 2 bitnami daemon 4096 Jan 10 11:35 add-from-server
drwxrwxr-x 4 bitnami daemon 4096 Oct 24 13:55 akismet
drwxrwxr-x 4 bitnami daemon 4096 Jan 10 11:17 all-in-one-wp-migration
drwxrwxr-x 3 bitnami daemon 4096 Jan 10 11:39 all-in-one-wp-migration-unlimited -extension
drwxrwxr-x 3 bitnami daemon 4096 Jan 10 11:35 clicky-analytics
drwxrwxr-x 8 daemon daemon 4096 Jan 10 12:43 cloudflare
drwxrwxr-x 7 bitnami daemon 4096 Jan 10 11:35 contact-form-7
drwxrwxr-x 5 bitnami daemon 4096 Jan 10 11:35 cornerstone
drwxrwxr-x 2 bitnami daemon 4096 Jan 10 11:35 duplicate-post
drwxrwxr-x 12 bitnami daemon 4096 Jan 10 11:35 fv-wordpress-flowplayer
drwxrwxr-x 8 bitnami daemon 4096 Jan 10 11:35 gravityforms
drwxrwxr-x 4 bitnami daemon 4096 Jan 10 11:35 header-and-footer-scripts-inserte r
-rw-rw-r-- 1 bitnami daemon 28 Jun 5 2014 index.php
drwxrwxr-x 5 bitnami daemon 4096 Jan 10 11:35 iwp-client
drwxrwxr-x 11 bitnami daemon 4096 Jan 10 11:36 media-library-assistant
drwxrwxr-x 7 bitnami daemon 4096 Jan 10 11:35 revslider
drwxrwxr-x 9 bitnami daemon 4096 Jan 10 11:36 simple-lightbox
drwxrwxr-x 6 bitnami daemon 4096 Oct 24 13:55 simple-tags
drwxrwxr-x 8 daemon daemon 4096 Jan 10 13:00 ssl-insecure-content-fixer
drwxrwxr-x 12 bitnami daemon 4096 Jan 10 11:35 updraftplus
drwxrwxr-x 7 bitnami daemon 4096 Oct 24 13:55 versionpress
drwxrwxr-x 11 bitnami daemon 4096 Jan 10 11:35 wordpress-seo
drwxrwxr-x 3 bitnami daemon 4096 Jan 10 11:35 wp-mail-smtp
drwxrwxr-x 6 bitnami daemon 4096 Jan 10 11:35 x-google-analytics

Thanks,
Frank

Hello @franksurget

Could you repeat the same operations with the folder /opt/bitnami/apps/wordpress/htdocs/wp-content/uploads?

Best Regards,

Juan Ariza

Sure. Here’s a screenshot.
image

Hello,

Sorry I can’t see it in the screenshot. Can you confirm that all those folders have “daemon” as “group”?

Best Regards,

Juan Ariza

Sorry - yes they do.

bitnami@ip-172-26-15-130:~$ ls -la /opt/bitnami/apps/wordpress/htdocs/wp-content/uploads
total 28
drwsrwxr-x 7 bitnami daemon 4096 Jan 10 11:36 .
drwxrwxr-x 10 bitnami daemon 4096 Jan 10 18:44 …
drwsrwxr-x 4 bitnami daemon 4096 Jan 10 11:36 2015
drwsrwxr-x 6 bitnami daemon 4096 Jan 10 11:36 2016
drwsrwxr-x 3 bitnami daemon 4096 Jan 10 11:18 2017
drwsrwxr-x 6 bitnami daemon 4096 Jan 10 11:36 imscrapidmailer-system
drwsrwxr-x 3 bitnami daemon 4096 Jan 10 11:36 revslider

Hello @franksurget

The permissions seems to be fine! “daemon” has writing permissions on that folder so you shouldn’t obtain those type of errors. The problem could be related with the plugin “gravityforms” according to:
http://www.inmotionhosting.com/support/community-support/wordpress/error-msg-upload-folder-not-writable

It could be trying to write on a different folder.

Best Regards,

Juan Ariza

Great stuff Juan! That solved the problem. The path for uploads was from the previous server.
Thanks so much.
Frank

Hello @franksurget

We are glad that you were able to fix the issue. If you have any other issue in the future, please do not hesitate to let us know.

Best Regards,

Juan Ariza

Hey Juan,

I have a bit of an issue. I am experiencing the same problem but I followed this guide:
https://docs.bitnami.com/general/how-to/troubleshoot-wordpress-issues/

I’ve set plugins and uploads to daemon:daemon and updating failed.

I then followed what you said here and set it to bitnami:daemon but it still failed, here is my output:

wp-content output
    drwxr-xr-x  2 bitnami daemon 4.0K Jan 17 01:40 ai1wm-backups
    -rw-rw-r--  1 bitnami daemon   28 Jan 17 09:29 index.php
    drwxr-xr-x  4 bitnami daemon 4.0K Jan 17 09:29 languages
    drwxr-xr-x  4 bitnami daemon 4.0K Jan 17 21:13 themes
    drwxrwxr-x  8 bitnami daemon 4.0K Jan 17 22:10 uploads
    drwxr-xr-x  2 bitnami daemon 4.0K Jan 31 03:15 upgrade
    drwxr-xr-x 37 bitnami daemon 4.0K Jan 31 09:32 plugins
plugins output
    drwxrwxr-x  6 bitnami daemon 4.0K Aug  4 12:06 simple-tags
    drwxrwxr-x  4 bitnami daemon 4.0K Jan 17 01:35 akismet
    drwxrwxr-x  6 bitnami daemon 4.0K Jan 17 01:35 google-analytics-for-wordpress
    drwxrwxr-x  3 bitnami daemon 4.0K Jan 17 01:54 all-in-one-wp-migration-unlimited-extension
    drwxr-xr-x 10 bitnami daemon 4.0K Jan 17 09:29 wp-store-locator
    drwxr-xr-x  3 bitnami daemon 4.0K Jan 17 09:29 leverage-browser-caching
    -rw-rw-r--  1 bitnami daemon   28 Jan 17 09:29 index.php
    -rw-rw-r--  1 bitnami daemon 2.3K Jan 17 09:29 hello.php
    drwxr-xr-x  6 bitnami daemon 4.0K Jan 17 09:29 advanced-custom-fields-pro
    drwxr-xr-x  2 bitnami daemon 4.0K Jan 17 09:29 rewrite-rules-inspector
    drwxr-xr-x  4 bitnami daemon 4.0K Jan 17 09:29 google-sitemap-generator
    drwxr-xr-x  9 bitnami daemon 4.0K Jan 17 09:29 duplicator
    drwxr-xr-x  5 bitnami daemon 4.0K Jan 17 09:29 live-css-js-code-editor
    drwxr-xr-x  5 bitnami daemon 4.0K Jan 17 09:29 shortcode-in-menus
    drwxr-xr-x  5 bitnami daemon 4.0K Jan 17 09:29 wp-slick-slider-and-image-carousel
    drwxr-xr-x  3 bitnami daemon 4.0K Jan 17 09:29 search-filter
    drwxr-xr-x  6 bitnami daemon 4.0K Jan 17 09:29 revslider_install
    drwxr-xr-x  8 bitnami daemon 4.0K Jan 17 09:29 admin-menu-editor
    drwxr-xr-x  7 bitnami daemon 4.0K Jan 17 09:29 facebook-conversion-pixel
    drwxr-xr-x  4 bitnami daemon 4.0K Jan 17 09:29 ga-google-analytics
    drwxr-xr-x  3 bitnami daemon 4.0K Jan 17 09:29 ftp-free-theme-file-creator
    drwxr-xr-x  8 bitnami daemon 4.0K Jan 17 09:29 mailchimp-for-wp
    drwxr-xr-x  7 bitnami daemon 4.0K Jan 17 09:29 custom-post-type-ui
    drwxr-xr-x  7 bitnami daemon 4.0K Jan 17 09:29 js_composer
    drwxr-xr-x  4 bitnami daemon 4.0K Jan 17 09:29 wp-store-locator-csv
    drwxr-xr-x  2 bitnami daemon 4.0K Jan 17 09:29 simple-301-redirects
    drwxr-xr-x  8 bitnami daemon 4.0K Jan 17 09:29 post-types-order
    drwxr-xr-x  3 bitnami daemon 4.0K Jan 17 09:29 duplicate-post
    drwxr-xr-x  2 bitnami daemon 4.0K Jan 17 09:29 simple-301-redirects-addon-bulk-uploader
    drwxr-xr-x  7 bitnami daemon 4.0K Jan 17 22:02 revslider
    drwxrwxr-x  6 bitnami daemon 4.0K Jan 31 03:14 addons-for-visual-composer
    drwxrwxr-x 10 bitnami daemon 4.0K Jan 31 03:14 all-in-one-seo-pack
    drwxrwxr-x  3 bitnami daemon 4.0K Jan 31 03:14 all-in-one-wp-migration
    drwxrwxr-x 16 bitnami daemon 4.0K Jan 31 03:15 jetpack
    drwxrwxr-x 13 bitnami daemon 4.0K Jan 31 03:15 unlimited-addons-for-wpbakery-page-builder
    drwxrwxr-x  8 bitnami daemon 4.0K Jan 31 03:15 wp-fastest-cache
    drwxrwxr-x  6 bitnami daemon 4.0K Jan 31 03:15 wp-mail-smtp

When I try and update a plugin it says: Update Failed: Could not create directory.

Please help!

Thanks,

Nitesh

Hi @nsharoff

I noticed you have the right ownership but you don’t have the proper permissions on some directories. Could you please run the command below and let us know if that solves the issue?

sudo find /opt/bitnami/apps/wordpress/htdocs/wp-content/ -type d -exec chmod 0775 {} \;
sudo find /opt/bitnami/apps/wordpress/htdocs/wp-content/ -type f -exec chmod 0664 {} \;

Best Regards,

Juan Ariza


Was my answer helpful? Click on :heart:

I am unexpectedly getting a permissions problem - seems similar to the above thread.

Specifically, using a Bitnami Wordpress instance, launched via AWS’ Lightsail: I need to modify a theme’s php file … however, I apparently don’t have permissions to do so - either through the Wordpress dashboard, or via Filezilla. I can log in, but can’t modify the files.

Please help.

Thank you,

Derek

Here’s a screenshot of running the ls command:

Hi @dsdohn1,

Thank you for the information. The permissions look good but can you run these commands again and try to update your theme later?

sudo chown -R bitnami:daemon /opt/bitnami/apps/wordpress/htdocs/wp-content
sudo chmod -R g+w /opt/bitnami/apps/wordpress/htdocs/wp-content

It’d be really helpful if you share a screenshot of the error message you obtain too.

Thanks