Chevereto 的 PHP 7.2 配置修改最大上传容量后为何仍无法上传大于 10MB 的图片?

新手上路,请多包涵

配置环境:

  • LNMP with Ubuntu 18.04
  • VPS 内存 1024MB
  • PHP 版本 7.2
  • Chevereto 版本 1.3.0

/etc/php/7.2/fpm/conf.d/chevereto.ini 文件的配置如下:

upload_max_filesize = 64M;
post_max_size = 64M;
max_execution_time = 120;
memory_limit = 1024M;

/etc/nginx/sites-available/image.prosanto.me.conf 文件配置如下,并且已经创建 /etc/nginx/sites-enabled/ 的软连接:

server {
    listen         80 default_server;
    listen         [::]:80 default_server;
    server_name    image.prosanto.me;
    root           /var/www/html/chevereto;
    index          index.html;

    # Context limits
    client_max_body_size 64M;

    # Disable access to sensitive files
    location ~* (app|content|lib)/.*\.(po|php|lock|sql)$ {
        deny all;
    }

    # Image not found replacement
    location ~ \.(jpe?g|png|gif|webp)$ {
        log_not_found off;
        error_page 404 /content/images/system/default/404.gif;
    }

    # CORS header (avoids font rendering issues)
    location ~ \.(ttf|ttc|otf|eot|woff|woff2|font.css|css|js)$ {
        add_header Access-Control-Allow-Origin "*";
    }

    # Pretty URLs
    location / {
        index index.php;
        try_files $uri $uri/ /index.php$is_args$query_string;
    }

    location ~* \.php$ {
        fastcgi_pass unix:/run/php/php7.2-fpm.sock;
        include         fastcgi_params;
        fastcgi_param   SCRIPT_FILENAME    $document_root$fastcgi_script_name;
        fastcgi_param   SCRIPT_NAME        $fastcgi_script_name;
    }
}

并且已经重启过 PHP 和 Nginx:

systemctl restart php7.2-fpm
systemctl restart nginx

Chevereto 仪表盘截图(未见问题):
CheveretoPanel.png
Chevereto 首页截图(问题所在,此时用户以管理员身份已登录):
ProblemTemp.png


上传图片时的报错(从仪表盘上传和已管理员用户身份上传报错信息一致):
ProblemDemo.png

阅读 4.9k
1 个回答

Chevereto图床后台显示的参数是修改了,前台上传还是没有变化,这是为什么呢?其实很简单,那就是Chevereto图床设置中没有设置好最大上传大小和最大执行大小!

修改了PHP.INI参数后,前往Chevereto图床管理员后台,设置-网站-图片上传中修改最大文件大小 (MB) [MB]

Chevereto图床如何修改文件上传大小

Chevereto图床如何修改文件上传大小

这样我们才能成功修改Chevereto图床的文件上传大小!两个步骤缺一不可!另外技术宅友情提醒下,如果图片上传尺寸过大,服务器上传不给力的话还需要修改下最大可执行时间

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题