I have checked every single solution on the internet with no avail.

On the same server and using the same Drupal version 8.8.4, I have two completely separated sites.

Site A is working as expected with no issues at all while Site B is encountering the below explained issue.

Not sure if this might help but Site A has been created 2 years ago and continuously updated until the current stable version (8.8.4) while Site B has been created a week ago using version (8.8.4).

The issue:

Using the Profile picture image field (user_picture) shipped with Drupal Core at "/admin/config/people/accounts/fields", I am trying to upload an image of myself (Uid:1 - Administrator)

After uploading the image:

  1. The thumbnail to preview the image at "/user/1/edit" page is not displayed.

Edit Page

  1. The Image at "/user/1" page is not displayed if an image style is applied to it at /admin/config/people/accounts/display, however if the image style is set to Original Image, the image is displayed correctly.

View Page

What I have tried so far:

  1. The permissions of all folders are correct, even I have set them to 777 using chmod -R 777 web so now all folders & files are set to 777.

  2. The .htaccess file at /web/sites/default/files/styles is correct, even I have replace it with

<Files *> SetHandler none </Files>

  1. I was using a sub-theme of Bartik theme, but I have uninstall it and switch back to use the base Bartik Theme.
  2. At admin/reports/status page, I have the below:

_ FILE SYSTEM: Writable (public download method)

_ GD LIBRARY: bundled (2.1.0 compatible)

_ GD LIBRARY PNG SUPPORT: bundled (2.1.0 compatible)

_ IMAGE TOOLKIT: gd (GD2 image manipulation toolkit)

  1. I am running on VPS and not a shared host.

  2. At /user/1 page, When I inspect the broken image, I found that the src of the image is: /sites/default/files/styles/profile_picture/public/profile-pictures/Administrator.jpg?itok=XMAlUZVe, however, in "File Manager" there is no trace of such image."

  3. I have tried to manually upload an the image at /sites/default/files/styles/profile_picture/public/profile-pictures/ and suddenly the image is visible at /user/1 page.

  4. No any issues logged at: admin/reports/dblog

  5. The above error is for any image field whether was placed to an user entity, Taxonomy entity or node entity.

There is something preventing my site from generating image styles for every uploaded image, Any help please ?

  • This sounds like a directory permissions issue somewhere. – Kevin Mar 25 at 13:57
  • I have 777 all directories and sub directories and still with no avail. Is there a drush command to 777 all folders under my domain name ? maybe this will help !!! Also I have installed this project under a free domain name example.tk, maybe this could be the issue ? – Ta La Mar 25 at 14:20
  • I have set the permission of all folders, sub-folders and files to 777 using chmod -R 777 web – Ta La Mar 25 at 18:11
  • How about the ownership of the file system? (chown -Rf user:group .) Try set it to the web user ex apache: chown -Rf www-data:users . – Rick B Mar 25 at 18:46
  • @RickB but I have 2 different sites on the server other than this site and the picture are being displayed as expected – Ta La Mar 25 at 19:11

Finally the support team at Inmotion Hosting (My Hosting Company) solved this issue for me by:

  1. Disabling "Accelerate Static Content" in the Nginx cache manager.
  2. Set the permission of /web/sites/default/files/styles to 775 instead of 777.

And now everything is working as expected.

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.