6

No idea why but my local install of CraftCMS (in a MAMP environment) won't let me upload JPGs. PNG, GIF, even TIFF works (just for the heck of it). When I select the file in the browser dialog, it closes then shows the loader bar and spinning gif anim. No progress is ever shown and the spinning continues eternally. http://cl.ly/image/1a2l1W2t1P1x

  • Craft is up to date
  • Uploads on remote install works perfectly
  • Getting this error net::ERR_EMPTY_RESPONSE along with these details: http://cl.ly/image/3D2w1F2l2O1x
  • Checked my php.ini file and it allows JPG uploads

I realize this may not even be an issue with Craft but a server side issue. I just have no idea how to troubleshoot this. Any help would be much appreciated!

I also checked my phperrors.log file and I got only this which is from back in early Dec and seemingly unrelated.

  [08-Dec-2014 02:47:37 UTC] PHP Fatal error:  Allowed memory size of 33554432 bytes exhausted (tried to allocate 9792 bytes) in /Applications/MAMP/htdocs/sucasa/craft/app/vendor/imagine/imagine/lib/Imagine/Gd/Image.php on line 199
3
  • Check your craft/storage/runtime/logs files for any entries that begin with [error] or for the existence of a phperrors.log file, which will hold any PHP fatal errors.
    – Brad Bell
    Commented Dec 29, 2014 at 3:44
  • Added my error (though seemingly unrelated) to the ticket. Thanks! Commented Dec 30, 2014 at 4:39
  • The same thing is happening to me. I've bumped my memory_limit up to 256MB, and checked my Craft logs for errors, but nothing jumps out. Has any one solved this issue?
    – user1153
    Commented Jan 6, 2015 at 5:21

4 Answers 4

13

I had this same issue and resolved it (at the suggestion of Craft CMS support) by enabling ImageMagick in the php.ini and restarting MAMP PRO.

Per the MAMP PRO 3.0 user guide:

The ImageMagick PHP module is included by default, but you must enable it inside the php.ini template file. Remove the ‘;’ from the following line. ;extension=imagick.so

3
  • 1
    On MAMP PRO, enabling imagick solved the problem. Commented Jun 7, 2016 at 18:22
  • Thanks - same problem on MAMP PRO 4.1.1 and installing ImageMagick solved the problem. Thanks : )
    – JKM
    Commented Jul 23, 2017 at 6:38
  • Enabling Imagick solved this issue for me, also. In MAMP 4, you can easily enable Imagick/ImageMagick under the "Extensions" checkboxes in the PHP settings. Commented Oct 30, 2017 at 17:59
8

I had the same issue and solved it. This seems to be an issue with the exif lib. Try to disable mbstring overloading by setting

mbstring.func_overload = 0

to your php.ini or

php_admin_value mbstring.func_overload 0

in your apache virtual host configuration.

Hope that helps

-Oliver

1
  • That worked for me, thanks. To layout some history. I upgraded my linux server to a dedicated. Including mysql 5.7 (mariadb 10.2.8), nginx, centos 7.3, php 7.1. After all that, I discovered a few odd things like this image upload issue. So it's something of an odd issue but whatever it is, the solution works.
    – Vin
    Commented Aug 22, 2017 at 22:50
4

I kept bumping into the same kind of issue. Even when I applied a fix mentioned here or in another topic. After a while the same issue would arise again.

What finally did the trick for me - in MAMP, was to add additional parameters to the host-file.

In MAMP, select the desired host. On the right side choose the Extended tab. Where it says 'Additional parameters for ' add this line:

AddHandler fastcgi-script .fcgi

This looks a lot like the solution mentioned here, but for some reason it didn't stick.

Restart server (in later versions MAMP restarts itself) and you should be good to go!

1

From your error, I think the fact that only JPG files are failing is a coincidence.

Perhaps when you were testing the PNG, GIF and TIFF files were all relatively small, but the JPG files were large enough to bump you over the 32MB limit assigned to PHP in your php.ini file.

Regardless, if you open up your php.ini file, find the memory_limit setting, and bump it up to 128MB (or 256MB if you're feeling saucy), the problem should go away.

You might have to restart your web server before that setting takes effect.

2
  • I only wish this were the case... no matter the size .jpg files don't work. I've tried .jpgs at 100kb and 20mb and get the same issue. Commented Dec 30, 2014 at 20:08
  • Can you reproduce the issue with devMode enabled, zip up your craft/storage/runtime/logs folder and send it to [email protected]? I'll update here with anything we find.
    – Brad Bell
    Commented Dec 30, 2014 at 22:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.