Fix HTTP 500 Server errors for /wp-json/ or WP API requests on Wordpress on any shared hosting or cloud hosting.
Recently on one of our testing WordPress website on Digital Ocean encountered 500 errors in Gutenberg for
After troubleshooting, we found that our server memory size was not enough.
By default, the Digital Ocean App Platform build-pack allocatesÂ 128 MB of RAM per PHP request.Â We increased the memory limit to 512MB and the
/wp-json/ 500 error was resolved.
To increase WP memory limit, add
define( 'WP_MAX_MEMORY_LIMIT', '512M' ); to your WordPress
Depending upon your traffic (internal and visitors), running scripts or plugins, and theme complexity, availability of excess RAM, you might want to increase it to 1024MB or more.
If you’ve WP installed on your droplet via Digital Ocean’s marketplace image, you can locate your
wp-config.php file at /var/www/html folder. Follow this guide to edit or update WP files on Digital Ocean without SSH client.
Ensure that you’re not leaving basic post fields empty. While reproducing this error, we found another issue in our case. We left the post content field blank and same issue appeared again. We filled the content field, updated or saved the post, and the 500 error was resolved.
The basic post fields includes title and post content.
Our standardized editorial process ensures right, timely, and healthy updates to our content. Your honest opinion drives significant improvement to our content. We appreciate you are taking time to share that.