One of the case you need to remove memory limit in PHP will be that your application use memory dynamically and sometimes faces out of memory. In that case, you can simply remove memory limit in your PHP application by setting memory_limit=-1 in /etc/php.ini

Just sudo vi /etc/php.ini and change the value of memory_limit

memory_limit = -1