解决nginx和php使用ckfinder无法上传大文件的问题
2021-01-17 05:12
标签:basedir 代码 www replace form pos sources buffer -- cms内容发布系统上传不了大文件,当上传超过32M文件时就上传不了 提示:无效的文件. 文件尺寸太大。 browser --> nginx --> php 1.nginx.conf新增如下参数,重启无效: 2.修改php.ini配置,重启php-fpm无效: 资源网站大全 https://55wd.com 我的007办公资源网站 https://www.wode007.com 3.找到上传文件代码所在的目录 /data/www/cms/cmsx.chinasoft.com.wx/httpdocs/public 发现使用了 ckfinder 这个富文本插件 解决nginx和php使用ckfinder无法上传大文件的问题 标签:basedir 代码 www replace form pos sources buffer -- 原文地址:https://www.cnblogs.com/ypppt/p/13371153.html现象描述:
分析文件上传过程:
需要修改 nginx.conf和php.ini
client_max_body_size 512M;
client_body_buffer_size 128M;
/usr/local/php-7.0.12_fpm/lib/php.ini
post_max_size = 512M
upload_max_filesize = 256M
[root@newcms:/data/www/cms/cmsx.chinasoft.com.wx/httpdocs/public]# grep -ri "无效的文件. 文件尺寸太大"
resources/js/libs/ckfinder/core/connector/php/lang/zh-cn.php: ‘203‘ => ‘无效的文件. 文件尺寸太大。‘,
resources/js/libs/ckfinder/lang/zh-cn.js: 203 : ‘无效的文件. 文件尺寸太大。‘,
经过搜索发现限制在配置文件config.php,修改最大文件问题解决:[root@newcms:/data/www/cms/cmsx.chinasoft.com.wx/httpdocs/public]# find ./ -name config.php
/data/www/cms/cmsx.chinasoft.com.wx/httpdocs/public/resources/js/libs/ckfinder/config.php
$config[‘DefaultResourceTypes‘] = ‘‘;
$dir_name_1 = preg_replace(‘/.+\/([^\/]*[a-z]+\.[a-z]+)\/.+/‘, ‘$1‘, $baseDir);
$config[‘ResourceType‘][] = Array(
‘name‘ => $dir_name_1, // Single quotes not allowed
‘url‘ => $baseUrl,
‘directory‘ => $baseDir,
‘maxSize‘ => "300M", # 修改此处
‘allowedExtensions‘ => isset( $_GET[‘show_format‘] ) ? $_GET[‘show_format‘] : ‘‘,
‘deniedExtensions‘ => ‘‘);
$config[‘AccessControl‘][] = Array(
‘role‘ => ‘*‘,
‘resourceType‘ => $dir_name_1,
‘folder‘ => ‘/‘,
‘folderView‘ => true,
‘folderCreate‘ => true,
‘folderRename‘ => false,
‘folderDelete‘ => true,
‘fileView‘ => true,
‘fileUpload‘ => true,
‘fileRename‘ => true,
‘fileDelete‘ => true);
$dir_name_2 = ‘All files list‘;
$config[‘ResourceType‘][] = Array(
‘name‘ => $dir_name_2,
‘url‘ => ‘‘,
‘directory‘ => ‘‘,
‘maxSize‘ => "300M", # 修改此处
‘allowedExtensions‘ => isset( $_GET[‘show_format‘] ) ? $_GET[‘show_format‘] : ‘‘,
‘deniedExtensions‘ => ‘‘);
文章标题:解决nginx和php使用ckfinder无法上传大文件的问题
文章链接:http://soscw.com/index.php/essay/43044.html