Fast CGI (spawn-fcgi / php-cgi) crashes/dies/hangs

nerdgrind nginx-forum at
Wed Dec 9 05:21:18 MSK 2009


I respect your'e opinions, but for all you're heated desperation to defend php-fcgi you may have forgotten this thread was started by someone who found php-fcgi to be unstable, and he hasn't been able to find a solution. I found one that worked for me when php-fcgi failed. Offering a solution to someone that results in the same failure doesn't seem to be a solution to me.

Perhaps someone here could give a detailed solution as to how miradev might solve his problem. Kind of like a how-to explanation. We're all here to help each other.

I don't want to anyone coming here for help only offered one possibility, when something else might be better suited to their situation and needs, which is why I posted an alternative.

Apache may not be on the most loved list here, but it can work where php-fcgi fails. Let's not ignore this alternative when someone is ready to switch from Nginx back to Apache, as even the author of WP Super Cache did just last week. Insisting that php-fcgi is the only way to serve PHP will slow the adoption of Nginx, because it doesn't offer support for PHP itself.

In fact, Wordpress itself has a problem when php-fcgi is used rather than Apache as the backend to serve PHP

When WordPress detects that FastCGI PHP SAPI is in use, it disregards the redirect status code passed to wp_redirect. Thus, all 301 redrects become 302 redirects which may not be good for SEO. The plugin overrides wp_redirect when it detects that nginx is used.

When WordPress detects that mod_rewrite is not loaded (which is the case for nginx as it does not load any Apache modules) it falls back to PATHINFO permalinks in Permalink Settings page. nginx itself has built-in support for URL rewriting and does not need PATHINFO permalinks. Thus, when the plugin detects that nginx is used, it makes WordPress think that mod_rewrite is loaded and it is OK to use pretty permalinks.

There is also an extensive additional configuration that needs to be done to avoid problems.

I've never heard anyone hear discuss these issues, which means a lot of people might be losing out on a lot of traffic that could be coming from search engines because of an SEO problem caused by an incompatibility between php-fcgi and Wordpress.

Using Apache as a backend eliminates this problem.

Like many of you, I have had my own experiences, and I now have a multitude of solutions to fit different situations. Although I don't know what platform miradev uses to serve his web sites, if it is Wordpress then using Apache on the backend could save him some headaches he didn't even know existed.

Posted at Nginx Forum:,28783,29087#msg-29087

More information about the nginx mailing list