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:
[07-May-2020 14:35:33 UTC] 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.
- Login into your cPanel interface.
- Navigate to the cPanel: Home -> MultiPHP INI Editor
- Under the 'Basic Mode' tab, use the pull-down menu to select your domain.
- Once updated, it will shows 'Path', 'PHP Version,' and 'Domain.' to allow you to ensure you are on the correct domain.
- Find the line for 'memory_limit', and increase the value inside the text box. Example: 32M is 32 Megabytes
- 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.