We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3153
    • 12 Posts
    OK, maybe this is widely known, but it took me some time to find this out... (I’m new to MODx and relatively unexperienced with all things pertaining to UNIX administration.)

    I was trying to enable Friendly URL’s. I followed all the instructions that were given in the docs and on the forums — making sure that the subdirectory was specified in the path, activating both .htaccess files (in the root and in "manager") and renaming the files, of course. I always got the dreaded 500 Internal Server Error.

    After much fooling around (and flirting with insanity), I finally found the culprit. It was those 2 lines:

    php_flag zlib.output_compression On
    php_value zlib.output_compression_level 5

    By commenting them out (preceding them with a "#"), the error went away and all was good again in MODx land.

    I don’t know why this causes the problem... but hey, this would extend beyond my proficiencies...

    (It seems that PHP optimizations — the Zend optimizer? — is already enabled by default for my host [PowWeb]. Is that [the already-enabled-ess] a cause of problems? I have no clue.)

    Hope this can help some people...
      • 15914
      • 145 Posts
      There are other hosts which alse have the same problem. You cannot define your PHP settings and change them on the fly using your .htaccess file. Instead, these hosts usually allow you to put a custom [tt]php.ini[/tt] file in the root directory of your webspace and allows you to just define the values your want to change from the default. (That’s my experience with some webhosts.)
        Kunal Kapoor
        Technical Director
        Limesharp Internet Limited - Effective, Functional, Standards Compliant

        IRC Nick: KingKoopa
        Skype ID: KingKoopa16
        • 6841
        • 61 Posts
        FYI... The issue has to do with the host using "phpsuexec" which is used to improve security for php in a shared hosting environment. If you google "what is phpsuexec" you’ll find all kinds of info on it.
          Dave
          • 32241
          • 1,495 Posts
          Thanks for the info ddecjc.
            Wendy Novianto
            [font=Verdana]PT DJAMOER Technology Media
            [font=Verdana]Xituz Media
            • 696
            • 46 Posts
            http://modxcms.com/forums/index.php/topic,2343.msg22205.html#msg22205

            Possible suggestion that Modx move thiere php_flags into the core code as ini_set directives instead of the .htaccess file with a config option due to phpsexec...
              • 25663 MODX Staff
              • 12,272 Posts
              Aikdo, can you give us a code example for that?
                Ryan Thrash, MODX Co-Founder
                Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                • 696
                • 46 Posts
                The Best option would be to use ini_set in the top of index.php BEFORE any output is created...
                ini_set('zlib.output_compression', 'On')
                ini_set('zlib.output_compression_level', '5')


                Other Option is to use ob_start("ob_gzhandler"); instead though i much prefure the ini_set option as im sure Modx already takes some play of ini_set values as it can be used to alter any weird Apache Configurations to work with modx and will only affect the config in the files it is called from...

                <?php
                error_reporting(E_ALL ^ E_NOTICE);
                @ini_set("display_errors", "0");
                @ini_set("arg_separator.output","&");
                @ini_set('zlib.output_compression', 'On');
                @ini_set('zlib.output_compression_level', '5');
                ?>


                Is my recomended Setup of a new file called ini.inc.php or simular which can then be included at the top of index.php?
                  • 6722
                  • 18 Posts
                  DavidHopkins Reply #8, 17 years ago
                  Is there any way I can easily find out if my host has changed their settings? I have been setting the MODX website up and am nearly finished (grrr) when all of a sudden I get a 500 Internet Server Error. I’ve checked the htaccess and the offending two lines are commented out already.

                  Any suggestions please?
                    • 3749
                    • 24,544 Posts
                    Quote from: DavidHopkins at Sep 07, 2009, 01:53 PM

                    Is there any way I can easily find out if my host has changed their settings? I have been setting the MODX website up and am nearly finished (grrr) when all of a sudden I get a 500 Internet Server Error. I’ve checked the htaccess and the offending two lines are commented out already.

                    Any suggestions please?
                    There are some suggestions here:

                    http://bobsguides.com/modx-installation-faq.html
                      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
                      • 6722
                      • 18 Posts
                      BobRay - thanks for this. It happened a few weeks ago but by the time I found the Forum it had sorted itself out and I could carry on (??) but this time it’s been a couple of hours with no joy.

                      I think it’s down to the rewrite and friendly URLs, but I can’t access the /manager/ panel to turn it off ... any ideas please?

                      David.