When a PHP application running under your domain is producing an error about memory exhaustion, you can increase the available allowed memory for PHP in the cPanel interface.
Example PHP Error:
PHP Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 32768 bytes) in /home/cptest/public_html/wp-content/plugins/forminator/library/model/class-form-entry-model.php on line 1815
To increase the memory limit, you can use the following steps.
1. Login into your cPanel interface.
2. Navigate to the cPanel: Software -> MultiPHP INI Editor
3. Under the 'Basic Mode' tab, use the pull-down menu to select your domain.
4. Once updated, it will shows 'Path', 'PHP Version,' and 'Domain.' to allow you to ensure you are on the correct domain.
5. Locate the line for 'memory_limit', and increase the value inside the text box. Example: 32M is 32 Megabytes
6. Once the value is increased, click 'Apply' at the bottom.
The amount of memory allowed is different depending on the application. Some trial-and-error with the value may be needed. You will want to increase the value until the PHP error is gone.
To increase the PHP memory_limit server-wide, you would similar steps via WHM.
1. Login into WHM.
2. Navigate to WHM: Home -> Software -> MultiPHP INI Editor
3. Under the 'Basic Mode' tab, choose the version of PHP you wish to change globally.
4. Locate the line for "memory_limit" and increase the value inside the text box. Example: 32M is 32 Megabytes
5. Once the value is increased, click 'Apply' at the bottom.
The new amount of memory allowed will apply to all domains, subdomains, and addon domains that are using the selected version of PHP.