Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Server Operation

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Thread Tools Display Modes
Old 28th March 2012, 16:44
37minutes 37minutes is offline
Junior Member
Join Date: Mar 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default nginx + PHP5-FPM: eventual 500 errors for single site


I've just setup my nginx <--socket--> php5-fpm web server. It's working pretty well except for one problem: on one of my php sites, when I browse around to different pages, I eventually get a 500 error. And once it shows up, I'll get 500 errors for the rest of the site until I restart php5-fpm. But *not* on other php sites being hosted on the same server! I have several Wordpress installations using the same php socket, and they work fine even after the 500 errors show up on this certain site.

What could possibly be the problem? I've looked in all the logs I could find, but they don't show what's causing the problem. (e.g., the php5-fpm log just says that it is running and ready to accept connections; the nginx log doesn't print anything in the error log--it just prints the GET request in the access log)

The problematic site's nginx configuration:

    server {

        listen       80;
        server_name  www.jimtulpulco.com jimtulpulco.com;
		root   		 /srv/www/jimtulpulco.com/public_html/;

		location / {
		index index.html index.htm index.php;

		if (!-e $request_filename) {
		rewrite ^(.+)$ /index.php?q=$1 last;

		location ~ \.php$ {
		try_files $uri =404;
    	fastcgi_pass unix:/var/run/php5-fpm.sock;
    	fastcgi_index index.php;
		fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    	include /etc/nginx/fastcgi_params;


My php5-fpm.conf:


user = www-data
group = www-data

listen = /var/run/php5-fpm.sock
listen.mode = 0666

pm = static

pm.max_children = 15
pm.max_requests = 100
request_terminate_timeout = 30s

env[PATH] = /usr/local/bin:/usr/bin:/bin
env[TMP] = /tmp
env[TMPDIR] = /tmp
env[TEMP] = /tmp

php_admin_value[error_log] = /var/log/fpm-php.www.log
php_admin_flag[log_errors] = on
php_admin_value[memory_limit] = 128M

My fastcgi_params:

fastcgi_param	QUERY_STRING		$query_string;
fastcgi_param	REQUEST_METHOD		$request_method;
fastcgi_param	CONTENT_TYPE		$content_type;
fastcgi_param	CONTENT_LENGTH		$content_length;

fastcgi_param	SCRIPT_FILENAME		$request_filename;
fastcgi_param	SCRIPT_NAME		$fastcgi_script_name;
fastcgi_param	REQUEST_URI		$request_uri;
fastcgi_param	DOCUMENT_URI		$document_uri;
fastcgi_param	DOCUMENT_ROOT		$document_root;
fastcgi_param	SERVER_PROTOCOL		$server_protocol;

fastcgi_param	GATEWAY_INTERFACE	CGI/1.1;
fastcgi_param	SERVER_SOFTWARE		nginx/$nginx_version;

fastcgi_param	REMOTE_ADDR		$remote_addr;
fastcgi_param	REMOTE_PORT		$remote_port;
fastcgi_param	SERVER_ADDR		$server_addr;
fastcgi_param	SERVER_PORT		$server_port;
fastcgi_param	SERVER_NAME		$server_name;

fastcgi_param	REDIRECT_STATUS		200;
fastcgi_buffers 256 16k;
fastcgi_buffer_size 32k;

Last edited by 37minutes; 28th March 2012 at 16:53.
Reply With Quote
Sponsored Links
Old 29th March 2012, 16:21
falko falko is offline
Super Moderator
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,751 Times in 2,581 Posts

Which distribution do you use? If it's Debian/Ubuntu, try this: http://www.howtoforge.com/forums/sho...73&postcount=8
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
nginx + php-fpm = various problems for SOME sites inc 500 or 404 or no input file talkingnews Installation/Configuration 3 11th December 2011 19:02
error 500 after site save DUCKFACE Installation/Configuration 11 19th November 2010 15:14
Fedora 10 - Virtual Users And Domains With Postfix, Courier etc j.smith1981 Server Operation 6 17th February 2010 02:01
ffmpeg Video support for ubuntu 7.10 [suphp-ispconfig] amaurib Installation/Configuration 13 16th February 2010 18:26
eaccelerator installation - can't find php5-config tom Programming/Scripts 9 15th May 2006 16:36

All times are GMT +2. The time now is 18:50.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.