Why do I receive "Internal Server Error" and how to fix it?

Resources limit

This kind of error appears usually on websites hosted on shared hosting solutions. Such hosting usually has a certain number of CPU threads that can run in parallel and when this limit is reached it will start returning such "Internal Server Error" messages.

Here are the usual steps to address this kind of issue:

  1. make sure you don't run already a CPU&HDD intensive task like making a backup with your website. If you're running such a resource-intensive task just wait for it to finish before trying to run the image optimization again
  2. check out your plugins and see if you have 2-3 plugins that you could temporary deactivate. Once you deactivated them just try again to run ShortPixel Image Optimizer, on most occasions doing this frees up enough CPU resources to be able to finish optimizing the images on your website. 

Multisite

Sometimes, if you are running a multisite, you will see this message or a similar one:

Error: There was an error and your request was not processed. (20190603_190924.jpg: Could not download file (500 Internal Server Error).) 

The error may be related to the upload paths. Basically when you upload to a subdomain (if you’ve configured the secondary site in a WP multisite to be a subdomain) by default the upload path in the multisite’s database (it’s just one database) is still set to the main site. This means the images don’t appear in the subdomain’s media library (only when you click on them to edit, but this doesn’t make a difference) and the subdomain hasn’t been told how to ‘download’ them from the main site upload location.

Warning: make a backup of your database first!

The possible solution is to access the database, table wp-options, look for ‘upload path’ and change this. This is what you will probably see:

/var/sites/a/yourdomain.com/public_html/wp-content/uploads

Change it to 

wp-content/uploads

And it should work. Both the main and sub-domain can access this path.

Still need help? Contact Us Contact Us