f4team-cn / f4pan

A website to get netdisk download link for users who cannot install the client
GNU Affero General Public License v3.0
336 stars 45 forks source link

MySQL,Redis,curl要求无限制是什么意思?已安装 #3

Closed ZZ0YY closed 3 months ago

ZZ0YY commented 3 months ago

Screenshot_2024-08-05-13-24-21-69_4d38fce200f96aeac5e860e739312e76.jpg

Yincmewy commented 3 months ago

除PHP版本要求8.0以上之外,其他的软件版本无限制

qllokirin commented 2 weeks ago

image

有同上的情况,但应该都安装了已经

 qllokirin-n100@qllokirin-n100  /var/www/html/4pan  php --version   

PHP 8.0.30 (cli) (built: Sep 27 2024 04:11:12) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.30, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.30, Copyright (c), by Zend Technologies
 qllokirin-n100@qllokirin-n100  /var/www/html/4pan  sudo apt install php8.0-mysql php8.0-redis php8.0-curl
[sudo] password for qllokirin-n100: 
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
php8.0-curl is already the newest version (1:8.0.30-9+ubuntu22.04.1+deb.sury.org+1).
php8.0-mysql is already the newest version (1:8.0.30-9+ubuntu22.04.1+deb.sury.org+1).
php8.0-redis is already the newest version (6.0.2-4+ubuntu22.04.1+deb.sury.org+1).
The following packages were automatically installed and are no longer required:
  libwpe-1.0-1 libwpebackend-fdo-1.0-1
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 65 not upgraded.

此外发现点击下一步和重新检查的状态码都是304 Not Modified,感觉应该是不正常的,一直点就会变成200 OK (from disk cache) 会伴随出现弹窗 image

我的nginx配置如下

sudo cat /etc/nginx/sites-enabled/4pan.conf
server {
    listen 8001;
    server_name _;  # 允许通过 IP 地址访问
    root /var/www/html/4pan/public;  # 指定项目的 public 目录为根目录

    # 禁止访问 runtime 和 application 目录,增强安全性
    location ~* /(runtime|application)/ {
        return 403;
    }

    # 处理 API 请求,转发给 PHP 入口文件 index.php
    location /api {
        rewrite ^(.*)$ /index.php?s=$1 last;
        break;
    }

    # 处理前端静态资源请求
    location / {
        index index.html;  # 默认首页文件
        try_files $uri $uri/ /index.html;
    }
}

依赖安装应该是没问题的

/var/www/html/4pan  sudo composer install
[sudo] password for qllokirin-n100: 
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Continue as root/super user [yes]? yes
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Nothing to install, update or remove
Generating autoload files
> @php think service:discover
Succeed!
> @php think vendor:publish
File /var/www/html/4pan/config/trace.php exist!
File /var/www/html/4pan/config/redis.php exist!
Succeed!
6 packages you are using are looking for funding.
Use the `composer fund` command to find out more!

请问佬能帮忙看看是个什么问题吗

请检查是否在网站目录执行composer install安装依赖

A: 似乎是没有问题的 image image

qllokirin commented 1 week ago

image

有同上的情况,但应该都安装了已经

 qllokirin-n100@qllokirin-n100  /var/www/html/4pan  php --version   

PHP 8.0.30 (cli) (built: Sep 27 2024 04:11:12) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.30, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.30, Copyright (c), by Zend Technologies
 qllokirin-n100@qllokirin-n100  /var/www/html/4pan  sudo apt install php8.0-mysql php8.0-redis php8.0-curl
[sudo] password for qllokirin-n100: 
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
php8.0-curl is already the newest version (1:8.0.30-9+ubuntu22.04.1+deb.sury.org+1).
php8.0-mysql is already the newest version (1:8.0.30-9+ubuntu22.04.1+deb.sury.org+1).
php8.0-redis is already the newest version (6.0.2-4+ubuntu22.04.1+deb.sury.org+1).
The following packages were automatically installed and are no longer required:
  libwpe-1.0-1 libwpebackend-fdo-1.0-1
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 65 not upgraded.

此外发现点击下一步和重新检查的状态码都是304 Not Modified,感觉应该是不正常的,一直点就会变成200 OK (from disk cache) 会伴随出现弹窗 image

我的nginx配置如下

sudo cat /etc/nginx/sites-enabled/4pan.conf
server {
    listen 8001;
    server_name _;  # 允许通过 IP 地址访问
    root /var/www/html/4pan/public;  # 指定项目的 public 目录为根目录

    # 禁止访问 runtime 和 application 目录,增强安全性
    location ~* /(runtime|application)/ {
        return 403;
    }

    # 处理 API 请求,转发给 PHP 入口文件 index.php
    location /api {
        rewrite ^(.*)$ /index.php?s=$1 last;
        break;
    }

    # 处理前端静态资源请求
    location / {
        index index.html;  # 默认首页文件
        try_files $uri $uri/ /index.html;
    }
}

依赖安装应该是没问题的

/var/www/html/4pan  sudo composer install
[sudo] password for qllokirin-n100: 
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Continue as root/super user [yes]? yes
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Nothing to install, update or remove
Generating autoload files
> @php think service:discover
Succeed!
> @php think vendor:publish
File /var/www/html/4pan/config/trace.php exist!
File /var/www/html/4pan/config/redis.php exist!
Succeed!
6 packages you are using are looking for funding.
Use the `composer fund` command to find out more!

请问佬能帮忙看看是个什么问题吗

请检查是否在网站目录执行composer install安装依赖

A: 似乎是没有问题的 image image

已解决 我是因为nginx没有写location ~ .php$这一部分

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/var/run/php/php8.0-fpm.sock; # 依据实际PHP版本调整路径
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }