If you are working on PHP, then definitely you are familiar with Fatal Error Allowed memory size exhausted. This error occurs when your PHP script exceeds the default memory allocated for execution. Due to which your scripts stop working and shows the error message that allowed memory size exhausted.
To know the default memory allocated for execution, you can check the memory limit in your php.ini file.
php.ini file path on Ubuntu.
open your php.ini file
and search for memory_limit. Check how much memory is allocated, you can increase this memory limit to get rid of this error message.
In my case, I have allocated 128 MB. You can allocate as per your need.
NOTE: If you make any changes in php.ini file, you need to restart the apache webserver.
If you don’t want to edit php.ini file you can allocate memory limit in your php file as well.
// To allow unlimited memory size.
// To allocate 512 M memory
Fatal error: Allowed memory size Exhausted Error in WordPress
There are numerous cases where people, complain them that when they try to install and activate new plugin the error comes.
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 7680 bytes)
The simple solution of this problem is Open your wp-config.php file and include the following line
// Here i am allocating 128 MB you can do that as per your need.
In case your host does not allow increasing memory limit in that way. Then it will not work. Contact your host they might increase memory limit through php.ini file.