Portal Home Knowledgebase 2. cPanel Web Hosting How to Increase your PHP Memory limit

How to Increase your PHP Memory limit Print

  • 0

PHP allocates a certain amount of memory when executing PHP scripts. When the allocated memory is exhausted, the PHP script shows a fatal error:

Memory Limit Error

PHP Fatal error: Allowed memory size of xxx bytes exhausted (tried to allocate yyy) in yourscript.php

Please note that the memory_limit value should be set to at least as big as post_max_size.

Follow These Steps to Increase memory_limit in cPanel

  1. Log into your cPanel from within your 4xhost client account.

  2. Locate and Select the PHP Version Menu:

    • In the Software section, find the PHP version menu.
  3. Click the Options Section:

    • Look for the options related to the php.ini values and scroll down to find memory_limit.
  4. Set the Value:

    • Adjust the memory_limit to the desired value. Once you’ve made the change, make sure to left-click anywhere outside the text input or drop-down box.
  5. Confirmation:

    • You will see a green box with a message confirming that the change has been applied.

To confirm whether your changes have taken effect, you can create a phpinfo.php file. Follow the steps in this guide to create the file and check the current memory_limit value.


Was this answer helpful?

« Back