We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3688
    • 43 Posts
    Hi,

    I made a local install of 2.4.0pl and it worked. Uploaded to the server, I get

    Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 130968 bytes) in …/core/model/modx/modx.class.php on line 1996

    and for the manager:
    PHP Fatal error: Allowed memory size of 2147483648 bytes exhausted (tried to allocate 130968 bytes) in …/core/xpdo/xpdo.class.php on line 2529

    Also (without changing anything??!) locally.

    The guy who manages my server tried a php-memory-limit of 2GB (!) per php-process, but he still gets the error. Same here locally. He assumes that it's a bug or some setting which is not correct.

    If anyone would have a hint for me I would appreciate this very much - thanks in advance!

    (ps: sure I cecked the other threads where people have similar problems, but for me there was no solution …)

    ADDENDUM:
    If I go to the core/config/config.inc.php and change the name of the database ($dbase, around line 10) to a non existing name, the error persists. Just found this, perhaps it could be useful … thanks!

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

    [ed. note: bnetz last edited this post 8 years, 7 months ago.]
      • 47401
      • 295 Posts
      check the php environment. the memory size needs to be 8Mb for php caching.
        • 3749
        • 24,544 Posts
        Out of memory errors are usually caused by an infinite loop in page processing. One typical example is a getResources call that shows the page with the getResources tag.
          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
          • 47401
          • 295 Posts
          Bnetz, your comment re memory sounds like your referring to the Memory of the VPS server/environment, not the achual php cashing setting in php.ini.
            • 3688
            • 43 Posts
            @comp_nerd26
            I asked the boss of the hosting-company about it, he told me, that the configuration is 128MB PHP Memory Limit and 2GB APC Cache, RAM is 16GB, so this should not be the problem. He also is assuming a loop or something.

            @BobRay
            This is mentioned in another thread and some guy put up a script to search for such problems. I tried this script but there was nothing found.

            The real weird about this is that the error persists when I set the config-files to a database that does not exist! Locally I tried to delete most files of my modx-installation, and it turned out that I can delete _every_ file where I have changed something and the error still persists. But when I install new the error is coming up.

            Also weird: My local install actually worked. I transfered it to the server and there I got the error mentioned above. On the next day I got the same error locally, probably caused by restarting the server. I assume it could have to do something with the cache (but for sure I emptied the cache-folders in core and xpdo).

            So I am completely helpless and would appreciate any idea very much!
              • 3749
              • 24,544 Posts
              That's a tough one. Sometimes, the only way to find something like that is to set up remote debugging and step through the root index.php file one line at a time, stepping into all the methods as you go.

              Since it's happening with no DB, you might get away with just loading index.php in your editor and debugging it there (if your editor supports this).

                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
                • 3688
                • 43 Posts
                Thanks for your help, BobRay. But I am not so deep into it I could do professional debugging. I certainly tried manually, but there are a lot of classes involved (esp. modx and xpdo) ...

                So as the thing actually DID run and after the server restart (locally) or the move to the webserver there was this error, I naively feel that it has the potential to run. Isn't there perhaps any possibilty to delete, replace ... some files?
                  • 3749
                  • 24,544 Posts
                  The problem is that without debugging, you'd have a very hard time knowing which files to mess with (and changing or deleting MODX core files is a recipe for disaster).

                  If you modified the MODX .htaccess file in the root, restoring the original file is something to try.

                  If you have friendly URLs turned on, one thing to try is renaming .htaccess and changing the value of the friendly_urls System setting from 1 to 0 in the modx_system_settings table, then deleting all files in the core/cache directory before trying the site.


                  You could try running the site in Chrome with dev. tools turned on (Ctrl-shift-i). Turn it on, switch to the Network tab, and go to yoursite.com in the browser. If you want to give the URL of the remote site, I could take a look for you. It doesn't always help.

                  It's possible that you have a missing or corrupted file in your MODX install and if you moved the localhost files to the remote, you'd have duplicated that.

                  Re-downloading and reinstalling MODX in upgrade mode might solve the problem.

                  If the local site worked when you first installed it, though, the odds are good that it's something you did.

                    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
                    • 3688
                    • 43 Posts
                    BobRay, thank you very much for your help.
                    I had the luck that a PHP-pro came by and helped me to solve it. Obviously there has happened something really strange, probably just an empty line at the end of a file or something like this.

                    So probably a solution for me could have been to make a new install and copy over all the core-files. What is sure: It had to do nothing with the database.

                    Again: Thanks for your efforts to help me!

                    (closed)