Rate this article

Fatal error: Allowed memory size of 20971520 bytes exhausted (tried to allocate 9144 bytes) in /xxxx

Rating: 5.0/5 (1 vote cast)

 Fatal error: Allowed memory size of 20971520 bytes exhausted (tried to allocate 9144 bytes) in /xxxx/local/home/xxxx/includes/common/lib/image/KT_Image.class.php on line 1247

When you receive this error while uploading a file (image or other) you most probably sitting with limitations on your php configuration on your server.

Do the following.

Create a php page, call it what you want and add this code to it;

 

<?phpphpinfo()?>Upload it to your server and run it look for the following sections

 

upload_max_filesize = xxMmemory_limit = xxpost_max_size = xxM  

where xx is the maximum allowed size.

Make sure your file you are trying to upload is below these settings.

How to fix the limits?

Depending on what server configuration (shared, VPS or dedicated server) you have you can edit the php.ini file to increase the settings.
In most cases you will not be able to change these settings in a shared environment because it uses more server resources and your ISP is limiting these to allow a harmonious existence between all sites on the server.

If you are on a VPS or dedicated server, update your global php.ini and remember to restart "Apache" for it to take effect.

Another possible problem might be a corrupt file.
You are uploading an image and specifies it as a jpg file, the server tries to re-size or do something with it and cant because the file is corrupt.  You might end up with either a out of memory error or the process might simply time-out.

Other issues:

Recently I transferred a joomla site to my server. The site worked perfectly on the old server under a dual installation of php 4.xx and 5.29.  My server only have php 5.29 installed.  I received an out of memory error displaying a menu module...
The problem was nothing to do with the menu, in fact it ended up being a problem with a php directive in the php.ini file forcing the site to run under php 4.x.  Remove the line in the php.ini and problem solved.

Log-files

There are a couple of log-files you can look at.
Server logs, depending on what hosting environment you are on, they might not be available to you as the users.
Ask your host to take a look at these.
"Site Logs", inside the root folder of the file you are trying to execute on the site you should find an error.log file.

 

 

Adobe

Free PositiveSSL and WhoisGuard with Every Domain Purchase
ionCube Online PHP Encoder
XMS Systems

Although we try to ensure all the articles submitted are valid it is your responsibility to make sure you have backups before you use these suggestions on your pc or websites.
We do not take any responsibility for any data-loss, loss in functionality or any problem that might arise in what-ever way or form by making use of the information on this site.

"Friends of Interakt" has no connection to the Adobe Interakt Company