配置环境:
- 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 仪表盘截图(未见问题):
Chevereto 首页截图(问题所在,此时用户以管理员身份已登录):
上传图片时的报错(从仪表盘上传和已管理员用户身份上传报错信息一致):
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…