Resolving Generic “HTTP Error” in the WordPress Media Uploader

Over time I have built, edited, and contributed to hundreds of WordPress websites. But it wasn’t until an odd scenario of events this year that I ran into a rogue, yet vague error in WordPress “HTTP error” …

The Generic “HTTP error” during a WordPress Upload

wordpress upload http error

The WordPress HTTP Error Upload Problem:

  1. Uploading images caused a generic”HTTP Error” in the WordPress Upload.
  2. The raw files was getting uploaded to the WordPress website but WordPress wasn’t crunching the image or producing any of the alternate image sizes.
    1. The thumbnails in the Media Gallery were also missing
  3. No PHP error was being logged in the error_log file

Fixing the WordPress HTTP Error

After some research and review I found a plugin that was shared on github that resolves a conflict. The underlying issue is that some website hosts and WordPress have a conflict on the WP Image Editor class. This seems to be a rare issue. I have only run into this on one website.

The solution was to apply to create this WordPress plugin and add it to the WordPress having the issue. Once the plugin was activated, the HTTP error was gone on the next upload attempt. WordPress media uploads returned to the proper crunching and optimization process.

Resources

Solution to MySQL error #2006 in XAMPP

I recently ran into the MySQL error #2006 when importing a MySQL database into XAMPP for testing locally.

Error 2006: MySQL Server has gone away.

My research led me to understand this error occurs when your MySQL connection times out while waiting for a response.

After a few Google queries I found the solution for my MySQL error #2006 to be in editing the my.ini for MySQL in XAMPP.

Steps for MySQL error 2006 solution:

  • Edit the “my.ini” file found at “:\xampp\mysql\bin\”.
  • In the my.ini file, edit the “max_allowed_packet” by increasing the value.
    • XAMPP default value is 1M. I updated it to 10M.
  • Save the my.ini file.
  • Restart your MySQL and Apache server in XAMPP.

This solution worked for me. Hopefully it may helped another soul stumped by a pesky 2006 MySQL error code in their local XAMPP environment.