Php automatically upgrades, 502 errors. can't find sock


ok so i wanted to add a new site did the usual ee site create

but now, my sites aren’t working…

i am checking my error logs and i’m getting php errors… it seems as if my php was upgraded, and certain files aren’t installed correctly.

the error log from one of my sites (all sites give the same error)

2016/03/04 20:57:20 [crit] 21363#0: *43 connect() to unix:/run/php5-fpm.sock 
failed (2: No such file or directory) while connecting to upstream, 
client:, server:, 
request: "GET / HTTP/1.1",
upstream: "fastcgi://unix:/run/php5-fpm.sock:", host: ""

it checked my system, i have two php versions installed… 5 and 7? i didn’t ask for this…

i had production sites working, what happened :frowning: Please help


I had the same issue. Had to revert to a backup.


right but this isn’t really a solution.

why did it install php7 in the first place… ?


Ok so i changed some setting for php and the sites started working again but then installed a new wp site and the ee setup script seems to have changed the settings back to what wasn’t working.

so how do i stop the EE script from messing up my env?



can you provide output of following commands ?

dpkg -l | grep php


cat /etc/php/5.6/fpm/pool.d/www.conf


dpkg -l | grep php

root@txqnss:~# dpkg -l | grep php
ii  php-common                                        all          Common files for PHP packages
ii  php-igbinary                 amd64        igbinary PHP serializer
ii  php-imagick                                amd64        Provides a wrapper to the ImageMagick library
ii  php-json                                      all          JSON module for PHP [default]
ii  php-memcache                  amd64        memcache extension module for PHP5
ii  php-memcached                amd64        memcached extension module for PHP5, uses libmemcached
ii  php-msgpack                              amd64        PHP extension for interfacing with MessagePack
ii  php-pear                   all          PEAR Base System
ii  php-xdebug                                     amd64        Xdebug Module for PHP
ii  php-xml                                       all          DOM, SimpleXML, WDDX, XML, and XSL module for PHP [default]
rc  php5-cli                            5.5.9+dfsg-1ubuntu4.14                            amd64        command-line interpreter for the php5 scripting language
ii  php5-common                         5.5.9+dfsg-1ubuntu4.14                            amd64        Common files for packages built from the php5 source
ii  php5-curl                           5.5.9+dfsg-1ubuntu4.14                            amd64        CURL module for php5
rc  php5-fpm                            5.5.9+dfsg-1ubuntu4.14                            amd64        server-side, HTML-embedded scripting language (FPM-CGI binary)
ii  php5-gd                             5.5.9+dfsg-1ubuntu4.14                            amd64        GD module for php5
ii  php5-json                           1.3.2-2build1                                     amd64        JSON module for php5
ii  php5-mcrypt                         5.4.6-0ubuntu5                                    amd64        MCrypt module for php5
ii  php5-mysql                          5.5.9+dfsg-1ubuntu4.14                            amd64        MySQL module for php5
rc  php5-readline                       5.5.9+dfsg-1ubuntu4.14                            amd64        Readline module for php5
ii  php5.6-bcmath                            amd64        Bcmath module for PHP
ii  php5.6-cli                               amd64        command-line interpreter for the PHP scripting language
ii  php5.6-common                            amd64        documentation, examples and common module for PHP
ii  php5.6-curl                              amd64        CURL module for PHP
ii  php5.6-fpm                               amd64        server-side, HTML-embedded scripting language (FPM-CGI binary)
ii  php5.6-gd                                amd64        GD module for PHP
ii  php5.6-imap                              amd64        IMAP module for PHP
ii  php5.6-json                                    amd64        JSON module for PHP 5.6
ii  php5.6-mbstring                          amd64        MBSTRING module for PHP
ii  php5.6-mcrypt                            amd64        libmcrypt module for PHP
ii  php5.6-mysql                             amd64        MySQL module for PHP
ii  php5.6-opcache                           amd64        Zend OpCache module for PHP
ii  php5.6-readline                          amd64        readline module for PHP
ii  php5.6-recode                            amd64        recode module for PHP
ii  php5.6-xml                               amd64        DOM, SimpleXML, WDDX, XML, and XSL module for PHP
ii  php5.6-zip                               amd64        Zip module for PHP
ii  php7.0-common                                  amd64        documentation, examples and common module for PHP
ii  php7.0-json                                    amd64        JSON module for PHP
ii  php7.0-xml                                     amd64        DOM, SimpleXML, WDDX, XML, and XSL module for PHP

cat /etc/php/5.6/fpm/pool.d/www.conf

root@txqnss:~# cat /etc/php/5.6/fpm/pool.d/www.conf
user = www-data
group = www-data
listen =
listen.owner = www-data = www-data
pm = ondemand
pm.max_children = 100
pm.start_servers = 20
pm.min_spare_servers = 10
pm.max_spare_servers = 30
ping.path = /ping
pm.status_path = /status
pm.max_requests = 500
request_terminate_timeout = 300

any clue?



It is correct configuration that is done by EasyEngine.

above error shows that you had some custom config that was using sockets.


I havent made any custom configs? how would i revert whatever seems to have been changed?

@harshadyeola any help would be greatly appreciated.


somehow, the upsteam.conf file has been modified, i really dont remember doing it but at least i know the solution now.

# Common upstream settings
upstream php {
# server unix:/run/php5-fpm.sock;
# server /var/run/php5-fpm.sock;