We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18367
    • 834 Posts
    If I turn on compression for css and js in system settings the Manager goes blank except for the top menu.

    I can get it back by changing the settings back again via the DB admin and deleting the cache thru a control panel.

    However, I'd still like to be able to compress the css and js.

    Does anybody know what's causing this and how to fix it or get around it?

    Thanks

      Content Creator and Copywriter
      • 37946
      • 70 Posts
      Hello,
      While I am hardly a system guy I am going to go out on a limb and take a guess. I (think) it has something to do with your suhosin setting(s). I have seen this error come up before when I have installed MODx on one of our servers:


      Currently, you are using the PHP suhosin extension, and your suhosin.get.max_value_length is set too low for MODX to properly compress JS files in the manager. MODX recommends upping that value to 4096; until then, MODX will automatically set your JS compression (compress_js setting) to 0 to prevent errors.

      That's about all the more help I can be. If you somehow increase that limit I think you will be in good shape.
        • 18367
        • 834 Posts
        Jentree,

        yeh from what I can tell from the php.ini it's already set to 4096, though I could be wrong.

        Not entirely sure how to change it.
          Content Creator and Copywriter
          • 37946
          • 70 Posts
          Yeah... that's where I am literally no help at all. I submitted a ticket to our hosting provider to up the limit and it just "magically happened". smiley
            • 42101
            • 125 Posts
            Hi Mark, had the same exact problem - still having it. Well at the moment I can live with the turned off compression - but I'd like to have it turned on. In the meantime I changed the following values in config.cache.php in core/cache/system_settings:

            I manually changed 1 to 0
             'compress_css' => '0',
              'compress_js' => '0',


            than in the manager I went to the settings panel and turned js and css compression off again - so it won't change back - even when the cache is deleted and reloaded.
            It's not a fix for the problem, but than you don't have to do it through db all the time.

            If you find a real solution for it, I am very interested. smiley

            I found this in the modx rftm about the prob with suhosin:
            http://rtfm.modx.com/display/revolution20/MODX+and+Suhosin

            greetings,

            ad

              • 42046
              • 436 Posts
              I've found it much more reliable to enable compression via htaccess, plus you get the added benefit of static file compression in the front-end.

              # compress text, html, php, javascript, css, xml:
              AddOutputFilterByType DEFLATE text/javascript
              AddOutputFilterByType DEFLATE text/plain
              AddOutputFilterByType DEFLATE text/html
              AddOutputFilterByType DEFLATE text/xml
              AddOutputFilterByType DEFLATE text/css
              AddOutputFilterByType DEFLATE application/xml
              AddOutputFilterByType DEFLATE application/xhtml+xml
              AddOutputFilterByType DEFLATE application/rss+xml
              AddOutputFilterByType DEFLATE application/javascript
              AddOutputFilterByType DEFLATE application/x-javascript
              AddOutputFilterByType DEFLATE application/x-httpd-php
              AddOutputFilterByType DEFLATE application/x-httpd-fastphp
              AddOutputFilterByType DEFLATE image/svg+xml
              
              # Drop problematic browsers
              BrowserMatch ^Mozilla/4 gzip-only-text/html
              BrowserMatch ^Mozilla/4\.0[678] no-gzip
              BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
              
              # Make sure proxies don't deliver the wrong content
              Header append Vary User-Agent env=!dont-vary
                • 42101
                • 125 Posts
                Hi Dan!
                Thanks, I put your code in my htaccess - but how can I check, if it's working?

                Another question to markG - when you turn off all the compression, is a richText editor like TinyMCE still workgin? Because on my setup I don't get it to work...

                thanks,
                ad
                  • 42046
                  • 436 Posts
                    • 18367
                    • 834 Posts
                    @ad2003,

                    Re:
                    1
                    'compress_css' => '0',
                    'compress_js' => '0',

                    that's pretty much what I've already done. The issue is not turning it off, but turning it on in a way that the Manager still works.

                    Re:
                    Another question to markG - when you turn off all the compression, is a richText editor like TinyMCE still workgin? Because on my setup I don't get it to work...

                    Yes it still works.

                    @Dan, will give your suggestion a go.

                      Content Creator and Copywriter
                      • 42101
                      • 125 Posts
                      Quote from: markg at Apr 06, 2013, 11:38 PM
                      @ad2003,

                      Re:
                      1
                      'compress_css' => '0',
                      'compress_js' => '0',

                      that's pretty much what I've already done. The issue is not turning it off, but turning it on in a way that the Manager still works.

                      Re:
                      Another question to markG - when you turn off all the compression, is a richText editor like TinyMCE still workgin? Because on my setup I don't get it to work...

                      Yes it still works.

                      @Dan, will give your suggestion a go.


                      thanks for the reply. I think it's my hoster then...