PHP 7.2 Ubuntu 20.04 502 Bad gateway Error message
Set path correctly in
sudo nano /etc/nginx/sites-available/default
sudo nano /etc/nginx/snippets
BAD: fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
GOOD: fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
---
sudo nano /etc/php/7.0/fpm/pool.d/www.conf
change
listen = 127.0.0.1:9000
to
listen = /var/run/php7.2-fpm.sock
sudo apt-get -y install php7.2 php7.2-mysql php7.2-fpm php-fpm
chown :www-data /var/run/php/php7.2-fpm.sock
sudo apt install php-mysql
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
php7.2-mysql
The following NEW packages will be installed:
php-mysql php7.2-mysql
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 125 kB of archives.
After this operation, 432 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://us.archive.ubuntu.com/ubuntu bionic-updates/main i386 php7.2-mysql i386 7.2.24-0ubuntu0.18.04.6 [123 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu bionic/main i386 php-mysql all 1:7.2+60ubuntu1 [2,004 B]
Fetched 125 kB in 0s (266 kB/s)
Selecting previously unselected package php7.2-mysql.
(Reading database ... 86153 files and directories currently installed.)
Preparing to unpack .../php7.2-mysql_7.2.24-0ubuntu0.18.04.6_i386.deb ...
Unpacking php7.2-mysql (7.2.24-0ubuntu0.18.04.6) ...
Selecting previously unselected package php-mysql.
Preparing to unpack .../php-mysql_1%3a7.2+60ubuntu1_all.deb ...
Unpacking php-mysql (1:7.2+60ubuntu1) ...
Setting up php7.2-mysql (7.2.24-0ubuntu0.18.04.6) ...
Creating config file /etc/php/7.2/mods-available/mysqlnd.ini with new version
Creating config file /etc/php/7.2/mods-available/mysqli.ini with new version
Creating config file /etc/php/7.2/mods-available/pdo_mysql.ini with new version
Setting up php-mysql (1:7.2+60ubuntu1) ...
Processing triggers for libapache2-mod-php7.2 (7.2.24-0ubuntu0.18.04.6) ...
Processing triggers for php7.2-fpm (7.2.24-0ubuntu0.18.04.6) ...
NOTICE: Not enabling PHP 7.2 FPM by default.
NOTICE: To enable PHP 7.2 FPM in Apache2 do:
NOTICE: a2enmod proxy_fcgi setenvif
NOTICE: a2enconf php7.2-fpm
NOTICE: You are seeing this message because you have apache2 package installed.
sudo service php7.2-fpm restart
sudo service php-fpm restart
sudo service nginx restart
Check /var/log/nginx/error.log if sth is still not ok.
Nincsenek megjegyzések:
Megjegyzés küldése