Fixed  Missing GD JPEG (requirements error)

Ati

Well-known member
Hi,

when I upload a text file, it works fine. But when I upload am image, the progressbar reaches 100%, and then it just stays there:

100.webp

This is probably when it would create the thumbnails (?), and it looks like it cannot cope with it. There is nothing in xF's error log.

Do I need anything special on my server to be able to accept images?

Thanks.
 
Try disabling mod_security.

There should be instructions in the .htacces file on how to do that.

Code:
# Mod_security can interfere with uploading of content such as attachments. If you
# cannot attach files, remove the "#" from the lines below.
<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>
 
Try disabling mod_security.

There should be instructions in the .htacces file on how to do that.

Code:
# Mod_security can interfere with uploading of content such as attachments. If you
# cannot attach files, remove the "#" from the lines below.
<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>

I don't have mod_security.

"Loaded Modules: core mod_access mod_auth mod_include mod_log_config mod_env mod_setenvif mod_ssl prefork http_core mod_mime mod_status mod_autoindex mod_asis mod_cgi mod_negotiation mod_dir mod_imap mod_actions mod_userdir mod_alias mod_so mod_php5"

Other types of attachments (at least .txt) upload fine.
 
Update:

From the apache-log:

PHP Fatal error: Call to undefined function imagecreatefromjpeg() in /*****/xenforo/library/XenForo/Image/Gd.php on line 57

I'll just need to compile this into php.

The requirement-test did not complain about this.

Should it? I don't know... It's not core functionality... But maybe there should be some sort of visible error.
 
It does actually check for that extension, but you must have GD without JPEG. I'm not actually sure what situation that happens in...
 
Yes, I do have GD, but jpeg support is not included:

gd.webp

I will play around with it a little to see what I need to get it in there. It's missing from my real server as well, not just this virtual machine that I'm testing on.
 
libjpeg-devel needed to be installed, then php recompiled. now works fine.

gd.webp

Maybe there should be some kind of warning about this during the requirement-check.
 
There's a requirement check on JPEG support now, as it's the most common to be used. It also handles potential errors more gracefully.
 
Top Bottom