WordPress.org

Ready to get started?Download WordPress

Forums

NextGEN Gallery
[resolved] When uploading pics "An unexpected error occured" (18 posts)

  1. Tiberun
    Member
    Posted 1 year ago #

    Hello,

    When I try to upload images into NextGen, it stops at different procentages and then after a while I get this error message:

    An unexpected error occured. This is most likely due to a server misconfiguration. Check your PHP error log or ask your hosting provider for assistance.
    0 images were uploaded

    However, when I look in the gallery the picture has been uploaded, but only the first picture if I do bulk uploads.
    It started to occur at the same time as I changes host for my WP blog. That made me believe it was something wrong with the new host so I contacted 2nd line support and they looked into the issue. They see no error on the server side, al they get is a timeout string as this:

    [Tue Jan 14 16:43:41 2014] [warn] [client 66.249.76.170] Timeout waiting for output from CGI script /usr/bin/php-cgi
    [Tue Jan 14 16:43:41 2014] [error] [client 66.249.76.170] Premature end of script headers: php-cgi
    [Tue Jan 14 16:48:41 2014] [warn] [client 66.249.76.170] Timeout waiting for output from CGI script /usr/bin/php-cgi

    The timeout setting for the php installation is set quite high so shouldn't be the problem:

    max_execution_time = 1600

    The files I'm trying to upload is normal jpeg's between 200k and 2Mb so should not timeout.

    I have turned on debug on WP but can not see anything there related to this.
    The host has other WP customers and none of them have reported this issue.
    At the same time, might not be related to the same error, plug-in and core updates also stop in the progressbar and finally time out as the upload for the images do. When I check all the updates were still performed.

    I have searched the web and looked through your support forum but I can not find a fix for this, please help.

    http://wordpress.org/plugins/nextgen-gallery/

  2. Tiberun
    Member
    Posted 1 year ago #

    Checked the debug-file after I tried to upload a picture and this is what I get:

    [22-Jan-2014 20:23:43] PHP Notice: ob_end_clean(): failed to delete buffer zlib output compression. in /walktheline.boplatsen.se/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ajax/class.ajax_controller.php on line 35

  3. Tiberun
    Member
    Posted 1 year ago #

    Hello again,

    Just finished a talk with the 2nd line support. He was editing the code in /wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ajax/class.ajax_controller.php

    He explained it that if zlib compression is turned off on the webserver you need to set a parameter to ob_start and make sure that ob_end_clean is full before it is cleared with ob_get_level otherwise it will try to clear an empty buffer which will result in the failed to delete zlib buffer etc.

    This is the edit he made and now it works:

    //crystone fix
            //ob_start();
            if( substr_count( $_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip' ) )
            {
                ob_start("ob_gzhandler");
            }
            else
            {
                ob_start();
            }
    
    //crystone fix
            //while (ob_get_level() > 0) {
            while(ob_get_level() > 1) {
                ob_end_clean();
            }
  4. trigem
    Member
    Posted 10 months ago #

    Wonderful, I had the same problem and your hack could solve it! Wonder if they'll fix this in a future release of the plugin.

  5. Losmi
    Member
    Posted 9 months ago #

    Tiberun, I have edited class.ajax_controller.php but error is not gone. Are there any other options for me?

  6. Losmi
    Member
    Posted 9 months ago #

    I have found out that Adblock Plus - a Firefox addon is messing with Nextgen Gallry. Turn it off and gallery works, more or less...

  7. photocrati
    Member
    Plugin Author

    Posted 9 months ago #

    @Losmi - Thanks for the follow-up!

    - Cais.

  8. brucedongcai@gmail.com
    Member
    Posted 8 months ago #

    Hello team,
    I got the same error msg :
    -----------------------
    An unexpected error occured. This is most likely due to a server misconfiguration. Check your PHP error log or ask your hosting provider for assistance.
    -------------------------
    I looked into PHP error log and found no error. I looked in the Gallery and I found all pictures are inside. so the upload is fine and I just get this error msg. or...

    it bothers/confuses me that I got this error msg. could you please post corrected/Edited "class.ajax_controller.php". I am not sure how to edit this PHP file.

    thank you

  9. photocrati
    Member
    Plugin Author

    Posted 8 months ago #

    @brucedongcai@gmail.com - It would probably be best for you to create your own topic as I suspect the circumstances for your site are different than the OP.

    See this for more details: http://codex.wordpress.org/Forum_Welcome#Where_To_Post

    Thanks!

    - Cais.

  10. brucedongcai@gmail.com
    Member
    Posted 8 months ago #

    Cais. sure. thank you!

  11. mimulka
    Member
    Posted 4 months ago #

    I tried the class.ajax_controller.php fix. It gets rid of the error message but I'm still not able to upload more than 1 file at a time.

    I also talked to Hostgator support and they told me it's not a server issue.

    Any other ideas on what I could try? thanks

  12. photocrati
    Member
    Plugin Author

    Posted 3 months ago #

    Hmmm, unlikely. Most upload issues are corrected by resetting permalinks to 'post name' under settings > permalinks, increasing your server /wp-content file permissions to 755 or upgrading/increasing server settings. Would you mind copying and pasting your server settings found under Gallery > Overview ? thanks!

    -Becky

  13. mimulka
    Member
    Posted 3 months ago #

    My permalinks structure is /%category%/%postname%/ for SEO purposes but I've never had an issue before a week ago. Are you saying to click on Post Name, then go back to my current setting?

    Here are the current server settings. Hostgator told me they have increased everything.

    Operating System : Linux (64 Bit)
    Server : Apache
    Memory usage : 37.44 MByte
    MYSQL Version : 5.5.40-36.1
    SQL Mode : Not set
    PHP Version : 5.3.28
    PHP Safe Mode : Off
    PHP Allow URL fopen : On
    PHP Memory Limit : 256
    PHP Max Upload Size : 64M
    PHP Max Post Size : 64M
    PCRE Backtracking Limit : 1000000
    PHP Max Script Execute Time : 30s
    PHP Exif support : Yes ( V1.4 )
    PHP IPTC support : Yes
    PHP XML support : Yes

    Graphic Library

    GD Version : bundled (2.1.0 compatible)
    FreeType Support : Yes
    FreeType Linkage : with freetype
    T1Lib Support : No
    GIF Read Support : Yes
    GIF Create Support : Yes
    JPEG Support : Yes
    PNG Support : Yes
    WBMP Support : Yes
    XPM Support : No
    XBM Support : Yes
    JIS-mapped Japanese Font Support : No

    thanks

  14. photocrati
    Member
    Plugin Author

    Posted 3 months ago #

    @mimulka -- Hmm, those settings appear to be OK. Your permalink settings, I have the same on my own site but mine do not have the / at the end. try changing yours to:

    /%category%/%postname%

    does that help?
    -Becky

  15. mimulka
    Member
    Posted 3 months ago #

    @photocrati No unfortunately still the same issue only one file uploads. Also since I changed the class.ajax_controller.php file, it only shows one picture loading but doesn't show the rest of the process. It's like it's stuck.

  16. photocrati
    Member
    Plugin Author

    Posted 3 months ago #

    @mimulka - You changed the class.ajax_controller.php file? Could you rollback your changes and see if that helps?

    -Becky

  17. mimulka
    Member
    Posted 3 months ago #

    Ok so I cleared my cache after uploading the original class.ajax_controller.php. I tried to upload 3 files. The first two went through ok, once the 3rd one was processing, the same error appeared (An unexpected error occured. This is most likely due to a server misconfiguration. Check your PHP error log or ask your hosting provider for assistance.) However when I go and check inside the gallery the 3 files are there.

  18. photocrati
    Member
    Plugin Author

    Posted 3 months ago #

    @mimulka - This would have been better to create a new topic and carry on the conversation there. I would recommend deactivating *all* plugins, then manually re-installing NextGEN Gallery via FTP over-writing all files and folders under /plugins/nextgen-gallery/

    Then reactivate NextGEN Gallery only, see if that helps. If not, then this should be treated as a new issue and we can troubleshoot it with you appropriately, but also as a new topic so we are not continuing to keep this nine month old topic resurrected.

    Thanks!

    - Cais.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic