php-fpm?

General discussions related to php

Moderators: macek, egami, gesf

rayj0000
New php-forum User
New php-forum User
Posts: 1
Joined: Sat Mar 08, 2014 1:34 pm

php-fpm?

Postby rayj0000 » Sat Mar 08, 2014 1:40 pm

I hope this is the right place to get answers for a 502 Error?

I just installed a fresh copy of Ubuntu 12.04.3 and updated it (on a local VM).

I installed nginx sucessfully.
ray@Web-Server:/etc/nginx/sites-available$ nginx -v
nginx version: nginx/1.4.5

I installed php5-cli and php5-fpm.
ray@Web-Server:/etc/nginx/sites-available$ php -v
PHP 5.3.10-1ubuntu3.10 with Suhosin-Patch (cli) (built: Feb 28 2014 23:14:25)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies

I added the info.php file to /usr/share/nginx/html/info.php

I did the following:

cd /etc/nginx
sudo rm sites-enabled/default
sudo cp sites-available/default sites-available/my-default
sudo ln -s /etc/nginx/sites-available/my-default sites-enabled/default

my-default looks like this:

server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;

root /usr/share/nginx/html;
index index.html index.htm;

# Make site accessible from http://localhost/
server_name localhost;

location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
# Uncomment to enable naxsi on this location
# include /etc/nginx/naxsi.rules
}

location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# fastcgi_pass 127.0.0.1:9000;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}

Everything else is commented out in the file.

So I was successful in browsing to the default nginx but browsing to the info.php results in a 502 Bad Gateway Error

Some of my "ps -A" output is:

906 tty4 00:00:00 getty
913 tty5 00:00:00 getty
920 tty2 00:00:00 getty
921 tty3 00:00:00 getty
923 tty6 00:00:00 getty
936 ? 00:00:00 acpid
937 ? 00:00:00 cron
938 ? 00:00:00 atd
948 ? 00:00:00 whoopsie
959 ? 00:00:00 php5-fpm
960 ? 00:00:00 php5-fpm
961 ? 00:00:00 php5-fpm
962 ? 00:00:00 php5-fpm
963 ? 00:00:00 php5-fpm
993 tty1 00:00:00 getty
998 ? 00:00:00 sshd
1139 ? 00:00:00 sshd
1140 pts/0 00:00:00 bash
1664 ? 00:00:00 nginx
1665 ? 00:00:00 nginx
1666 ? 00:00:00 nginx
1667 ? 00:00:00 nginx
1668 ? 00:00:00 nginx

/var/log/nginx/error.log =

2014/03/08 14:06:54 [crit] 1668#0: *29 connect() to unix:/var/run/php5-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 192.168.122.1, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "192.168.122.241"

From the Web Server, I can ping 192.168.122.1 just fine.

Ideas?

Thanks,

Ray

Return to “PHP General”

Who is online

Users browsing this forum: No registered users and 3 guests

cron