0

I have just migrated my website from hostinger to hostinger manually. And now when I upload any picture on my website the photos getting corrupted automatically. Although the picture was shown on my hosting but I am not able to use picture on my website.

my website link - https://sablog.in/

2 Answers 2

0

It sounds like the issue with the pictures being corrupted is happening during the upload process. This could be due to a number of reasons, including incorrect file permissions, insufficient server resources, or a problem with the upload process itself.

Here are a few steps you can take to try and resolve this issue:

Check your server resources: Ensure that your server has enough resources (e.g. disk space, memory, CPU) to handle the upload of large files.

Check file permissions: Make sure that the file permissions for your wp-content/uploads directory are set correctly, allowing WordPress to write to the directory. You can set the permissions to 755 or 777 depending on your server configuration.

Use a different upload method: Try uploading the photos using a different method, such as FTP, to see if the issue persists.

Deactivate plugins: If you have any plugins installed, try deactivating them one-by-one and uploading a photo each time to see if any of them are causing the issue.

Check image compression: Make sure that the images are not being compressed during the upload process, which could cause them to become corrupted.

If these steps don't resolve the issue, you may want to reach out to your hosting provider for further assistance, as the issue could be related to your server configuration.

0

I had this before too, but in my case, the size of the pictures were messed up. Try to disable lazy load, this sometimes cause problems. Also do not only change the read and write permissions, but also the ownership of the files of your wordpress installation.

chown www-data:www-data  -R * # Let Apache be owner
find . -type d -exec chmod 755 {} \;  # Change directory permissions rwxr-xr-x
find . -type f -exec chmod 644 {} \;  # Change file permissions rw-r--r--

After the setup you should tighten the access rights, according to Hardening WordPress all files except for wp-content should be writable by your user account only. wp-content must be writable by www-data too.

chown <username>:<username>  -R * # Let your useraccount be owner
chown www-data:www-data wp-content # Let apache be owner of wp-content

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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