How to fix errors when uploading images in WordPress

When uploading images in WordPress, certain error messages may appear. One of the most common problems that many users experience is the ” http error” or“Fatal error: Maximum execution time of 30 seconds exceeded ” error.

This error is often related to the execution time limit or memory limit of PHP on the server, especially when uploading large images.

A common way to solve this problem is to add a specific code to wp-config.php. Specifically, add the following two lines

define( 'WP_MEMORY_LIMIT', '256M' ); 
set_time_limit(120);

WP_MEMORY_LIMIT extends the memory limit of WordPress to 256MB. On the other hand, set_time_limit(120) extends the PHP execution time to 120 seconds.

While these changes are expected to avoid errors when uploading large images, depending on the configuration and situation of each server, this may not be enough to solve the problem. In that case, you may want to consult your hosting provider.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top