1

Пытаюсь открыть php файл(Hello World!) в браузере.Chrome выдает(No input file specified.) В логах php7.0-fpm.log ошибок нет.В логах nginx пишет:

::1 - - [24/Oct/2016:18:02:15 +0300] "GET /certunia/helloworld.php
HTTP/1.1" 404 56 "-" "Mozilla/5.0 (X11; Linux x86_64) 
AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/53.0.2785.143
Chrome/53.0.2785.143 Safari/537.36"

файл default:

server
{
    listen 80 default_server;
    listen [::]:80 default_server ipv6only=on;

    server_name localhost;

    root /usr/share/nginx/html;

    location /
    {

    }

    location /certunia/
    {
            index index.php index.html;
            alias /home/certunia/php;

            location ~ \.php$
            {
                    fastcgi_split_path_info ^(.+\.php)(/.+)$;
                    fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
                    fastcgi_index index.php;
                    include fastcgi.conf;
                    fastcgi_param SCRIPT_FILENAME /home/certunia/php$fastcgi_script_name;
            }
     }
}
1
  • теоретически, не хватает слэша после php /home/certunia/php/$fastcgi_script_name
    – DiGiTAL
    27 окт 2016 в 12:31

1 ответ 1

0
server {
    listen 80;
    server_name localhost;
    root /usr/share/nginx/html;

    index index.html index.htm index.php;

    charset utf-8;

    location / {
        try_files $uri $uri/ /index.php$is_args$args;
    }


    access_log off;
    error_log  /var/log/nginx/site.log error;

    sendfile off;

    client_max_body_size 100m;

     location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/run/php/php7.0-fpm.sock;
        fastcgi_index index.php;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_intercept_errors off;
        fastcgi_buffer_size 16k;
        fastcgi_buffers 4 16k;
    }





    location ~ /\.ht {
        deny all;
    }
}
1
  • Помогло,спасибо. 1 ноя 2016 в 12:59

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.