Photo Upload Error

PHP CodeI recently installed a new WordPress website on my server specifically for photos. When I was testing out themes and stuff and was uploading photos taken with my 16MP camera I got an error saying…Fatal error: Out of memory (allocated 70254592) (tried to allocate 19008 bytes)… I googled the problem to see what was wrong and I found out that it was due to PHP’s memory allocation limit. Some said that it would be fixed if I increased the memory_limit in the php.ini file from 16M to 32M or by adding define('WP_MEMORY_LIMIT', '32M'); to the wp-config.php file. I tried these. I increased the memory to 256M and I still got the same error. I noticed that the photo would be uploaded actually but it would not be resized as if it couldn’t process it due to the large size. I tried the same process on my locally installed WordPress, it could resize it but it would take a few seconds longer than usual, so this was definitely due to the server. Well I found a workaround for this. In your WordPress dashboard you can go to Settings > Media and set all the Size boxes to zero to disable resizing. But this is inconvenient for some of us, in that case you can decrease the dimensions of your photos before uploading them. I decreased the width of my photos by a 1000 pixels and it worked. No errors, no headaches. You can do this with any photo editor capable of resizing photos. I use ACDSee 12 for this purpose. Hope you will solve your problem too 🙂

Leave a comment

Your email address will not be published. Required fields are marked *