Error 502 in nginx + php5-fpm

The issue is socket itself, its problems on high-load cases is well-known. Please consider using TCP\IP connection instead of unix socket, for that you need to make these changes: in php-fpm pool configuration replace listen = /var/run/php5-fpm.sock with listen = 127.0.0.1:7777 in /etc/nginx/php_location replace fastcgi_pass unix:/var/run/php5-fpm.sock; with fastcgi_pass 127.0.0.1:7777;

nginx 502 bad gateway

I executed my localhost and the page displayed the 502 bad gateway message. This helped me: Edit /etc/php5/fpm/pool.d/www.conf Change listen = /var/run/php5-fpm.sock to listen = 127.0.0.1:9000 Ensure the location is set properly in nginx.conf. Run sudo service php5-fpm restart Maybe it will help you. Source from: http://wildlyinaccurate.com/solving-502-bad-gateway-with-nginx-php-fpm

Differences and uses between WSGI, CGI, FastCGI, and mod_python in regards to Python?

A part answer to your question, including scgi. What’s the difference between scgi and wsgi? Is there a speed difference between WSGI and FCGI? How Python web frameworks, WSGI and CGI fit together CGI vs FCGI Lazy and not writing it on my own. From the wikipedia: http://en.wikipedia.org/wiki/FastCGI Instead of creating a new process for … Read more

nginx: connect() failed (111: Connection refused) while connecting to upstream

I don’t think that solution would work anyways because you will see some error message in your error log file. The solution was a lot easier than what I thought. simply, open the following path to your php5-fpm sudo nano /etc/php5/fpm/pool.d/www.conf or if you’re the admin ‘root’ nano /etc/php5/fpm/pool.d/www.conf Then find this line and uncomment … Read more

What is the difference between fastcgi and fpm?

FPM is a process manager to manage the FastCGI SAPI (Server API) in PHP. Basically, it replaces the need for something like SpawnFCGI. It spawns the FastCGI children adaptively (meaning launching more if the current load requires it). Otherwise, there’s not much operating difference between it and FastCGI (The request pipeline from start of request … Read more

Prevent nginx 504 Gateway timeout using PHP set_time_limit()

There are several ways in which you can set the timeout for php-fpm. In /etc/php5/fpm/pool.d/www.conf I added this line: request_terminate_timeout = 180 Also, in /etc/nginx/sites-available/default I added the following line to the location block of the server in question: fastcgi_read_timeout 180; The entire location block looks like this: location ~ \.php$ { fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index … Read more

Nginx serves .php files as downloads, instead of executing them

Try this: Edit /etc/nginx/sites-available/default Uncomment both listen lines to make Nginx listen on port 80 IPv4 and IPv6. listen 80; ## listen for ipv4; this line is default and implied listen [::]:80 default_server ipv6only=on; ## listen for ipv6 Leave server_name alone # Make site accessible (…) server_name localhost; Add index.php to the index line root … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)