Knowledge Base
MilesWeb / Shared Hosting FAQ, Web Hosting FAQ

PHP Fatal error: Out of memory (allocated 20185088)

Approx. read time : 2 min

After installing/upgrading the WordPress the following error might occur:

PHP Fatal error: Out of memory (allocated 20185088) (tried to allocate 12288 bytes) in


On line 300

This error occurred as your account exceeded the allocated memory, to solve this issue you should increase the memory_limit for this account.

How Can I Increase It By Using SSH ?

Login to the server through SSH and then find the php.ini file on the server with the command mentioned below :

# php -i | grep php.ini


This command helps you to find the location of php.ini file on server. Open this file with your preferred editor.

# vi /usr/lib/php.ini



Increased it to 64 or as per your requirement and save the file with : ‘wq’

Restart the httpd service.

#/etc/init.d/httpd restart

How to Increase PHP memory limit in WHM ?

Go to Service Configuration >> PHP Configuration Editor

Change the value from 32M to 64M or 128M on memory_limit row.