Solved it by myself, after turn on flarum debug as instructed.
found 2 issues:
1. need to change php.ini: upload_max_filesize = 2M to a bigger number since my img is > 2M
2. after step-1: flarum debug showed:
{
"errors": [
{
"status": "422",
"code": "validation_error",
"detail": "The avatar may not be greater than 2048 kilobytes.",
"source": {
"pointer": "/data/attributes/avatar"
}
}
]
}
so looks like avatar have to be < 2M, after change my img size, it works.
to summary, I hit 4 bumps on the road:
1. change nginx.conf: client_max_body_size 20m; , this solved nginx error
2. install php-imagick, not sure how this helped, I just followed the suggestion.
3. according to flarum debug message, change php.ini: upload_max_filesize = 2M to larger number, still have error.
4. finally flarum debug told me avatar has to be < 2M. so resize my img to < 2M, it works at last.
I hope to see the last error msg first, so it will save the steps make nginx/php works, but still has to change my img size < 2m , which make nginx/php trouble shooting/change unnecessary.
hope my post could save others some step.
to Flarum folks:
1. the 'debug' option at flarum config.php is awesome! it prompt me step by step moving forward. I like Flarum.
2. a suggestion: if there is a 'tips' session somewhere in your docs, just highlight some tips like this avatar has to < 2M, it could make Flarum newbie's life much easier.
good job Flarum folks.