The memory limit is the maximum amount of memory the process can use. If you exceed it, the process fails and Apache reports an HTTP 500 error. By default, Memory Limit in WordPress is 64M. This error occurs sometimes when you try to upload or install plugins, themes that require more memory than the default allocated memory. The Solution of memory exhausted error is to increase your PHP memory limit.
- Dashboard > plugins > Add New > Search
- Install & Activate File Manager plugin.
- Dashboard > Wp File Manager > Edit wp-confg.php in the root directory.
- Right click on wp-confg.php, than click on the code editor.
- Add the following code before /* That’s all, stop editing! Happy blogging. */:
12define('WP_MEMORY_LIMIT', '256M');define( 'WP_MAX_MEMORY_LIMIT', '256M' );
Click Save & Close to apply new memory limit size.
Using shared hosting then you have to
- Go to: cPanel > Software > Select PHP version
- click on Switch to PHP version
- Edit memory limit setting and change it to 256M from the drop-down
- Click Save to apply new memory limit size.