How to increase memory limit for PHP in cPanel
PHP allocates a certain amount of memory when executing your PHP scripts. Your PHP script will exit and throws a fatal error if it has exhausted all the allocated memory.
PHP Fatal error: Allowed memory size of xxxx bytes exhausted (tried to allocate yyyy) in yourscript.php
Limiting memory allocation prevents PHP from consuming too much memory from the system. However, you can configure PHP to increase the memory limit if your script or application requires more memory for execution.
Related: How to increase PHP memory limit
You can configure memory_limit option for PHP in cPanel hosting from the dashboard.
Steps to change memory limit for PHP in cPanel:
Log in to your cPanel account.
Click on Select PHP Version from the Software section.
Click on Options tab at the top of the page.
Find memory_limit option and click on the dropdown icon.
Select the desired memory limit from the list.
Wait for the change to be saved automatically.