We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 42758
    • 3 Posts
    chriscross2504 Reply #1, 12 years ago
    Hello all,

    I'm facing the following problems in my new ModX Revo (2.3.1) installation:

    I installed Gallery as an AddOn and tried to upload images into a gallery.
    Everytime I try to upload a sample Image (app. 1MB) into the gallery I get the following error:

    [2014-09-26 23:52:07] (ERROR @ /var/www/clients/client11/web10/web/core/components/gallery/model/gallery/galalbum.class.php : 270) PHP warning: opendir(/var/www/clients/client11/web10/web/assets/components/gallery/cache/): failed to open dir: No such file or directory
    [2014-09-26 23:52:07] (ERROR @ /var/www/clients/client11/web10/web/core/components/gallery/model/gallery/galalbum.class.php : 271) PHP warning: readdir() expects parameter 1 to be resource, boolean given
    


    When I try a very small Image (12k) everything is working fine.

    If I tried to Upload images into an other folder via Media Browser I face an Error:

    Internal Server Error
    [2014-09-27 00:22:27] (WARN @ /var/www/clients/client11/web10/web/core/model/modx/sources/modfilemediasource.class.php : 944) PHP notice: Undefined variable: size
    [2014-09-27 00:22:27] (WARN @ /var/www/clients/client11/web10/web/core/model/modx/sources/modfilemediasource.class.php : 945) PHP notice: Undefined variable: size
    


    System:
    System Linux 2.6.32-042stab093.5 #1 SMP Wed Sep 10 17:39:49 MSK 2014 i686
    Build Date Jun 30 2014 18:50:37
    Server API CGI/FastCGI
    output_buffering 4096 4096
    output_handler no value no value
    post_max_size 18M
    upload_max_filesize 20M 20M
    upload_tmp_dir /var/www/clients/client11/web10/tmp


    Could anyone out there help me solving this problem.
    If you need more information please let me know.

    Thanks in advance

    Christian Schulte

    This question has been answered by chriscross2504. See the first response.

      • 3749
      • 24,544 Posts
      Check the upload_maxsize System Setting in the Manager and delete all files in the core/cache directory before testing.

      If that doesn't work, your host may have set a limit and have things set up to ignore the php.ini values.

        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 42758
        • 3 Posts
        chriscross2504 Reply #3, 12 years ago
        Quote from: BobRay at Sep 26, 2014, 09:52 PM
        Check the upload_maxsize System Setting in the Manager and delete all files in the core/cache directory before testing.

        If that doesn't work, your host may have set a limit and have things set up to ignore the php.ini values.


        Unfortunately the upload_maxsize is big enough and I raised without any effect.

        I just found out, that an other modx Page (Version 1.0.14) on the (virtual) Server also has problem to upload bigger files.

        Which php settings should i check?

          • 3749
          • 24,544 Posts
          These are the only two I know of:

          post_max_size
          upload_max_filesize
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting
          • discuss.answer
            • 42758
            • 3 Posts
            chriscross2504 Reply #5, 12 years ago
            I just found the Solution!!

            I run my Sites under Fast-CGI.
            For this there are (at least on my debian) additional settings under:
            /etc/apache2/mods-available/fcgid.conf

            Here the following line lacked
            MaxRequestLen 15728640

            after restarting apache everything worked fine!!!

              • 3749
              • 24,544 Posts
              I'm glad you got it sorted. I wasn't aware of that setting.
                Did I help you? Buy me a beer
                Get my Book: MODX:The Official Guide
                MODX info for everyone: http://bobsguides.com/modx.html
                My MODX Extras
                Bob's Guides is now hosted at A2 MODX Hosting
                • 28042 ☆ A M B ☆
                • 24,524 Posts
                Yeah, that one has gotten me a few times. It's usually not a problem, but the web server itself can be configured to limit file upload size. Which does make sense, as HTTP file upload is a feature of the web server.

                LimitRequestBody for Apache, client_max_body_size and client_body_timeout for nginx. Don't forget to restart your web servers if you change their configuration settings!

                Security applications like suhosin also has settings for this, suhosin.post.max_value_length.
                  Studying MODX in the desert - http://sottwell.com
                  Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                  Join the Slack Community - http://modx.org