Portal Home > Knowledgebase > Articles Database > Nginx + php-fpm Configuration


Nginx + php-fpm Configuration




Posted by Mr_Parham, 11-21-2014, 03:40 PM
Hi I been using litespeed whenever I needed php on any of my servers but I decided to try out nginx as I use it to server files on my download servers and I think it's great, I managed to figure pretty much everything except one thing Basically I need my php script to carry on running and finish the process even if the user connection break for whatever reason or user decide to close the browser, in litespeed this was quite simple, there was an option called "External Application Abort" which if I change to "No Abort" it would do exactly what I wanted, I tried searching it up to find the same thing in nginx and what I got is this fastcgi_ignore_client_abort on; Which doesn't actually work it seems (at least it doesn't do what I want it to do) so does any one have any idea if this is possible in nginx and also how it can be done? Thanks for your time Parham

Posted by Srv24x7, 11-22-2014, 11:47 AM
Hi, Most of the things in Nginx has to be tried to get it working as expected, being OpenSource. LiteSpeed is a paid version and they have to be on their toes to provide the features the buyer is asking. Occasionally, Nginx gives 500 Bad Gateway error, which makes it next choice making the Litespeed on top of it.

Posted by zacharooni, 11-22-2014, 02:02 PM
You will want to adjust max_execution_time in /etc/php5/fpm/php.ini and add ignore_user_abort(TRUE); at the top of your script, you might also want to explicitly declare your time limit with set_time_limit($seconds); You could also write a custom register_shutdown_handler('shutdown_handler_func'), or see this for a php5-fpm specific implementation of ignoring user aborts.



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
email header (Views: 612)