Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/247.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 通过浏览器连接IP地址时,在nginx 404上创建新的Lumen应用程序_Php_Laravel_Ubuntu_Nginx_Lumen - Fatal编程技术网

Php 通过浏览器连接IP地址时,在nginx 404上创建新的Lumen应用程序

Php 通过浏览器连接IP地址时,在nginx 404上创建新的Lumen应用程序,php,laravel,ubuntu,nginx,lumen,Php,Laravel,Ubuntu,Nginx,Lumen,我正在尝试在Digital Ocean上的Nginx服务器上创建一个普通Lumen应用程序。接下来,我按照上面所说的一切进行操作,直到安装了Laravel 而不是这个 composer create-project laravel/laravel /var/www/lumen/ 4.1 我曾经 composer create-project --prefer-dist laravel/lumen blog` instead. 当我使用ls时,Lumen文档现在似乎在目录中 但是,当我点击IP

我正在尝试在Digital Ocean上的Nginx服务器上创建一个普通Lumen应用程序。接下来,我按照上面所说的一切进行操作,直到安装了Laravel

而不是这个

composer create-project laravel/laravel /var/www/lumen/ 4.1
我曾经

composer create-project --prefer-dist laravel/lumen blog` instead.
当我使用
ls
时,Lumen文档现在似乎在目录中

但是,当我点击IP地址或ipAddress/index.php时,它显示

404未找到-nginx/1.4.6(Ubuntu)


另外,这是我对虚拟主机文件的配置(
nano/etc/nginx/sites available/default
)`:


我做错了什么或错过了什么


另外,如果我尝试使用PhpStorm连接到SSH目录,我会收到一个错误:

ssh://root@46.101.172.134:22null /usr/bin/php
env: /var/www/Lumen: Permission denied

Process finished with exit code 126
还请检查有关此错误的详细信息


编辑2:

我尝试将服务器更改为

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

    listen 443 ssl;
    
    root /var/www/lumen/public;
    index index.php index.html index.htm;

    server_name IPAddress;
    ssl_certificate /etc/nginx/ssl/nginx.crt;    // I didn't set this
    ssl_certificate_key /etc/nginx/ssl/nginx.key;  //  and this

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location ~ \.php$ {
        try_files $uri /index.php =404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }
}

我曾经在nginx上创建SSL证书。然后,hitting给了我Lumen/Laravel的东西。

为什么在路由中使用index.php?如果你在浏览器中点击你的ip地址,你会得到404吗。另外,您的路由文件中是否有返回的内容。我安装了Lumen,因此它应该有
ipaddress/
的路由。如果我点击了ip地址,我收到的答案是更新SSL证书详细信息
server {
    listen 80 default_server;
    listen [::]:80 default_server ipv6only=on;

    listen 443 ssl;
    
    root /var/www/lumen/public;
    index index.php index.html index.htm;

    server_name IPAddress;
    ssl_certificate /etc/nginx/ssl/nginx.crt;    // I didn't set this
    ssl_certificate_key /etc/nginx/ssl/nginx.key;  //  and this

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location ~ \.php$ {
        try_files $uri /index.php =404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }
}