Fatal Error: Allowed Memory Size – Fixing the Problem

The amount of RAM allocated to your website (or to scripts that run on behalf of your website) is set in the PHP settings according to the hosting plan chosen by the client. But for some operations this memory may not be enough for the script to run properly. Then the message fatal error allowed memory size appears on the screen.

The error occurs in the following cases:
- when modules and scripts are not optimized;
- when uploading complex images to the website;
- when processing large XML files;
- when performing other resource-intensive operations.
As mentioned above, the error appears when your website, while opening a page, requests more RAM than the php memory_limit parameter set for the hosting plan chosen by the user.
How to fix fatal error allowed memory size
There are several ways to fix the error. If your hosting plan already sets a fairly large memory_limit value but the error still appears, we recommend the following:
- if you don't have access, add the php_value memory_limit directive with the required amount of memory to the .htaccess file in the website's root folder.
- If your website uses WordPress, edit the wp-config.php file and add this line:
define('WP_MEMORY_LIMIT', 'xxxM');, where xxx is the PHP memory_limit value.
If the recommendations above did not fix the error, contact hosting professionals for technical support. UkrHost specialists will ensure efficient and stable operation of your website, making it available to all users in Ukraine. Take the opportunity to get high-quality hosting on favorable terms, which will help you retain and grow your website's audience.