Welcome to Centmin Mod Community
Register Now

PHP-FPM ignore_user_abort not working

Discussion in 'Install & Upgrades or Pre-Install Questions' started by Oxide, Aug 30, 2015.

  1. Oxide

    Oxide Active Member

    504
    29
    28
    Mar 19, 2015
    Ratings:
    +54
    Local Time:
    12:40 PM
    I noticed ignore_user_abort does not work with Centminmod, basically what I am trying to do is to let it continue the request even after the client exit.

    I don't know why, but I've read online and tried to disable safety mode etc which isn't even enabled from what I know.. no success..

    suggestions?

    apparantly i need to make sure
    fastcgi_ignore_client_abort off;

    is set to off, no idea where and what file.. php.conf doesn't even contain it, also adding it to it won't work.
     
  2. Oxide

    Oxide Active Member

    504
    29
    28
    Mar 19, 2015
    Ratings:
    +54
    Local Time:
    12:40 PM
    PHP:
     ob_end_clean();
     
    header("Connection: close");
     
    ignore_user_abort(); // optional
     
    ob_start();
     echo (
    'Text the user will see');
     
    $size ob_get_length();
     
    header("Content-Length: $size");
     
    ob_end_flush(); // Strange behaviour, will not work
     
    flush();            // Unless both are called !
     
    session_write_close(); // Added a line suggested in the comment
     // Do processing here 
     
    sleep(30);
     echo(
    'Text user will never see'); 
    example script that does not work, it waits till its finished.. however it does not show the text, but it does wait 30 seconds
     
  3. eva2000

    eva2000 Administrator Staff Member

    30,178
    6,786
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,139
    Local Time:
    12:40 PM
    Nginx 1.13.x
    MariaDB 5.5
    fastcgi_ignore_client_abort defaults to disabled by default so nothing to do Module ngx_http_fastcgi_module
     
  4. Oxide

    Oxide Active Member

    504
    29
    28
    Mar 19, 2015
    Ratings:
    +54
    Local Time:
    12:40 PM
    so basically it should work? i made it to off in php.ini

    that means it SHOULD work
     
  5. eva2000

    eva2000 Administrator Staff Member

    30,178
    6,786
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,139
    Local Time:
    12:40 PM
    Nginx 1.13.x
    MariaDB 5.5
    hmm doesn't that imply needing to enable the setting not disabling it ?
    Code:
    fastcgi_ignore_client_abort on;
     
    Last edited: Aug 30, 2015
  6. Oxide

    Oxide Active Member

    504
    29
    28
    Mar 19, 2015
    Ratings:
    +54
    Local Time:
    12:40 PM
    Tried, still waits 30 seconds.. :(
     
  7. eva2000

    eva2000 Administrator Staff Member

    30,178
    6,786
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,139
    Local Time:
    12:40 PM
    Nginx 1.13.x
    MariaDB 5.5
    Then it could be your PHP code ? you're on your own for that though.
     
  8. Oxide

    Oxide Active Member

    504
    29
    28
    Mar 19, 2015
    Ratings:
    +54
    Local Time:
    12:40 PM
    no since i tried it on shared hosting and it works completely fine.

    phpinfo()

    ignore user abort isnt even neccesary, however not sure what else could cause it?

    this is what i am using pretty much
    ob_end_clean();
    header("Connection: close");
    ignore_user_abort(); // optional
    ob_start();
    echo ('Text the user will see');
    $size = ob_get_length();
    header("Content-Length: $size");
    ob_end_flush(); // Strange behaviour, will not work
    flush(); // Unless both are called !
    session_write_close(); // Added a line suggested in the comment
    // Do processing here
    sleep(30);
    echo('Text user will never see');

    works totally fine on other apache servers but not this lampstack,
     
  9. Oxide

    Oxide Active Member

    504
    29
    28
    Mar 19, 2015
    Ratings:
    +54
    Local Time:
    12:40 PM
    conclusion. nginx don't work with ob flush
     
  10. eva2000

    eva2000 Administrator Staff Member

    30,178
    6,786
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,139
    Local Time:
    12:40 PM
    Nginx 1.13.x
    MariaDB 5.5
    who knows.. might want to ask in relevant forums at Nginx Forum