Support » Fixing WordPress » Upload HTTP error – File uploads, WP breaks

  • I know this issue has been around a lot, but I can’t find a solution to this specific scenario. I am setting up a new website and have tried a lot of “solutions” but have had no success.

    Scenario: New installation, When I try to upload jpg files (haven’t tried others), the file always uploads to the server, apparently correctly. However, if the file size is larger than a certain threshold, WP shows an HTTP error and will not show the file or a thumbnail in the media library. The threshold is somewhere between 528 kkb and 546 kb. Further, it will continue to show a thumbnail for a broken file.

    This appears to be an issue with WP and not with the server. In fact, I had a different WP (ver 3.x) site on this server in the past and never had this problem. Current version is latest, 4.9.1

    I’ve deleted all plugins, tried various edits to *.php files, switched themes (twenty seventeen and ascend) etc. but no progress.

    Any help would be appreciated. Being the good debugger that I am, please don’t assume anything has been done or has been done correctly.

    thanks,
    Cliff

Viewing 15 replies - 1 through 15 (of 25 total)
  • Hi @cmb42,
    To me it sounds like a server issue. The server configuration may have changed from the last site.
    You can follow the instructions in the link below to create a phpinfo file and check server configuration. Finding Server Info

    After you have the file created you can search for “upload_max_filesize” in the resulting page to see the limit set by your server.

    Thread Starter cmb42

    (@cmb42)

    I disagree. The files always upload successfully to the server when upload is initiated inside of WP dashboard. However, WP itself doesn’t properly register the files as uploaded correctly if they are larger than approx. 530 kb +/- (Don’t know what the exact threshold is.)

    In answer to your question, upload_max_filesize 32M.

    • This reply was modified 3 years, 11 months ago by cmb42.

    You may be right.
    I am wondering if the PHP session is timing out or runs out of memory.

    Maybe have a look at gc_maxlifetime in phpinfo? Normal value I believe is 1440 seconds.
    Also memory_limit may be playing a role. Check that it is over 64M

    Hey,

    I Have same issue…

    Thread Starter cmb42

    (@cmb42)

    Not a timeout issue either. The uploads all run in a few seconds ( < 10 ), progress indicators run to completion. As I’ve said before, the files are actually successfully uploaded to the server. If it were a php issue, I’d expect the upload to fail at some point and the uploaded files to be broken or incomplete, but the files are intact on the server after the upload.

    The problem occurs at the end of the process, during what I assume is the housekeeping inside of WP after the file is uploaded — the cataloging step that follows the actual upload. My best guess is that there’s an internal WP configuration issue or an actual bug in the code. (No, I’m not putting my money on a bug, but I’d give it about a 20% or better chance of being the problem.)

    (Did I mention that I’m actually a systems programmer?)

    Thread Starter cmb42

    (@cmb42)

    Additional info:

    I just did a bulk upload of 8 files simultaneously. The files ranged in size from 200 kb to 546 kb. All the files uploaded successfully to the server. HOWEVER, as described before, the one file that’s over the problem threshold at 546 kb generated the infamous HTTP error. All of the other files were successfully registered inside of WP.

    Additionally, while the uploads were in progress, each file had TWO thumbnails displayed. Upon completion, one of the two thumbnails would disappear. This reads as a bug to me, possibly related.

    Given this, I’m more inclined to believe this is an internal WP issue, not a server or php issue (although I’m open minded to try anything still.)

    When I try to upload a video file, that show me a http error. I don’t know if is the same issue with you have @cmb42 but already put my memory_limit to 160mb and my max_filesize to 260mb I guess..

    @cmb42,
    Are the thumbnails generated at all? There is a ticket open that may be related
    what version PHP are you running? If 7.1 try using 7.0
    You an also try using GD instead of Imagick by adding this filter

    add_filter( 'wp_image_editors', 'change_graphic_lib' );
       
    function change_graphic_lib() {
        return array( 'WP_Image_Editor_GD', 'WP_Image_Editor_Imagick' );
    }

    I already put that on functions.php and doesn’t solved.

    Thread Starter cmb42

    (@cmb42)

    UPDATES: WP behavior in page editor, photo handling, php ver.

    PHP Version 5.6.28 in case anyone wants to know.

    Did some further experimenting. Some interesting results.

    Media Library:
    When I upload files that are below error threshold, the actual jpg file is upload and various W x H sizes are also created.
    When I upload a file over the error threshold, an http error message is displayed and only the original file is uploaded onto the physical server. None of the various sized files are created. Also, no thumbnails of the actual image are shown. Only the generic grey icon of a piece of paper with a folded corner is shown.

    All photos, no matter what the size, can be deleted from the media library. Deleting them from the WP media library (even larger jpgs with bad icon) also deletes them from the server. (delete works as designed.)

    Page creation:
    When creating a page, all photos, including large ones with bad icons can be used. All photos will appear in the page. They just don’t have actual thumbnail images in the media library.

    Page editing – new issue:
    When creating or editing a new page, photos in the edit will remain original size after being resized by either dragging the corners or edges, or by setting pixel size manually. Photos will, however, be resized in preview.

    Shouldn’t resized photos maintain their changed size in the editor while working on the page and not return to original size?

    I’m beginning to think there are some serious flaws in the photo handling software in this version of WP.

    Finally, I turned debug on with the following lines but assuming that logging is working, no log files are being generated.
    define( ‘WP_DEBUG’, true );
    define( ‘WP_DEBUG_LOG’, true );
    define( ‘WP_DEBUG_DISPLAY’, false );

    I do not have access to the php log files.

    Comments?

    • This reply was modified 3 years, 11 months ago by cmb42.

    hey,

    I have the same situation @cmb42 I tried to create file logs and doesn’t show me anything… I can’t understand what problem is that… :S

    Thread Starter cmb42

    (@cmb42)

    OK, one thing I haven’t tried is using GD instead of Imagick. The previous post by @alichani said to insert the following code:

    `add_filter( ‘wp_image_editors’, ‘change_graphic_lib’ );

    function change_graphic_lib() {
    return array( ‘WP_Image_Editor_GD’, ‘WP_Image_Editor_Imagick’ );
    }

    BUT, it didn’t say where. What file does this go in? I did a google search and nowhere does any post say where to put the code.

    @cmb42,
    You should be able to add it to your theme’s functions.php , just remember if you change theme the code won’t run.
    You may also be able to remove support for Imagick in your server configuration. In my cPanel it’s under Software => Select PHP version.

    Hey @alichani,

    So we can’t add that code on function.php directly?
    We need to use wordpress code editor to insert that?

    @diogooliveirawp,
    your problem doesn’t seem to be the same one. How big is the video file you are trying to upload? In the past I uploaded video files via FTP or Hosting panel and then simply put a link to the file.

Viewing 15 replies - 1 through 15 (of 25 total)
  • The topic ‘Upload HTTP error – File uploads, WP breaks’ is closed to new replies.