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

Fixed Missing GD JPEG (requirements error)

Discussion in 'Resolved Bug Reports' started by Ati, Feb 11, 2011.

  1. Ati

    Ati Active Member


    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:


    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?

  2. Brogan

    Brogan XenForo Moderator Staff Member

    Try disabling mod_security.

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

    # 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
  3. Ati

    Ati Active Member

    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.
  4. Ati

    Ati Active Member


    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.
  5. Mike

    Mike XenForo Developer Staff Member

    It does actually check for that extension, but you must have GD without JPEG. I'm not actually sure what situation that happens in...
  6. Ati

    Ati Active Member

    Yes, I do have GD, but jpeg support is not included:


    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.
  7. Ati

    Ati Active Member

    libjpeg-devel needed to be installed, then php recompiled. now works fine.


    Maybe there should be some kind of warning about this during the requirement-check.
    Darkimmortal likes this.
  8. Mike

    Mike XenForo Developer Staff Member

    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.
    krstep and Ati like this.

Share This Page