Saya menginstal php8. 1 di ubuntu 18. 04 tetapi mendapat masalah. Saya mendapatkan kesalahan 502 Bad Gateway. Kesalahan. log memberikan kesalahan berikut
2022/06/30 17:48:38 [crit] 2224#2224: *1 connect() to unix:/var/run/php/php8.1-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 127.0.0.1, server: _, request: "GET /w3_scalar.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php8.1-fpm.sock:", host: "localhostRincian lainnya adalah
$ sudo nginx -t [sudo] password for zulfi: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful _dan
$ sudo systemctl restart php8.1-fpm ~$ sudo systemctl status nginx.service ● nginx.service - A high performance web server and a reverse proxy server Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: en Active: active (running) since Wed 2022-06-29 15:49:48 CDT; 1 day 2h ago Docs: man:nginx(8) Process: 2220 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code Process: 2010 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process Main PID: 2221 (nginx) Tasks: 13 (limit: 4915) CGroup: /system.slice/nginx.service ├─2221 nginx: master process /usr/sbin/nginx -g daemon on; master_pro ├─2224 nginx: worker process ├─2226 nginx: worker process ~$ journalctl -xe -- Unit systemd-hostnamed.service has finished starting up. -- -- The start-up result is RESULT. Jun 30 17:58:08 lc2530hz audit[20050]: AVC apparmor="ALLOWED" operation="connect Jun 30 17:58:08 lc2530hz audit[20050]: AVC apparmor="ALLOWED" operation="file_pe Jun 30 17:58:08 lc2530hz audit[20050]: AVC apparmor="ALLOWED" operation="file_pe Jun 30 17:58:08 lc2530hz audit[20050]: AVC apparmor="ALLOWED" operation="file_pe Jun 30 17:58:08 lc2530hz audit[20050]: AVC apparmor="ALLOWED" operation="file_pe Jun 30 17:58:08 lc2530hz kernel: audit: type=1400 audit(1656629888.891:266): app Jun 30 17:58:08 lc2530hz kernel: audit: type=1400 audit(1656629888.891:267): app Jun 30 17:58:08 lc2530hz kernel: audit: type=1400 audit(1656629888.891:268): app Jun 30 17:58:08 lc2530hz kernel: audit: type=1400 audit(1656629888.891:269): app Jun 30 17:58:08 lc2530hz kernel: audit: type=1400 audit(1656629888.891:270): app Jun 30 17:58:09 lc2530hz org.gnome.Nautilus[4167]: func=xmlSecCheckVersionExt:fi Jun 30 17:58:09 lc2530hz kernel: CPU4: Core temperature above threshold, cpu clo Jun 30 17:58:09 lc2530hz kernel: CPU10: Core temperature above threshold, cpu cl Jun 30 17:58:09 lc2530hz kernel: CPU4: Core temperature/speed normal Jun 30 17:58:09 lc2530hz kernel: CPU10: Core temperature/speed normalInformasi file adalah
/etc/php/8.1/fpm/php-fpm.conf pid = /run/php/php8.1-fpm.pid error_log = /var/log/php8.1-fpm.log include=/etc/php/8.1/fpm/pool.d/*.conf /etc/php/8.1/fpm/pool.d/www.conf: user = www-data group = www-data listen = /run/php/php8.1-fpm.sock listen.group = www-data listen = 127.0.0.1:9000Beberapa orang tolong bimbing saya bagaimana mengatasi kesalahan Gateway 502 yang buruk ini ketika saya menjalankan file php saya di browser menggunakan. http. //localhost/w3_scalar. php
Perhatikan file di atas berjalan di php 7. 4 Zulfi
==3 Juli 2022 @Tom Yan. Perintah pertama
$ systemctl status php8.1-fpm ● php8.1-fpm.service - The PHP 8.1 FastCGI Process Manager Loaded: loaded (/lib/systemd/system/php8.1-fpm.service; enabled; vendor prese Active: active (running) since Sun 2022-07-03 16:58:24 CDT; 42min ago Docs: man:php-fpm8.1(8) Process: 2087 ExecStartPost=/usr/lib/php/php-fpm-socket-helper install /run/ph Main PID: 1921 (php-fpm8.1) Status: "Processes active: 0, idle: 2, Requests: 0, slow: 0, Traffic: 0req/se Tasks: 3 (limit: 4915) CGroup: /system.slice/php8.1-fpm.service ├─1921 php-fpm: master process (/etc/php/8.1/fpm/php-fpm.conf) ├─2079 php-fpm: pool www └─2085 php-fpm: pool www Jul 03 16:58:24 lc2530hz systemd[1]: Starting The PHP 8.1 FastCGI Process Manage Jul 03 16:58:24 lc2530hz systemd[1]: Started The PHP 8.1 FastCGI Process Manager _Perintah Kedua
$ journalctl -bu php8.1-fpm Failed to parse boot descriptor 'u'Saya menemukan tautan berikut. https. //stackoverflow. com/questions/51158830/nginx-connect-to-unix-var-run-php7-2-fpm-sock-failed-2-no-such-file-or-dir,
tetapi itu tidak terkait dengan php8. 1-fpm, seseorang tolong bimbing saya
$ sudo ps aux | grep 'php' [sudo] password for zulfi: root 1921 0.0 0.1 454156 27524 ? Ss 16:58 0:00 php-fpm: master process (/etc/php/8.1/fpm/php-fpm.conf) www-data 2079 0.0 0.0 456452 13896 ? S 16:58 0:00 php-fpm: pool www www-data 2085 0.0 0.0 456452 13896 ? S 16:58 0:00 php-fpm: pool www zulfi 13627 0.0 0.0 210984 6284 ? Sl 17:39 0:00 /usr/lib/libreoffice/program/oosplash --writer file:///home/zulfi/Linux_Forum_SC%20Tools/nginx/nginx%20for%20php8/502%20bad%20gateway%20connect%20problem8p1.odt zulfi 13646 99.7 2.7 2006652 443460 ? Rl 17:39 25:54 /usr/lib/libreoffice/program/soffice.bin --writer file:///home/zulfi/Linux_Forum_SC%20Tools/nginx/nginx%20for%20php8/502%20bad%20gateway%20connect%20problem8p1.odt --splash-pipe=5 zulfi 15893 0.0 0.0 14432 1116 pts/0 S+ 18:05 0:00 grep --color=auto php _Juga. ~$ sudo nginx -t [sudo] password for zulfi: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful 7 aktif
@Tom Yan
@Tom Yan
masih mendapatkan. $ sudo nginx -t [sudo] password for zulfi: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful _8
status
$ sudo systemctl status /var/run/php/php8.1-fpm.sock [sudo] password for zulfi: Unit var-run-php-php8.1\x2dfpm.sock.mount could not be found.Dengarkan saya = dengarkan = /run/php/php8. 1-fpm. sock, haruskah saya mengubahnya ke /var/run/php8. 1-fpm. kaus kaki?
@Tom Yan, stat memberi saya kesalahan
$stat /var/run/php/php8.1-fpm.sock stat: cannot stat '/var/run/php/php8.1-fpm.sock': No such file or directorySaya juga punya versi lain
Apakah mereka menciptakan masalah?
$ sudo nginx -t [sudo] password for zulfi: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful _1dan
@lc2530hz
$ sudo nginx -t [sudo] password for zulfi: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful _2@lc2530hz. ~$ Juga www. conf memiliki tambahan berikut
$ sudo nginx -t [sudo] password for zulfi: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful _3dan dengarkan = 127. 0. 0. 1. 9000 diubah menjadi
$ sudo nginx -t [sudo] password for zulfi: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful _4Apakah saya masih membutuhkan
$ sudo nginx -t [sudo] password for zulfi: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful _5@Tom Yan, saya menerima pesan gagal
$ sudo nginx -t [sudo] password for zulfi: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful _6dan $ journalctl -xe 04 Juli 18. 28. Kernel 48 lc2530hz. CPU6. Temperatur paket di atas ambang batas, cpu 04 Juli 18. 28. Kernel 48 lc2530hz. CPU1. Temperatur paket di atas ambang batas, cpu 04 Juli 18. 28. Kernel 48 lc2530hz. CPU7. Pak