响应式文件管理器内存限制错误

Posted

技术标签:

【中文标题】响应式文件管理器内存限制错误【英文标题】:Responsive File Manager Memory Limit Error 【发布时间】:2018-01-23 10:02:27 【问题描述】:

我在使用响应式文件管理器上传大文件时遇到问题,它显示内存限制不足错误。

我尝试在 php.ini 中更改限制

上传限制为 100MB 帖子最大大小为 100MB 脚本内存限制为 300MB 最大执行时间为 300

我也改变了config.php中的限制

'MaxSizeUpload' => 100

但还是同样的错误。

现在连 100 kb 都没有上传。

可能是什么问题?

编辑 1:

我使用响应式文件管理器中的默认 upload.php 来上传我的文件

在第 157 行检查内存错误

默认upload.php

我的配置文件

<?php
if (session_id() == '') session_start();

mb_internal_encoding('UTF-8');
mb_http_output('UTF-8');
mb_http_input('UTF-8');
mb_language('uni');
mb_regex_encoding('UTF-8');
ob_start('mb_output_handler');
date_default_timezone_set('Asia/Kolkata');


define('USE_ACCESS_KEYS', false); // TRUE or FALSE

define('DEBUG_ERROR_MESSAGE', true); // TRUE or FALSE

$config = array(

    'base_url' => ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] && ! in_array(strtolower($_SERVER['HTTPS']), array( 'off', 'no' ))) ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'],

    'upload_dir' => '/photos/original/',

    'current_path' => '../photos/original/',

    'thumbs_base_path' => '../cache/',

    'ftp_host'         => false,
    'ftp_user'         => "user",
    'ftp_pass'         => "pass",
    'ftp_base_folder'  => "base_folder",
    'ftp_base_url'     => "http://site to ftp root",

    'ftp_thumbs_dir' => '/thumbs/',
    'ftp_ssl' => false,
    'ftp_port' => 21,

    'access_keys' => array(),

    'MaxSizeTotal' => false,

    'MaxSizeUpload' => 100,

    'fileFolderPermission' => 0755,

    'default_language' => "en_EN",

    'icon_theme' => "ico",

    'show_total_size'                       => false,

    'show_folder_size'                      => false,

    'show_sorting_bar'                      => true,

    'show_filter_buttons'                   => true,

    'show_language_selection'               => false,

    'transliteration'                       => false,

    'convert_spaces'                        => false,

    'replace_with'                          => "_",
    'lower_case'                            => false,
    'add_time_to_img'                       => false,

    'lazy_loading_file_number_threshold'    => 0,
    'image_max_width'                         => 0,
    'image_max_height'                        => 0,
    'image_max_mode'                          => 'auto',

    'image_resizing'                          => false,
    'image_resizing_width'                    => 0,
    'image_resizing_height'                   => 0,
    'image_resizing_mode'                     => 'auto', 
    'image_resizing_override'                 => false,

    'image_watermark'                          => false,

    'image_watermark_position'                 => 'br',

    'image_watermark_padding'                 => 0,

    'default_view'                            => 0,

    'ellipsis_title_after_first_row'          => true,

    'delete_files'                            => true,
    'create_folders'                          => false,
    'delete_folders'                          => false,
    'upload_files'                            => true,
    'rename_files'                            => true,
    'rename_folders'                          => false,
    'duplicate_files'                         => false,
    'copy_cut_files'                          => true, // for copy/cut files
    'copy_cut_dirs'                           => false, // for copy/cut directories
    'chmod_files'                             => false, // change file permissions
    'chmod_dirs'                              => false, // change folder permissions
    'preview_text_files'                      => false, // eg.: txt, log etc.
    'edit_text_files'                         => false, // eg.: txt, log etc.
    'create_text_files'                       => false, // only create files with exts. defined in $editable_text_file_exts

    'previewable_text_file_exts'              => array( "bsh", "c","css", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html", "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh", "xhtml", "xml","xsl" ),
    'previewable_text_file_exts_no_prettify'  => array( 'txt', 'log' ),

    'editable_text_file_exts'                 => array( 'txt', 'log', 'xml', 'html', 'css', 'htm', 'js' ),

    'googledoc_enabled'                       => true,
    'googledoc_file_exts'                     => array( 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx' ),
    'viewerjs_enabled'                        => true,
    'viewerjs_file_exts'                      => array( 'pdf', 'odt', 'odp', 'ods' ),
    'copy_cut_max_size'                       => 100,

    'copy_cut_max_count'                      => 200,

    'ext_img'                                 => array( 'jpg', 'jpeg', 'png', 'gif', 'bmp', 'tiff', 'svg' ), //Images
    'ext_file'                                => array(), //Files
    'ext_video'                               => array(), //Video
    'ext_music'                               => array(), //Audio
    'ext_misc'                                => array(), //Archives

    'aviary_active'                           => false,
    'aviary_apiKey'                           => "2444282ef4344e3dacdedc7a78f8877d",
    'aviary_language'                         => "en",
    'aviary_theme'                            => "light",
    'aviary_tools'                            => "all",
    'aviary_maxSize'                          => "1400",

    'file_number_limit_js'                    => 500,

    'hidden_folders'                          => array(),

    'hidden_files'                            => array( 'config.php' ),
    'url_upload'                             => false,

    'java_upload'                             => false,
    'JAVAMaxSizeUpload'                       => 200, //Gb

    'fixed_image_creation'                    => false, 
    'fixed_path_from_filemanager'             => array( '../images/thumbs2/', '../test1/' ), 
    'fixed_image_creation_name_to_prepend'    => array( 'thumb_', 'test_' ), 
    'fixed_image_creation_to_append'          => array( '', '' ),
    'fixed_image_creation_width'              => array( 300, 400 ), 
    'fixed_image_creation_height'             => array( 200, '' ),

    'fixed_image_creation_option'             => array( 'auto', 'auto' ), 

    'relative_image_creation'                 => true, 
    'relative_path_from_current_pos'          => array( '../hd', '../fullhd','../thumbs' ), 
    'relative_image_creation_name_to_prepend' => array( '', '' , ''), 
    'relative_image_creation_name_to_append'  => array( '', '',''),
    'relative_image_creation_width'           => array( 1280, 1920 , 200),
    'relative_image_creation_height'          => array( 720, 1080, 200 ),

    'relative_image_creation_option'          => array( 'auto', 'auto', 'auto' ),


    'remember_text_filter'                    => false,

);

return array_merge(
    $config,
    array(
        'MaxSizeUpload' => ((int)(ini_get('post_max_size')) < $config['MaxSizeUpload'])
            ? (int)(ini_get('post_max_size')) : $config['MaxSizeUpload'],
        'ext'=> array_merge(
            $config['ext_img'],
            $config['ext_file'],
            $config['ext_misc'],
            $config['ext_video'],
            $config['ext_music']
        ),

        'aviary_defaults_config' => array(
            'apiKey'     => $config['aviary_apiKey'],
            'language'   => $config['aviary_language'],
            'theme'      => $config['aviary_theme'],
            'tools'      => $config['aviary_tools'],
            'maxSize'    => $config['aviary_maxSize']
        ),
    )
);
?>

error screenshot

【问题讨论】:

请提供您的代码,以便我们帮助您解决问题:) @WojtekT 请检查,我已经更新了我的问题 我记得几年前我有一个类似的项目,即使我配置了 php.ini 和像你一样的上传文件,我网站的主机也最多上传 5mb 它仍然不允许我. 我用的是Digital Ocean VPS。 @WojtekT 我以前从未使用过它,但根据我的研究,我认为它最多允许 16MB,您必须与 Digital Ocean 确认 100% 确定 【参考方案1】:

如果您使用 nginx,您应该检查配置的最大帖子实体大小。在我的默认配置中,它小于 PHP 发布文件限制。

【讨论】:

以上是关于响应式文件管理器内存限制错误的主要内容,如果未能解决你的问题,请参考以下文章

响应式文件管理器 laravel dialog.php 错误

响应式文件管理器上传 JPG 错误继续处理 [关闭]

Codeigniter 包括响应式文件管理器

使用响应式文件管理器上传任何文件时出错

如何使用响应式文件管理器 9 阻止其他文件夹访问

响应式文件管理器一直在处理