@lkdev said in Nginx: connect() failed (111: Connection refused) while connecting to upstream:
@crxssrazr93 said in Nginx: connect() failed (111: Connection refused) while connecting to upstream:
@lkdev
Make sure php-fpm is already running on the background...
Then, change your listen 80; to listen 127.0.0.1; .
@ciaompe said in Nginx: connect() failed (111: Connection refused) while connecting to upstream:
Simply, open the following path to your php5-fpm (if you php 7 then open php 7 fpm)
Php 5
sudo nano /etc/php5/fpm/pool.d/www.conf
Php 7
sudo nano /etc/php/7.2/fpm/pool.d/www.conf
Then find this line and uncomment it:
listen.allowed_clients = 127.0.0.1
Also comment below line
Php 5
;listen = /var/run/php5-fpm.sock
Php 7
;listen = /run/php/php7.2-fpm.sock
and add
listen = 9000
after you make the modifications, all you need to restart or reload both Nginx and Php fpm
Php 5
sudo service php5-fpm restart
Php 7
sudo service php7.2-fpm restart
Nginx
sudo service nginx restart
Guys this works. thanks aganin and lankadevelopers thank you very much
Anytime mate xD