Topic: Memory management/buffering php issue - expert help needed
Hi Folks, I need the experts on this one... will you please check me on this?
I am getting the following error message when I pump up the file size allocation in PBB Gallery, i.e., if I set the maximum file height to somewhere over 4000, the following is returned:
Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 2087 bytes) in /xxxxxx/public_html/forumdirectory/include/functions.php on line 888
What I am trying to do is allow for the possibility of very tall images (snapshots taken from scrolling documents). The actual file sizes are only about 250kb.
I suspected the problem is something to do with output buffering and using "imagecreatetruecolor" in php, and after reading this (http://us3.php.net/manual/en/ref.outcontrol.php#54102) and trying it out I have at least confirmed it is definitely related to 'memory need' for processing the image, (and possibly output buffering, but I am uncertain there). I.e., if I apply <code: php_value memory_limit 50M> to my htaccess file I can cause it to work (meaning the file uploads and processes sucessfully).
Of course, I am very concerned about leaving a memory limit setting so high `8^P. I cannot fathom this is truely necessary?! There must be some other way to be addressing 'the need' here, but I need your insights to help sort out the understanding to the proper method/approach to use (?). Do I try some sort of output buffering 'in chunks' or something (but this isn't really to do with outputting)??
Over my head... Really need some expert advice here. Please help!
Cheers,
TwoHawks
PS: Please don't flame me for cross-posting. I originally posted about this inside the pbb galley topic at punres, but my sense is that this is not really getting the attention it requires 'being buried' in there (where it seems it has not been seen by those who may be able to make a differnce ;^). So I decided it needed its own topic.
Love is the Function
No Form is the Tool