zabbix6.2:File is too big, max upload size is 2097152 bytes

zabbix6.2:File is too big, max upload size is 2097152 bytes

导入模版时模版文件大于2M时报错如下:
File is too big, max upload size is 2097152 bytes
文件上传的最大设置是2097152 bytes 也就是2M

更改php设置:

# cat /etc/zabbix/php-fpm.conf
[zabbix]
user = www-data
group = www-data

listen = /var/run/php/zabbix.sock
listen.owner = www-data
listen.allowed_clients = 127.0.0.1

pm = dynamic
pm.max_children = 50
pm.start_servers = 5
pm.min_spare_servers = 5
pm.max_spare_servers = 35
pm.max_requests = 200

php_value[session.save_handler] = files
php_value[session.save_path]    = /var/lib/php/sessions/

php_value[max_execution_time] = 300
php_value[memory_limit] = 128M
php_value[post_max_size] = 16M  
php_value[upload_max_filesize] = 8M ##由原来的2m改成8m
php_value[max_input_time] = 300
php_value[max_input_vars] = 10000

重启php后又报500的错误,看日志报错信息如下:

2022/12/08 09:41:20 [error] 41101#41101: *1 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 4096 bytes) in /usr/share/zabbix/include/classes/html/CTag.php on line 97" while reading response header from upstream, client: x, server: xx, request: "POST /zabbix.php?action=popup.import.compare&import_overlayid=oa8qrs HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/zabbix.sock:", host: "xx", referrer: "http://10.20.138.13:8080/templates.php"

继续修改/etc/zabbix/php-fpm.conf

php_value[memory_limit] = 256M

重启后上传成功

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值