F
F
fsheden2018-10-01 12:35:51
PHP
fsheden, 2018-10-01 12:35:51

Yii2 advanced changing php version 7.0 => 7.1 and getting 502 Bad Gateway nginx/1.10.3 (Ubuntu)?

Hello!
I deploy the project on yii2 advanced, I raise it to vagrant.
Initially, I get the version of php 7.0, after which I try to change the version of php to 7.1, install php 7.1 via vagrant ssh, change the line in /etc/nginx/sites-enabled/app.conf :
fastcgi_pass unix:/var/run/php/php7. 0-fpm.sock;
on
fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
location ~ \.php$ {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
#fastcgi_pass 127.0.0.1:9000;
fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
try_files $uri =404;
}
do:
sudo service php7.1-fpm start
sudo service nginx reload
sudo service nginx restart
after all this I get:
502 Bad Gateway
nginx/1.10.3 (Ubuntu)
I can’t fix it in any way, tell me what the problem could be?
in the nginx and php7.1-fpm logs it says everything is ok..

Answer the question

In order to leave comments, you need to log in

2 answer(s)
H
hOtRush, 2018-10-01
@hOtRush

If in the logs, as you say, everything is "OK", then the problem is in your application (I personally doubt that everything is OK there)

F
fsheden, 2018-10-01
@fsheden

everything, it worked
just before vagrant up, you had to add this to the file my_project/vagrant/provision/once-as-root.sh
sudo add-apt-repository ppa:ondrej/php
sudo apt install -y language-pack-en-base
sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php
sudo apt update
apt-get install -y php7.1 php7.1-fpm php7.1-opcache php7.1-zip php7.1-xmlrpc php7.1-xsl php7.1-mbstring php7.1-mcrypt php7.1-mysql php7 .1-odbc php7.1-pgsql php7.1-pspell php7.1-readline php7.1-recode php7.1-snmp php7.1-soap php7.1-sqlite3 php7.1-sybase php7.1-tidy php7 .1-xml php7.1-json php7.1-ldap php7.1-intl php7.1-interbase php7.1-imap php7.1-gmp php7.1-gd php7.1-enchant php7.1-dba php7 .1-bz2 php7.1-bcmath php7.1-phpdbg php7.1-cgi php7.1-cli unzip nginx mysql-server-5.7 php.xdebug

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question