Your PHP script will exit and a fatal error will be thrown if it has exhausted all the allocated memory.

PHP Fatal error: Allowed memory size of xxxx bytes exhausted (tried to allocate yyyy) in yourscript.ph

This is to protect the system in the case that a rogue PHP script or application consume more memory that the system can handle.
You can fix the issue by allocating more memory to your PHP scripts and there are a few ways to do this.

For cPanel hosting, you can change the memory limit configuration from your cPanel dashboard.

Steps to change memory limit for PHP in cPanel:

  1. Log in to your cPanel account.

77e650b900fdac4863686c0e30214e843b195b8e?t=952363c6b8d2aaaabd65a935cbe19944
2. Click on Select PHP Version from the Software section.

30558111827b172b00a424aacecadb00cadff47b?t=5d7d507447ac304123bf153d3709d3e2 3. Click on Options tab at the top of the page. 

4. Find memory_limit option and click on the dropdown icon.

081ac8f98b6c6bd6bb55c51ce3248262efb5ac05?t=4f2335ebb3ac8e5a4a462b7f3cf89e87 951dcb41d3f16cdcd70e4ad9c7390bdebe4b6d6b?t=29b7d3ad941ae76788b9ffd0f36a02a1 5. Select the desired memory limit from the list.

40d389baae3123e6ac2f34012aa16e4d688a4830?t=8e51dda510769990719c2781d9d8a426 6. Wait for the change to automatically be saved.

8e09c2c8ceac77507e9bfd463591dd83f035727a?t=d6cce8bd6b6f7ea9b41ea30df1e2dfce

Comments

Confirm Submission

Please enter the text from the image in the box provided; this helps us to prevent spam.