I tried to install nginx and PHP7 with FPM using this tutorial: https://www.digitalocean.com/community/tutorials/how-to-upgrade-to-php-7-on-ubuntu-14-04
When I try to access any .php
file I get 502 Bad Gateway
.
When I try to restart php7.0-fpm
, I get this:
sudo service php7.0-fpm restart
stop: Unknown instance:
php7.0-fpm start/running, process 5379
My nginx config:
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
My server is Ubuntu Server 14.04
/etc/php7.0/fpm/pool.d/www.conf
configuration file and verify that the run path you think PHP is listening on is actually where it listens. Once PHP is started and running, do you clear your cache on your browser and try and access the PHP again? Do you see any errors in/var/log/nginx/error.log
?/etc/php7.0
2016/06/18 19:00:02 [crit] 5601#0: *6 connect() to unix:/var/run/php/php7.0-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 109.236.47.141, server: kida.al, request: "GET /i.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.0-fpm.sock:", host: "kida.al"
/etc/php/7.0/fpm/pool.d/www.conf
. What does the entry for thelisten =
item say?listen = /run/php/php7.0-fpm.sock