When I tried to upload a image of higher size(> 5MB) for my profile page, I got the below error. Although the file size is not acceptable, the page should not throw an error like this.
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 17280 bytes) in /home/iyaffle7/public_html/engine/lib/filestore.php on line 141
File: http://www.iyaffle.com/action/avatar/upload
Any thoughts on this? Am I missing something?
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by Raül Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- Trajan@Trajan

Trajan - 0 likes
- Purus@Purus

Purus - 0 likes
- DhrupDeScoop@Dhrup2000

DhrupDeScoop - 0 likes
- Purus@Purus

Purus - 0 likes
- DhrupDeScoop@Dhrup2000

DhrupDeScoop - 0 likes
- Cash@costelloc

Cash - 0 likes
- Rip@ripcord

Rip - 0 likes
You must log in to post replies.the image filesize is too big.
Change the settings in your php.ini or .htaccess to allow for larger files to be uploaded.
Yes. I do understand the issue.
We should be showing an user friendly error message "Image size too high" instead of throwning a fatal error like above. Does that make sense?
"Fatal error: Allowed memory.."
-- reported by PHP long before Elgg code gets control ;-)
~> 'we' @error = 'PHP'
Sad to hear that. Hope there is some fix instead of chaing the size in config.
'config' ? u mean php.ini !
'fix' ? where ? in php ??
try -- http://php.net/manual/en/function.set-error-handler.php
there *is a way out ;)
you code - i will test
Tidypics has complicated code that tries to predict how much memory the resize operation is going to take and displays an error message if it thinks it is going to crash. It's still not a guarantee.
Switching to command line ImageMagick fixes this.
My host has a 10s script timeout, wsd (php fatal error) when user tried to upload an avatar that exceeded this. This fixed it for me:
register_shutdown_function('shutdownFunction');
function shutDownFunction() {
$error = error_get_last();
if ($error['type'] == 1) {
register_error(elgg_echo('avatar:upload:timeout'));
forward(REFERER);
}
}