• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.4 Bad CHMOD in ImageMagick-created avatars

Valter

Active member
#1
Hello,

My problem is that when user upload avatar, ImageMagick creates small and medium variants which are CHMOD 600. This means they are not displayed in posts. What should I do to force IM to CHMOD files correct (644)?
 
Last edited:

Mike

XenForo developer
Staff member
#2
Is this any avatar, or just one created by ImageMagick? Permissions should generally be set after writing the avatar.
 

Valter

Active member
#3
Large avatar has proper permissions after upload, medium and small not, so I think large one is untouched but medium and small are chmoded improperly after conversion? ImageMagick is set as image processor in AdminCP.

I've tried with $config['chmodWritableValue'] = 0644; in config.php (find it suggested somewhere) but it makes no any changes.
 

Mike

XenForo developer
Staff member
#4
I've seen things like this before when servers have disabled the chmod function. You can check admin.php?tools/phpinfo and look at the disable_functions line to see if it's disabled there.

If so, unfortunately there isn't anything you can directly do about it. You need to contact your host and have them re-enable the chmod function or they need to fix the umask on the user PHP is running as to not create files as 0600.
 

Valter

Active member
#5
I've tried with custom php.ini they gave me before. Found/removed "chmod" from "disable_functions" and it works now!

Thank You Mike!

Is there anything else important to XenForo here I should remove?

disable_functions = ini_alter, curl_exec, exec, system, passthru, shell_exec, proc_open, proc_close, proc_get_status, proc_nice, proc_terminate, leak, listen, chgrp, set_time_limit, apache_note, apache_setenv, closelog, debugger_off, debugger_on, define_syslog_variables, openlog, syslog,ftp_exec, phpinfo, dl;
 

Mike

XenForo developer
Staff member
#6
set_time_limit and potentially phpinfo. That said, there are others that may be used in the future. I generally find disabling PHP functions to be an exercise in futility.