LINUX.ORG.RU
ФорумAdmin

Не запускаются PHP скрипты на NGINX

 , ,


0

1

Приветствую всех форумчан, столкнулся с такой проблемой, на сервере Ubuntu 20.04 установлен NGINX+PHP7.4+MariaDB, NGINX работает испрапвно, html страничку при обращении к хосту выдаёт правильно, файл phpinfo.php при обращении не скачивается, а отображает информацию включая Server API: FPM/FastCGI - это говорит о том что PHP работает корректно, phpmyadmin тоже работает исправно, но вот проблема, пытаюсь залить хотябы скрипт форума phpbb и обращение к хосту выдаёт белую страницу, во всех папках присутствует файл .htaccess это я так понимаю атрибут APACHE, может какая то несовместимость? Как решить данную проблему и реально ли?


Ответ на: комментарий от Shulman

Тогда бы наверное phpmyadmin не работал! phpinfo.php выдаёт Server API: FPM/FastCGI php7.4-fpm стоит

Mooks
() автор топика
Ответ на: комментарий от Shulman
Вебсервер под управлением любой операционной системы с поддержкой PHP
Сервер SQL, список поддерживаемых:

MySQL 4.1.3 и выше (MySQLi)
MariaDB 5.1 и выше
PostgreSQL 8.3+
SQLite 3.6.15+
MS SQL Server 2000 и выше (прямое подключение, либо через ODBC или нативный драйвер)
Oracle

PHP 7.1 - 8 с поддержкой используемой СУБД.
Обязательные модули PHP:

json
mbstring

поддержка XML
Наличие следующих модулей PHP позволит получить дополнительные возможности (не обязательны):

Поддержка сжатия zlib
Поддержка удаленного доступа к FTP
Модуль GD

social engine v5 аналогично себя ведёт!

Mooks
() автор топика
Последнее исправление: Mooks (всего исправлений: 1)
Ответ на: комментарий от Mooks

я начал использовать nginx+php-fpm не так давно… и с дефолтными конфигами nginx никогда ничего не работало. всегда где то на форумах есть пример конфига который обсечпеивает работу конкретного приложения… так и ищи php-fpm+phpbb

Shulman
()
Ответ на: комментарий от Shulman

конфиг /etc/nginx/sites-available/default:

server {
	listen 80 default_server;
	listen [::]:80 default_server;


	root /var/www/html;

	# Add index.php to the list if you are using PHP
	index index.php index.html index.htm index.nginx-debian.html;

	server_name _;

	location / {
		# First attempt to serve request as file, then
		# as directory, then fall back to displaying a 404.
		try_files $uri $uri/ =404;
	}

        location ~ \.php$ {
                try_files $fastcgi_script_name =404;
                include fastcgi_params;
                fastcgi_pass  unix:/run/php/php7.4-fpm.sock;
                fastcgi_index index.php;
                fastcgi_param DOCUMENT_ROOT  $realpath_root;
                fastcgi_param SCRIPT_FILENAME   $realpath_root$fastcgi_script_name; 
        }


}



server {

	# SSL configuration
	#
	# listen 443 ssl default_server;
	# listen [::]:443 ssl default_server;
	#
	# Note: You should disable gzip for SSL traffic.
	# See: https://bugs.debian.org/773332
	#
	# Read up on ssl_ciphers to ensure a secure configuration.
	# See: https://bugs.debian.org/765782
	#
	# Self signed certs generated by the ssl-cert package
	# Don't use them in a production server!
	#
	# include snippets/snakeoil.conf;

	root /var/www/html;

	# Add index.php to the list if you are using PHP
	index index.php index.html index.htm index.nginx-debian.html;
    server_name site.ru; # managed by Certbot


	location / {
		# First attempt to serve request as file, then
		# as directory, then fall back to displaying a 404.
		try_files $uri $uri/ =404;
	}

        location ~ \.php$ {
                try_files $fastcgi_script_name =404;
                include fastcgi_params;
                fastcgi_pass  unix:/run/php/php7.4-fpm.sock;
                fastcgi_index index.php;
                fastcgi_param DOCUMENT_ROOT  $realpath_root;
                fastcgi_param SCRIPT_FILENAME   $realpath_root$fastcgi_script_name; 
        }




    listen [::]:443 ssl ipv6only=on; # managed by Certbot
    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/site.ru/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/site.ru/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}
server {
    if ($host = site.ru) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


	listen 80 ;
	listen [::]:80 ;
    server_name site.ru;
    return 404; # managed by Certbot


}

NGINX.conf

user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;

events {
	worker_connections 768;
	# multi_accept on;
}

http {

	##
	# Basic Settings
	##

	sendfile on;
	tcp_nopush on;
	tcp_nodelay on;
	keepalive_timeout 65;
	types_hash_max_size 2048;
	# server_tokens off;

	# server_names_hash_bucket_size 64;
	# server_name_in_redirect off;

	include /etc/nginx/mime.types;
	default_type application/octet-stream;

	##
	# SSL Settings
	##

	ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # Dropping SSLv3, ref: POODLE
	ssl_prefer_server_ciphers on;

	##
	# Logging Settings
	##

	access_log /var/log/nginx/access.log;
	error_log /var/log/nginx/error.log;

	##
	# Gzip Settings
	##

	gzip on;

	# gzip_vary on;
	# gzip_proxied any;
	# gzip_comp_level 6;
	# gzip_buffers 16 8k;
	# gzip_http_version 1.1;
	# gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

	##
	# Virtual Host Configs
	##

	include /etc/nginx/conf.d/*.conf;
	include /etc/nginx/sites-enabled/*;
}


#mail {
#	# See sample authentication script at:
#	# http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
# 
#	# auth_http localhost/auth.php;
#	# pop3_capabilities "TOP" "USER";
#	# imap_capabilities "IMAP4rev1" "UIDPLUS";
# 
#	server {
#		listen     localhost:110;
#		protocol   pop3;
#		proxy      on;
#	}
# 
#	server {
#		listen     localhost:143;
#		protocol   imap;
#		proxy      on;
#	}
#}

Mooks
() автор топика
Ответ на: комментарий от ya-betmen
11.111.111.111 - - [01/Feb/2021:11:08:57 +0000] "GET /phpBB3/install/phpinfo.php HTTP/1.1" 404 134 "-" "MYOB/6.66 (AN/ON)"
11.111.111.111 - - [01/Feb/2021:11:09:28 +0000] "GET /phpBB3/ HTTP/1.1" 403 134 "-" "MYOB/6.66 (AN/ON)"
11.111.111.111 - - [01/Feb/2021:11:09:43 +0000] "GET /phpBB3/ HTTP/1.1" 403 134 "-" "MYOB/6.66 (AN/ON)"
11.111.111.111 - - [01/Feb/2021:11:09:46 +0000] "GET /phpBB3/ HTTP/1.1" 403 134 "-" "MYOB/6.66 (AN/ON)"
11.111.111.111 - - [01/Feb/2021:11:09:47 +0000] "GET /favicon.ico HTTP/1.1" 404 134 "/phpBB3/" "MYOB/6.66 (AN/ON)"
11.111.111.111 - - [01/Feb/2021:11:10:14 +0000] "GET /phpBB3/ HTTP/1.1" 403 134 "-" "MYOB/6.66 (AN/ON)"
162.142.125.54 - - [01/Feb/2021:11:10:15 +0000] "\x16\x03\x01\x00{\x01\x00\x00w\x03\x03\xB9\xD1\xCD \x88{>\xA7!\xEA\x09+\xB4|\xE3\xE8\xD3\xD7\x09\x84\x11n\x1C\xDAr>\xEC\x82\x8F\x1F~`\x00\x00\x1A\xC0/\xC0+\xC0\x11\xC0\x07\xC0\x13\xC0\x09\xC0\x14\xC0" 400 166 "-" "-"
162.142.125.54 - - [01/Feb/2021:11:10:15 +0000] "GET / HTTP/1.1" 403 162 "-" "-"
162.142.125.54 - - [01/Feb/2021:11:10:16 +0000] "GET / HTTP/1.1" 403 134 "-" "Mozilla/5.0 (compatible; CensysInspect/1.1; +https://about.censys.io/)"
11.111.111.111 - - [01/Feb/2021:11:11:59 +0000] "GET / HTTP/1.1" 500 5 "-" "MYOB/6.66 (AN/ON)"
11.111.111.111 - - [01/Feb/2021:11:12:01 +0000] "GET / HTTP/1.1" 500 5 "-" "MYOB/6.66 (AN/ON)"
11.111.111.111 - - [01/Feb/2021:11:12:04 +0000] "GET / HTTP/1.1" 500 5 "-" "MYOB/6.66 (AN/ON)"
11.111.111.111 - - [01/Feb/2021:11:12:05 +0000] "GET /favicon.ico HTTP/1.1" 404 134 "/" "MYOB/6.66 (AN/ON)"
11.111.111.111 - - [01/Feb/2021:11:12:07 +0000] "GET / HTTP/1.1" 500 5 "-" "MYOB/6.66 (AN/ON)"
11.111.111.111 - - [01/Feb/2021:11:12:10 +0000] "GET / HTTP/1.1" 500 5 "-" "MYOB/6.66 (AN/ON)"
192.241.225.33 - - [01/Feb/2021:11:12:27 +0000] "GET / HTTP/1.1" 200 287 "-" "Mozilla/5.0 zgrab/0.x"
11.111.111.111 - - [01/Feb/2021:11:13:36 +0000] "GET / HTTP/1.1" 500 5 "-" "MYOB/6.66 (AN/ON)"
11.111.111.111 - - [01/Feb/2021:11:14:21 +0000] "GET / HTTP/1.1" 500 5 "-" "MYOB/6.66 (AN/ON)"
11.111.111.111 - - [01/Feb/2021:11:14:22 +0000] "GET / HTTP/1.1" 500 5 "-" "MYOB/6.66 (AN/ON)"
11.111.111.111 - - [01/Feb/2021:11:19:03 +0000] "GET / HTTP/1.1" 500 5 "-" "MYOB/6.66 (AN/ON)"
11.111.111.111 - - [01/Feb/2021:11:19:04 +0000] "GET / HTTP/1.1" 500 5 "-" "MYOB/6.66 (AN/ON)"
11.111.111.111 - - [01/Feb/2021:11:19:08 +0000] "GET / HTTP/1.1" 500 5 "-" "MYOB/6.66 (AN/ON)"
11.111.111.111 - - [01/Feb/2021:11:19:17 +0000] "GET /phpinfo.php HTTP/1.1" 200 25830 "-" "MYOB/6.66 (AN/ON)"
11.111.111.111 - - [01/Feb/2021:11:20:51 +0000] "GET /phpinfo.php HTTP/1.1" 200 25848 "-" "MYOB/6.66 (AN/ON)"
11.111.111.111 - - [01/Feb/2021:11:20:55 +0000] "GET /phpinfo.php HTTP/1.1" 200 25844 "-" "MYOB/6.66 (AN/ON)"
11.111.111.111 - - [01/Feb/2021:11:20:57 +0000] "GET /phpinfo.php HTTP/1.1" 200 25848 "-" "MYOB/6.66 (AN/ON)"
188.16.112.6 - - [01/Feb/2021:11:33:02 +0000] "GET /proxy.pac HTTP/1.1" 301 178 "-" "WinHttp-Autoproxy-Service/5.1"
188.16.112.6 - - [01/Feb/2021:11:33:02 +0000] "GET /proxy.pac HTTP/1.1" 304 0 "-" "WinHttp-Autoproxy-Service/5.1"
11.111.111.111 - - [01/Feb/2021:11:33:42 +0000] "GET / HTTP/1.1" 500 5 "-" "MYOB/6.66 (AN/ON)"
11.111.111.111 - - [01/Feb/2021:11:33:44 +0000] "GET / HTTP/1.1" 500 5 "-" "MYOB/6.66 (AN/ON)"
11.111.111.111 - - [01/Feb/2021:11:33:50 +0000] "GET / HTTP/1.1" 500 5 "-" "MYOB/6.66 (AN/ON)"
11.111.111.111 - - [01/Feb/2021:11:34:05 +0000] "GET /install/ HTTP/1.1" 403 134 "-" "MYOB/6.66 (AN/ON)"
11.111.111.111 - - [01/Feb/2021:11:34:05 +0000] "GET /favicon.ico HTTP/1.1" 404 134 "/install/" "MYOB/6.66 (AN/ON)"
11.111.111.111 - - [01/Feb/2021:11:34:49 +0000] "GET /install/index.html HTTP/1.1" 404 134 "-" "MYOB/6.66 (AN/ON)"
11.111.111.111 - - [01/Feb/2021:11:35:03 +0000] "GET /install/index.html HTTP/1.1" 404 134 "-" "MYOB/6.66 (AN/ON)"
11.111.111.111 - - [01/Feb/2021:11:35:37 +0000] "GET /install/phpinfo.php HTTP/1.1" 404 134 "-" "MYOB/6.66 (AN/ON)"
11.111.111.111 - - [01/Feb/2021:11:35:40 +0000] "GET /install/phpinfo.php HTTP/1.1" 404 134 "-" "MYOB/6.66 (AN/ON)"
11.111.111.111 - - [01/Feb/2021:11:35:49 +0000] "GET / HTTP/1.1" 500 5 "-" "MYOB/6.66 (AN/ON)"
11.111.111.111 - - [01/Feb/2021:11:35:53 +0000] "GET / HTTP/1.1" 500 5 "-" "MYOB/6.66 (AN/ON)"
11.111.111.111 - - [01/Feb/2021:11:36:23 +0000] "GET / HTTP/1.1" 500 5 "-" "MYOB/6.66 (AN/ON)"
11.111.111.111 - - [01/Feb/2021:11:39:28 +0000] "GET / HTTP/1.1" 500 5 "-" "MYOB/6.66 (AN/ON)"
2.195.165.66 - - [01/Feb/2021:11:40:35 +0000] "GET / HTTP/1.1" 200 423 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36"
192.241.217.89 - - [01/Feb/2021:11:40:59 +0000] "GET / HTTP/1.1" 200 287 "-" "Mozilla/5.0 zgrab/0.x"
11.111.111.111 - - [01/Feb/2021:11:41:21 +0000] "GET / HTTP/1.1" 500 5 "-" "MYOB/6.66 (AN/ON)"
11.111.111.111 - - [01/Feb/2021:11:41:59 +0000] "GET / HTTP/1.1" 500 5 "-" "MYOB/6.66 (AN/ON)"
11.111.111.111 - - [01/Feb/2021:11:42:31 +0000] "GET / HTTP/1.1" 500 5 "-" "MYOB/6.66 (AN/ON)"
11.111.111.111 - - [01/Feb/2021:11:43:17 +0000] "GET / HTTP/1.1" 500 5 "-" "MYOB/6.66 (AN/ON)"
11.111.111.111 - - [01/Feb/2021:11:44:29 +0000] "GET / HTTP/1.1" 500 5 "-" "MYOB/6.66 (AN/ON)"
109.171.49.211 - - [01/Feb/2021:11:49:19 +0000] "GET / HTTP/1.1" 200 287 "-" "Mozilla/5.0 (Windows NT 5.1; rv:9.0.1) Gecko/20100101 Firefox/9.0.1"
109.171.49.211 - - [01/Feb/2021:11:49:20 +0000] "GET /HNAP1/ HTTP/1.1" 404 134 "http://11.111.111.111/" "Mozilla/5.0 (Windows NT 5.1; rv:9.0.1) Gecko/20100101 Firefox/9.0.1"
11.111.111.111 - - [01/Feb/2021:11:49:48 +0000] "GET /phpinfo.php HTTP/1.1" 200 25825 "-" "MYOB/6.66 (AN/ON)"
103.149.192.235 - - [01/Feb/2021:11:50:58 +0000] "GET / HTTP/1.1" 200 287 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36"
188.16.112.6 - - [01/Feb/2021:12:03:02 +0000] "GET /proxy.pac HTTP/1.1" 301 178 "-" "WinHttp-Autoproxy-Service/5.1"
188.16.112.6 - - [01/Feb/2021:12:03:03 +0000] "GET /proxy.pac HTTP/1.1" 304 0 "-" "WinHttp-Autoproxy-Service/5.1"
89.248.168.108 - - [01/Feb/2021:12:08:52 +0000] "HEAD / HTTP/1.0" 200 0 "-" "-"
11.111.111.111 - - [01/Feb/2021:12:11:36 +0000] "GET /phpinfo.php HTTP/1.1" 200 25847 "-" "MYOB/6.66 (AN/ON)"
11.111.111.111 - - [01/Feb/2021:12:12:48 +0000] "GET /phpinfo.php HTTP/1.1" 200 25845 "-" "MYOB/6.66 (AN/ON)"
11.111.111.111 - - [01/Feb/2021:12:12:52 +0000] "GET /phpinfo.php HTTP/1.1" 200 25845 "-" "MYOB/6.66 (AN/ON)"
185.172.110.208 - - [01/Feb/2021:12:15:59 +0000] "HEAD / HTTP/1.0" 200 0 "-" "-"
Mooks
() автор топика
Ответ на: комментарий от Mooks

Хорошо, а теперь лог ошибок пхп-фпм. Ты почти у цели.

slowpony ★★★★★
()
Ответ на: комментарий от thesis

Чтобы на него срали боты в заброшенные разделы, разумеется. А потом все это говно неделями индексировал яндекс, завешивая ОПу тачку.

slowpony ★★★★★
()

обращение к хосту выдаёт белую страницу

см. error log

расположение error log и настройки логирования смотри в php.ini

версия phpbb совместима с 7.4?

Ford_Focus ★★★★★
()
Ответ на: комментарий от thesis

если я правильно понимаю, то форум будет не совсем в интернете, а в i2p. В даркнете форумы вполне себе живое средство общения.

Ford_Focus ★★★★★
()
Ответ на: комментарий от Mooks

Сдается мне у тебя с правами на тех файликах не всё в порядке

ya-betmen ★★★★★
()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.