Ubuntu – 502 Bad Gateway nginx php7 fpm

nginxPHPserver

I tried to install nginx and PHP7 with fpm using this tutorail 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
and 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

Best Answer

It is likely that an older libpcre3 is installed and satisfies the dependency in the php7.0 package, but only the newer library package provides pcre_jit_stack_free.

If this is the case, do an apt-get install libpcre3, and you’re good to go.

Ref.: https://github.com/oerdnj/deb.sury.org/issues/372

Related Question