We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7751
    • 7 Posts
    I have set the server to 64M through the ’PHP Configuration Editor’ in the WHM for my server.
    I have rebooted Apache by both ’HTTP Server (Apache)’ and ’Graceful Server Reboot’ in my WHM interface.
    I can also verify the PHP Configuration through the site cpanel.

    There is no doubt that the memory_limit is set to 64M.

    php info:
    http://www.earthdancetehachapi.org/phpinfo.php

    The php.ini for the site (/usr/local/Zend/etc/php.ini) is attached as a text file.


    Now what? All other checks were succesful.
    This looks like such a cool thing...I can’t wait to get a chance to try it!

    Can anybody help?
      • 3749
      • 24,544 Posts
      It’s odd that there’s no memory_limit reported in your phpinfo.

      I suspect that it’s not there because it’s not really set for some reason (maybe the php.ini file isn’t being read).

      That’s what MODx tests.

      If you’re sure the memory limit is ok, you could try changing the code in
      setup/includes/modinstalltest.php around line 68 to bypass the memory check. Just set $success = true and comment out the actual tests.

      It would probably be a lot better, though, to find out why ini_get(’memory_limit’) is returning less than 32M. You might check with your host or the host’s support forum.
        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
        • 7751
        • 7 Posts
        I really need more specific instructions.

        Setting succes to true is simple enough, but I have tried every combination I can think of can not comment anything out that will do anything other than return a blank page. Every line or combination of lines gives the same results or the same memeory error.

        Could you please explain how to "comment out the actual tests"?

        As for the initial error, it is all over the web...the function does not always work and there other suggestions such as making the script use get_cfg_var().

        "Many ini memory size values, such as upload_max_filesize, are stored in the php.ini file in shorthand notation. ini_get() will return the exact string stored in the php.ini file and NOT its integer equivalent. Attempting normal arithmetic functions on these values will not have otherwise expected results. The example above shows one way to convert shorthand notation into bytes, much like how the PHP source does it. "

        Just search "ini_get(’memory_limit’)".
          • 3749
          • 24,544 Posts
          You’re right about the problems with ini_get().

          Try just changing this:

          $ml = ini_get('memory_limit');

          To this:

          $ml = get_cvg_var('memory_limit');


          BTW, can you check to see if your host is using either suPHP or suExec?
            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
            • 22303 MODX Staff
            • 10,725 Posts
            get_cfg_var will only return the php.ini value and will not return the actual value being used at runtime, unless it just happens to match the ini value. These values can also be set in Apache configuration, .htaccess, etc., so it would not be useful to use get_cfg_var() in this case.

            As for your statement:
            Quote from: Dogpaw at Aug 24, 2009, 01:30 PM

            As for the initial error, it is all over the web...the function does not always work and there other suggestions such as making the script use get_cfg_var().

            "Many ini memory size values, such as upload_max_filesize, are stored in the php.ini file in shorthand notation. ini_get() will return the exact string stored in the php.ini file and NOT its integer equivalent. Attempting normal arithmetic functions on these values will not have otherwise expected results. The example above shows one way to convert shorthand notation into bytes, much like how the PHP source does it. "
            The tests convert the values to bytes already, so I’m not sure what you mean. This works accurately in every configuration I have tested with.
              • 3749
              • 24,544 Posts
              I think the problem is that ini_get(’memory_limit’) is purported to return an empty string under some circumstances. If and when that happens, MODx won’t install.

              I’m still wondering, though, why the OPs phpinfo() shows no memory_limit.
                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
                • 7751
                • 7 Posts
                $ml = get_cvg_var(’memory_limit’); causes a blank page, so no luck.

                suexec Status is enabled.

                There is also an option to install ’EasyApache 3’.

                Any other ideas as to what I can do?

                This is just a normal dedicated apache server from hostforweb.com. It certainly should be a quite normal setup and I have full root access.

                Can I just "Just set $success = true and comment out the actual tests"?

                Can you detail that or is it not going to work?

                  • 22303 MODX Staff
                  • 10,725 Posts
                  If using suexec, you will need to put a php.ini file in every folder from which PHP scripts are accessed in order to increase the memory_limit. In this case, it would have to be in setup/.
                    • 3749
                    • 24,544 Posts
                    You may need to specify where the php.ini file is by putting this in your .htaccess file:

                    SetEnv PHPRC /path/to/php.ini/dir

                    I’m not sure if that eliminates the need to put a php.ini in every dir.
                      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
                      • 3749
                      • 24,544 Posts
                      If your memory limit really is high enough, adding the line shown below should get you past the test:

                      <?php
                      function checkMemoryLimit() {
                              $success = false;
                              $ml = ini_get('memory_limit');
                              $bytes = $this->return_bytes($ml);
                      
                              if ($bytes < 67108864) { /* 32M = 33554432, 64M = 67108864 */
                                  $success = @ini_set('memory_limit','128M');
                                  $success = $success !== false ? true : false;
                              } else {
                                  $success = true;
                              }
                      $success=true;   // ADD THIS LINE
                      
                              $this->results['memory_limit']['msg'] = '<p>'.$this->install->lexicon['test_memory_limit'].' ';
                              if ($success) {
                                  $this->results['memory_limit']['msg'] .= '<span class="ok">'.$this->install->lexicon['ok'].'</span></p>';
                                  $this->results['memory_limit']['class'] = 'testPassed';
                              } else {
                                  $s = '<span class="notok">'.$this->install->lexicon['failed'].'</span>';
                                  $s .= '<div class="notes"><p>'.sprintf($this->install->lexicon['test_memory_limit_fail'],$ml).'</p></div>';
                                  $s .= '</p>';
                                  $this->results['memory_limit']['msg'] .= $s;
                                  $this->results['memory_limit']['class'] = 'testFailed';
                              }
                          }
                        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