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: 64.140.159.239, server: abc.com, 
request: "GET / HTTP/1.1",
upstream: "fastcgi://unix:/run/php5-fpm.sock:", host: "abc.com"

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.

1 Like

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?

@mahir

can you provide output of following commands ?

dpkg -l | grep php

and

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

dpkg -l | grep php

root@txqnss:~# dpkg -l | grep php
ii  php-common                          1:36+deb.sury.org~trusty+1                        all          Common files for PHP packages
ii  php-igbinary                        1.2.1-10-ge0e66b9+1.2.1-2+deb.sury.org~trusty+6   amd64        igbinary PHP serializer
ii  php-imagick                         3.4.0~rc6-2+deb.sury.org~trusty+6                 amd64        Provides a wrapper to the ImageMagick library
ii  php-json                            1:7.0+36+deb.sury.org~trusty+1                    all          JSON module for PHP [default]
ii  php-memcache                        3.0.9~20151130.fdbd46b-2+deb.sury.org~trusty+6    amd64        memcache extension module for PHP5
ii  php-memcached                       2.2.0-95-g6ace07d+2.2.0-2+deb.sury.org~trusty+6   amd64        memcached extension module for PHP5, uses libmemcached
ii  php-msgpack                         2.0.0+0.5.7-2+deb.sury.org~trusty+6               amd64        PHP extension for interfacing with MessagePack
ii  php-pear                            1:1.10.1+submodules+notgz-4+deb.sury.org~trusty+1 all          PEAR Base System
ii  php-xdebug                          2.4.0-1+deb.sury.org~trusty+1                     amd64        Xdebug Module for PHP
ii  php-xml                             1:7.0+36+deb.sury.org~trusty+1                    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                       5.6.19+dfsg-1+deb.sury.org~trusty+1               amd64        Bcmath module for PHP
ii  php5.6-cli                          5.6.19+dfsg-1+deb.sury.org~trusty+1               amd64        command-line interpreter for the PHP scripting language
ii  php5.6-common                       5.6.19+dfsg-1+deb.sury.org~trusty+1               amd64        documentation, examples and common module for PHP
ii  php5.6-curl                         5.6.19+dfsg-1+deb.sury.org~trusty+1               amd64        CURL module for PHP
ii  php5.6-fpm                          5.6.19+dfsg-1+deb.sury.org~trusty+1               amd64        server-side, HTML-embedded scripting language (FPM-CGI binary)
ii  php5.6-gd                           5.6.19+dfsg-1+deb.sury.org~trusty+1               amd64        GD module for PHP
ii  php5.6-imap                         5.6.19+dfsg-1+deb.sury.org~trusty+1               amd64        IMAP module for PHP
ii  php5.6-json                         1.3.9-2+deb.sury.org~trusty+1                     amd64        JSON module for PHP 5.6
ii  php5.6-mbstring                     5.6.19+dfsg-1+deb.sury.org~trusty+1               amd64        MBSTRING module for PHP
ii  php5.6-mcrypt                       5.6.19+dfsg-1+deb.sury.org~trusty+1               amd64        libmcrypt module for PHP
ii  php5.6-mysql                        5.6.19+dfsg-1+deb.sury.org~trusty+1               amd64        MySQL module for PHP
ii  php5.6-opcache                      5.6.19+dfsg-1+deb.sury.org~trusty+1               amd64        Zend OpCache module for PHP
ii  php5.6-readline                     5.6.19+dfsg-1+deb.sury.org~trusty+1               amd64        readline module for PHP
ii  php5.6-recode                       5.6.19+dfsg-1+deb.sury.org~trusty+1               amd64        recode module for PHP
ii  php5.6-xml                          5.6.19+dfsg-1+deb.sury.org~trusty+1               amd64        DOM, SimpleXML, WDDX, XML, and XSL module for PHP
ii  php5.6-zip                          5.6.19+dfsg-1+deb.sury.org~trusty+1               amd64        Zip module for PHP
ii  php7.0-common                       7.0.4-1+deb.sury.org~trusty+1                     amd64        documentation, examples and common module for PHP
ii  php7.0-json                         7.0.4-1+deb.sury.org~trusty+1                     amd64        JSON module for PHP
ii  php7.0-xml                          7.0.4-1+deb.sury.org~trusty+1                     amd64        DOM, SimpleXML, WDDX, XML, and XSL module for PHP
root@txqnss:~#

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

root@txqnss:~# cat /etc/php/5.6/fpm/pool.d/www.conf
[www]
user = www-data
group = www-data
listen = 127.0.0.1:9000
listen.owner = www-data
listen.group = 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?

@mahir

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;
 server 127.0.0.1:9000;