使用阿里云ROS 一键编排wordpress 网站。
:上传文件限制2M
Q:
WordPress 出现 413 Request Entity Too Large
A:
nginx:
client_max_body_size 64M;
修改nginx 限制
vim /etc/nginx/nginx.conf
添加或者修改 http ,server 块中的参数:
http {
client_max_body_size 10M; # 限制所有请求的最大上传文件大小为10MB
}
修改PHP ini
find / -name*php.ini*
php/fpm/php.ini
upload_max_filesize = 64M
post_max_size = 64M
重启PHP fpm服务。
php8.0-fpm.service
systemctl list-units --type=service --all | grep php
sudo systemctl restart php8.0-fpm.service
重启nginx
nginx -s reload
sudo systemctl restart nginx