Setting up a store but now you are stuck with the CSV import of your products? It happens and its frustrating when the error is not very descriptive.
I faced a similar issue and after a lot of digging found a solution for the issue I was facing.
Note that this guide isn't supposed to work in all cases, there may be many reasons why you may be seeing the same 500 Error in your console log when you try uploading a CSV. If you haven't checked your console log I recommend that you do because in most of the cases when it happens the front end UI of the import process screen won't show you anything.
Now this site is on a shared hosting service, namely Bluehost, yours might be on some other providers like GoDaddy etc. But if it is a Linux server using cPanel most of the steps are going to be similar.
I am not mentioning each and every step for every other provider as it will make this article very lengthy and not useful. I assume you already know your way around the hosting provider you are using.
Check cPanel and error log
cPanel is the common platform to have WordPress on, on these shared hosting providers.
Look for Advanced option or cPanel access on your hosting service's dashboard. Inside look for Error reporting or something similar,
Fatal error: Maximum execution time of 30+2 seconds exceeded (terminated) in /home2/galaopti/public_html/wp-includes/class-wp-image-editor-imagick.php on line 370, referer: http://sh020.global.temp.domains/~galaopti/wp-admin/edit.php?post_type=product&page=product_importer&step=import&file=%2Fhome2%2Fgalaopti%2Fpublic_html%2Fwp-content%2Fuploads%2F2021%2F02%2FGOEXCELupdated-2-newcsv-galaoptics-4.csv&delimiter=%2C&_wpnonce=5af8eddfab
You have to match the data and time on these logs to make sure it is what exactly causing the problem. If you are seeing this "Maximum execution time of 30+2 seconds exceeded" it means the server is timing out.
If you are using something like Bitnami or a DigitalOcean / Ubuntu / Linux WordPress installation you should be looking into the Apache or MySQL error logs.
Fixing the timeout issue
Did it work?
- Use a tool like Windows Image Resizer. Because I tried upload an image using Media uploader and I got this error
Post-processing of the image failed likely because the server is busy or does not have enough resources. Uploading a smaller image may help. Suggested maximum size is 2500 pixels.
It meant even the first image in my CSV was having trouble going through.
I got the Image resizer tool and ran a resize action in bulk for all of the images.
Now you do not have to change the values in CSV again, you can work smartly by resizing the images and keeping its original names, then on your server just upload the files again by replacing the old ones, thus the URLs you put in the CSV will stay the same. - Resize the image below 1600px (in width )