forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 upload => Topic started by: allvip on July 05, 2013, 08:34:02 am

Title: Fatal error: Allowed memory size of X bytes exhausted
Post by: allvip on July 05, 2013, 08:34:02 am
I had the same problem on my shared host:

Fatal error: Allowed memory size of xxxxxxxx bytes exhausted (tried to allocate xxxxx bytes ) in /gallery/include/picmgmt.inc.php on line 439  - gallery is the name of my coppermine directory


I can not edit php.ini (my host did not allowed me access to php.ini) and in coppermine docs says but I can not do nothing if I don't have access to php.ini.

I FINALLY found the solution:

I edited the file include/picmgmt.inc.php ( because the error shows but I need to allocate more memory size in picmgmt.inc.php ) like this:

ad this code:

Code: [Select]
ini_set ('memory_limit', '150M');
at the begining of the file after <?php :


now I can upload 6000x4500 - 4mb - pixel image.before my limit was 1400px image. A big file needs more server memory.

Another method it to use ImageMagick: http://forum.coppermine-gallery.net/index.php/topic,77929.msg376673.html#msg376673 (http://forum.coppermine-gallery.net/index.php/topic,77929.msg376673.html#msg376673)

Config - File settings - Method for resizing images - choose ImageMagick.

DETAILED TOPIC ABOUT "memory size of X bytes exhausted :

No further photos can be added to an album - batch add and http upload fails:   
http://forum.coppermine-gallery.net/index.php/topic,77929.0.html (http://forum.coppermine-gallery.net/index.php/topic,77929.0.html)

Title: Re: Fatal error: Allowed memory size of X bytes exhausted
Post by: allvip on July 05, 2013, 08:46:51 am
If 150m is not ok for you then ad 200 or more.

Many shared host allows to edit php.ini, but the host I use to have, did not.
Title: Re: Fatal error: Allowed memory size of X bytes exhausted
Post by: haters on July 10, 2013, 06:10:23 pm
I seem to have this error as well. What you've said to do hasn't helped. Just gives me an error and I can't even access to upload.php page.
Title: Re: Fatal error: Allowed memory size of X bytes exhausted
Post by: phill104 on July 10, 2013, 06:19:20 pm
Not all servers support the above method. It can be done via the above, via a .htaccess file or via a php.ini file. Best bet is to speak to your host and see what they suggest.
Title: Re: Fatal error: Allowed memory size of X bytes exhausted
Post by: allvip on July 13, 2013, 10:25:18 pm
I seem to have this error as well. What you've said to do hasn't helped. Just gives me an error and I can't even access to upload.php page.

Can you please post the full error path like this:

Fatal error: Allowed memory size of xxxxxxxx bytes exhausted (tried to allocate xxxxx bytes ) in /gallery/include/picmgmt.inc.php on line 439

Does the error says memmory exhausted in picmgmt.inc.php or your error is diffrent?
If is not picmgmt.inc.php then ad the code in te file showed in the error.

If you have access to ftp upload on your server you can use filezilla https://filezilla-project.org/ (https://filezilla-project.org/) to overwrite the uploded images with the real size images.
Title: Re: Fatal error: Allowed memory size of X bytes exhausted
Post by: allvip on December 06, 2014, 02:23:46 pm
Always ask your host before you buy if you have can edit to php.ini, if you can have .htaccess for hotlinking etc.