lsky-pro
lsky-pro copied to clipboard
无法打开安装页面
nginx 配置如下
root /var/www/html;
server_name _;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php-fpm.sock;
}
访问 ip/lsky/public/ 会跳转到 ip/lsky/public/install,但是提示404,测试 ip/test.php 没问题
root应该是/var/www/html/lsky/public
我对这里也进行了尝试,结果是跳转到 ip/install 之后显示404
tree一下/var/www/html,看一下结果。
└── html
├── index.nginx-debian.html
├── lsky
│ ├── app
│ │ ├── Console
│ │ ├── Enums
│ │ ├── Exceptions
│ │ ├── Http
│ │ ├── Mail
│ │ ├── Models
│ │ ├── Providers
│ │ ├── Services
│ │ ├── Utils.php
│ │ └── View
│ ├── artisan
│ ├── bootstrap
│ │ ├── app.php
│ │ └── cache
│ ├── composer.json
│ ├── composer.lock
│ ├── config
│ │ ├── app.php
│ │ ├── auth.php
│ │ ├── broadcasting.php
│ │ ├── cache.php
│ │ ├── convention.php
│ │ ├── cors.php
│ │ ├── database.php
│ │ ├── debugbar.php
│ │ ├── filesystems.php
│ │ ├── flare.php
│ │ ├── hashing.php
│ │ ├── ignition.php
│ │ ├── image.php
│ │ ├── logging.php
│ │ ├── mail.php
│ │ ├── octane.php
│ │ ├── queue.php
│ │ ├── sanctum.php
│ │ ├── services.php
│ │ ├── session.php
│ │ └── view.php
│ ├── database
│ │ ├── factories
│ │ ├── migrations
│ │ └── seeders
│ ├── lang
│ │ ├── en
│ │ ├── en.json
│ │ ├── zh_CN
│ │ └── zh_CN.json
│ ├── LICENSE
│ ├── lsky-pro-2.0.4.zip
│ ├── package.json
│ ├── package-lock.json
│ ├── phpunit.xml
│ ├── public
│ │ ├── css
│ │ ├── favicon.ico
│ │ ├── fonts
│ │ ├── index.php
│ │ ├── js
│ │ ├── mix-manifest.json
│ │ ├── robots.txt
│ │ └── thumbnails
│ ├── README.md
│ ├── resources
│ │ ├── css
│ │ ├── js
│ │ └── views
│ ├── routes
│ │ ├── api.php
│ │ ├── auth.php
│ │ ├── channels.php
│ │ ├── console.php
│ │ ├── image.php
│ │ └── web.php
│ ├── storage
│ │ ├── app
│ │ ├── debugbar
│ │ ├── framework
│ │ └── logs
│ ├── tailwind.config.js
│ ├── tests
│ │ ├── CreatesApplication.php
│ │ ├── Feature
│ │ ├── TestCase.php
│ │ └── Unit
│ ├── vendor
│ │ ├── adbario
│ │ ├── alapi
│ │ ├── alibabacloud
│ │ ├── aliyuncs
│ │ ├── asm89
│ │ ├── autoload.php
│ │ ├── aws
│ │ ├── barryvdh
│ │ ├── bin
│ │ ├── brick
│ │ ├── clagiordano
│ │ ├── composer
│ │ ├── danielstjules
│ │ ├── dflydev
│ │ ├── doctrine
│ │ ├── dragonmantank
│ │ ├── egulias
│ │ ├── erusev
│ │ ├── facade
│ │ ├── fakerphp
│ │ ├── filp
│ │ ├── fruitcake
│ │ ├── graham-campbell
│ │ ├── guzzlehttp
│ │ ├── hamcrest
│ │ ├── intervention
│ │ ├── laminas
│ │ ├── laravel
│ │ ├── league
│ │ ├── maximebf
│ │ ├── mockery
│ │ ├── monolog
│ │ ├── mtdowling
│ │ ├── myclabs
│ │ ├── nesbot
│ │ ├── nette
│ │ ├── nikic
│ │ ├── nunomaduro
│ │ ├── opis
│ │ ├── overtrue
│ │ ├── phar-io
│ │ ├── phpdocumentor
│ │ ├── phpoption
│ │ ├── phpseclib
│ │ ├── phpspec
│ │ ├── phpunit
│ │ ├── psr
│ │ ├── psy
│ │ ├── qiniu
│ │ ├── ralouphie
│ │ ├── ramsey
│ │ ├── sabre
│ │ ├── sebastian
│ │ ├── spatie
│ │ ├── symfony
│ │ ├── tencentcloud
│ │ ├── theseer
│ │ ├── tijsverkoyen
│ │ ├── vlucas
│ │ ├── voku
│ │ ├── webmozart
│ │ ├── wispx
│ │ └── zing
│ └── webpack.mix.js
└── test.php
重启 nginx 试一下
供参考
server
{
listen 80;
server_name _;
index index.php;
root /var/www/html/lsky/public;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ [^/]\.php(/|$)
{
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php-fpm.sock;
}
}
root 需要指向 public 目录
重启过nginx了,并且root也指向public了
和上面的参考差不多
root /var/www/html/lsky/public;
index index.php index.html index.htm index.nginx-debian.html;
server_name _;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
# pass PHP scripts to FastCGI server
#
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php-fpm.sock;
}
nginx 的 access.log , error.log 是空的
127.0.0.1 - - [15/Aug/2022:10:44:24 +0800] "GET / HTTP/1.1" 302 390 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36"
127.0.0.1 - - [15/Aug/2022:10:44:24 +0800] "GET /install HTTP/1.1" 404 187 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36"
@276562578 老哥你解决了嘛?