6

Just giving Craft CMS a test drive. Setup a local site using MAMP Pro. Got the basic site up and running ok, admin as well. Then i wanted to try out image assets, so I created an Asset Source for images, local folder. Created my "images" folder under the public dir, and specified "images/" as the file system path for my asset source. Added an image transform.

Then I try and upload an image, and it fails, with the ajax call "/index.php/admin/actions/assets/uploadFile" returning a 500 error. I tried checking the log files but there are no error messages relating to this failed ajax call.

Any ideas what I am doing wrong? Thanks!

7
  • If you don't see the underlying error message in craft/storage/runtime/logs, try checking Apache's error log files. Maybe it's a permissions issue on the images folder?
    – Brad Bell
    Jul 23, 2015 at 6:02
  • true! i should've checked before posting. but unfortunately nothing in the apache error log (/Applications/MAMP/logs/apache_error.log). then tried all sorts of permissions on the images directory: 700, 770, 777, 775, 755, and none of them worked. on other local dev sites where i upload image files 755 has worked (with apache running as exactly the same user etc). running out of options... Jul 23, 2015 at 6:18
  • am i right in thinking i can use a relative path for the asset source ("images/") if that dir exists underneath the public dir? Jul 23, 2015 at 6:18
  • Yeah, that should be fine. Maybe try changing it to an absolute path just to rule things out?
    – Brad Bell
    Jul 23, 2015 at 6:19
  • yeh, did that but to no avail :( Jul 23, 2015 at 6:22

1 Answer 1

6

ok i solved the problem by following the answer to this question here:

FastCGI error when accessing a local development site using MAMP Pro

even though the ajax call didn't generate an apache error at the moment it was called, it must have been something to do with fastcgi in general, cos the answer to that question worked for me!

i have never had this problem before, and i have heaps of other local sites which also do file/image uploading. so strange. and uploading of other file types (eg pdf) into the assets area worked no problem! doesn't make sense. but as a developer, sometimes you just accept the mystery of it all...

UPDATE

the problem started rearing it's ugly head again, even though i hadn't touched the httpd.conf edit i did to fix it. so i just deactivated the fastcgi module on the MAMP Pro dashboard. et voila, we're back in business....

2
  • Ahh, nice catch. Got to be some weird MAMP bug, I suspect.
    – Brad Bell
    Jul 23, 2015 at 17:29
  • Great find. Such a random error. You saved me hours of troubleshooting. Many thanks!
    – Ian Young
    Nov 25, 2015 at 13:35

Your Answer

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

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