Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP Fatal error: Out of memory (allocated 80740352) (tried to allocate 12352 bytes) in

I get this error when users are uploading images on my site.

error msg is "PHP Fatal error: Out of memory (allocated 80740352) (tried to allocate 12352 bytes) in /home......." How can I fix this using php.ini?

Here is my current upload php.ini settings

upload_max_filesize = 2000M ;
post_max_size = 2000M
max_file_uploads = 8

Any ideas what else I need to add to solve this error?

like image 504
daza166 Avatar asked Jun 11 '11 07:06

daza166


1 Answers

set_time_limit(0);
ini_set('memory_limit', '20000M');

To the top of your script. Change the 20000M accordingly.

like image 182
srikanth Avatar answered Oct 22 '22 00:10

srikanth