MyBB Community Forums

Full Version: Unable to view avatars (mybb, php5, nginx)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi
On my server I tried to upload avatar, and got error "Your avatar was unable to be resized". I tried everything I found at google. Finished with installing php5-gd. Error has gone, but after uploading avatar it's look like this:
[Image: V7rJ5pQ.png]

[Image: YghQ38d.png]
(I changed maximum dimensions temporarily to check if it's error with dimensions - obviously it's not)  

GD appears to be installed and recognized by php5 in phpinfo().
./uploads/avatars/ is 777
If do you need additional informations, please let me know, I'll try to post them ASAP.
You can suggest the simplest solutions, who know what's wrong? Maybe some silly boolean variable?
Please, help me Sad

PS. Interesting... Before installing php5-gd uploading avatar (smaller than maximal dimensions) from web was working... Now it's not. Getting the same blank avatar Confused
Are you able to upload attachments?
Thank you for your answer Smile When I tried to upload some attachment from smartphone, I got nginx 413 error: "request entity too large".
Now I'm at home, and tried to upload images in .png into some thread (sorted from largest to smallest):
- 3840x2160 - 14113 KB - failed (timed out)
- 1920x800 - 2525 KB - failed (nginx 413 error, as mentioned)
- 1366x768 - 2095 KB - failed (nginx 413 error)
- 1440x900 - 1306 KB - failed (nginx 413 error)
- 1280x720 - 1035 KB - failed (nginx 413 error)
- 1280x720 - 1008 KB - at first failed, mybb said that is limit for png files to 500 KB. At this point I increased limit and tried again (those which failed too - they all failed again), and after that - success
- 1280x720 - 1001 KB - success
- 1600x1200 - 269 KB - success

My avatar however was 908x756, but only 58,1 KB size. I tried upload it as attachment, and it succeed.

As we can see, there must be something with 1024 KB limit, but where? These are my php settings about file uploading:
;;;;;;;;;;;;;;;;
; File Uploads ;
;;;;;;;;;;;;;;;;

; Whether to allow HTTP file uploads.
; http://php.net/file-uploads
file_uploads = On

; Temporary directory for HTTP uploaded files (will use system default if not
; specified).
; http://php.net/upload-tmp-dir
;upload_tmp_dir =

; Maximum allowed size for uploaded files.
; http://php.net/upload-max-filesize
upload_max_filesize = 50M

; Maximum number of files that can be uploaded via a single request
max_file_uploads = 20


All images are trying to upload, I see that on my Internet meter:
[Image: 5flZfoZ.png]

If it's helpful, I can post my forum address.
Best regards
Right, so we sort of have the issue, but I dont know how to solve it - I know nothing about nginx.

I found this post: http://www.cyberciti.biz/faq/linux-unix-...too-large/

and this:

http://cnedelcu.blogspot.nl/2013/09/ngin...large.html
Okay, I solved problem with attachment limit, but I still have problem with avatar. I tried to upload it again now, but no luck.

http://i.imgur.com/xbRbTcv.png

user@host:~$ sudo ls -alh /var/www/html/mybb/uploads/avatars/
total 20K
drwxrwxrwx 2 root     root     4.0K Sep 24 14:41 .
drwxrwxrwx 4 root     root     4.0K Sep 24 13:28 ..
-rw-r--r-- 1 www-data www-data 6.0K Sep 24 14:41 avatar_1.jpg
-rw-r--r-- 1 root     root       67 May 25 11:37 index.html
user@host:~$



What's the difference with that? I can open .jpg from 201509/, but not from avatars/, because I'm getting 403 - forbidden...
user@host:~$ sudo ls -alh --color /var/www/html/mybb/uploads/201509/
total 5.8M
drwxr-xr-x 2 www-data www-data  4.0K Sep 24 14:37 .
drwxr-xr-x 4 root     root      4.0K Sep 24 13:28 ..
-rw-r--r-- 1 www-data www-data  270K Sep 24 13:28 post_1_1443101315_da53ecfc6cd1a07fe32202843a5fb9c4.attach
-rw-r--r-- 1 www-data www-data  2.1K Sep 24 13:28 post_1_1443101315_da53ecfc6cd1a07fe32202843a5fb9c4_thumb.jpg
-rw-r--r-- 1 www-data www-data 1001K Sep 24 14:08 post_1_1443103699_4e853912d9e53b22d40253fec63cab30.attach
-rw-r--r-- 1 www-data www-data   13K Sep 24 14:08 post_1_1443103699_4e853912d9e53b22d40253fec63cab30_thumb.png
-rw-r--r-- 1 www-data www-data 1008K Sep 24 14:15 post_1_1443104155_20e99a4ade135aee9dfb038dc899ff2e.attach
-rw-r--r-- 1 www-data www-data   11K Sep 24 14:15 post_1_1443104155_20e99a4ade135aee9dfb038dc899ff2e_thumb.png
-rw-r--r-- 1 www-data www-data   59K Sep 24 14:20 post_1_1443104430_c5b34c1f9a58d15b837256d5eb113155.attach
-rw-r--r-- 1 www-data www-data  2.4K Sep 24 14:20 post_1_1443104430_c5b34c1f9a58d15b837256d5eb113155_thumb.jpg
-rw-r--r-- 1 www-data www-data  3.4M Sep 24 14:37 post_1_1443105477_3626fc63e4a86294ed34c1143f217997.attach
-rw-r--r-- 1 www-data www-data   12K Sep 24 14:37 post_1_1443105477_3626fc63e4a86294ed34c1143f217997_thumb.png
user@host:~$ sudo ls -alh --color /var/www/html/mybb/uploads/avatars/
total 20K
drwxr-xr-x 2 www-data www-data 4.0K Sep 24 14:41 .
drwxr-xr-x 4 root     root     4.0K Sep 24 13:28 ..
-rw-r--r-- 1 www-data www-data 6.0K Sep 24 14:41 avatar_1.jpg
-rw-r--r-- 1 root     root       67 May 25 11:37 index.html


I got this
In /etc/nginx/sites-available/default i had
    location ~ /(inc|uploads/avatars) {
        deny all;
        }
I changed it to:
    location ~ /(inc|uploads/avatars) {
        allow all;
        }
I only don't know is it safe, to allow all.

I found answer here:
http://community.mybb.com/thread-164893.html

I installed MyBB using a tutorial from here (delete it please, if it's not allowed to post external links, or tell me, I'll delete it by myself)
I dont know if it is safe; I will flag this thread up to a developer Smile
Thank you for your help Smile after a few days I could be looking for help with attachments Big Grin
I'll mark this thread as solved Smile Thank you again Smile
inc shouldn't really be accessible, only uploads/avatars.