We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 34017
    • 898 Posts
    I keep getting the error:
    [05-Sep-2008 16:43:12] PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 16403010 bytes) in /home/website/manager/includes/document.parser.class.inc.php on line 770

    I’ve increased the memory. Everything should be working. It works fine if the download is outside of MODx.

    Any ideas?
      Chuck the Trukk
      ProWebscape.com :: Nashville-WebDesign.com
      - - - - - - - -
      What are TV's? Here's some info below.
      http://modxcms.com/forums/index.php/topic,21081.msg159009.html#msg1590091
      http://modxcms.com/forums/index.php/topic,14957.msg97008.html#msg97008
      • 18641
      • 22 Posts
      Ahoy, I really like this a lot. Good Job, cool snippet!

      Works very well, except I couldn’t get this thing to count, and I was convinced that the internet was broken, and my computer hated me. Turns out I forgot to append the downloads container to the filename in the snippet call. For some reason I missed that little nugget and spent an hour dissecting things looking for a bug, but the bug was me embarrassed
        • 34017
        • 898 Posts
        Quote from: ChuckTrukk at Sep 05, 2008, 09:49 PM

        I keep getting the error:
        [05-Sep-2008 16:43:12] PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 16403010 bytes) in /home/website/manager/includes/document.parser.class.inc.php on line 770

        I’ve increased the memory. Everything should be working. It works fine if the download is outside of MODx.

        Any ideas?

        I’m still getting this error. This is what I’ve got so far:
        - If I create a separate page (outside of MODx), and use the MODx Library API the download works.
        - I’ve tried everything within MODx and the download is always 0 KB.

        Right now I’ve created a seperate file and have created a function to do basic MODx authentication. I really want to get this to work inside modx but i am lost here.

        Any help would be greatly appreciated.

        Chuck
          Chuck the Trukk
          ProWebscape.com :: Nashville-WebDesign.com
          - - - - - - - -
          What are TV's? Here's some info below.
          http://modxcms.com/forums/index.php/topic,21081.msg159009.html#msg1590091
          http://modxcms.com/forums/index.php/topic,14957.msg97008.html#msg97008
        • Have you guys tried this in the latest SVN version for the 0962 release?
            Ryan Thrash, MODX Co-Founder
            Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
            • 34017
            • 898 Posts
            I tried it on a checkout from 06_05. I havent tried it a the newest checkout tho. Is it causing you problems, Ryan?

              Chuck the Trukk
              ProWebscape.com :: Nashville-WebDesign.com
              - - - - - - - -
              What are TV's? Here's some info below.
              http://modxcms.com/forums/index.php/topic,21081.msg159009.html#msg1590091
              http://modxcms.com/forums/index.php/topic,14957.msg97008.html#msg97008
            • Was wondering if it fixed it ... there’s been boatloads of changes since June 5th.
                Ryan Thrash, MODX Co-Founder
                Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                • 34017
                • 898 Posts
                well since there’s been a boatload, ill update and see if there’s any progress for me.
                  Chuck the Trukk
                  ProWebscape.com :: Nashville-WebDesign.com
                  - - - - - - - -
                  What are TV's? Here's some info below.
                  http://modxcms.com/forums/index.php/topic,21081.msg159009.html#msg1590091
                  http://modxcms.com/forums/index.php/topic,14957.msg97008.html#msg97008
                  • 17750
                  • 78 Posts
                  Congratulations!!! Wonderful snippet!!!

                  In the snippet code:

                  // required for IE  
                              if(ini_get('zlib.output_compression')) { ini_set('zlib.output_compression', 'Off'); }
                              header('Pragma: public');
                              header('Expires: 0');
                              header('Cache-Control: must-revalidate, post-check=0, pre-check=0');  
                              header('Cache-Control: private',false);  
                              header('Content-Type: '.$mime); 
                              header('Content-Disposition: attachment; filename="'.basename($path).'"');  
                              header('Content-Transfer-Encoding: binary');  
                              header('Content-Length: '.filesize($path));
                              readfile($path);
                              return;

                  I have to replace return; with exit; , to refer correctly to the file.

                  I think, it would be better if you mention in documentation, that files with size greater than the set one in php.ini (post_max_size) can not be downloaded or it will give you an error.
                  That’s why, if such files are used, its good post_max_size to be increased.


                  Best regards,
                  Lyubomir
                    • 34017
                    • 898 Posts
                    Quote from: ChuckTrukk at Sep 05, 2008, 09:49 PM

                    I keep getting the error:
                    [05-Sep-2008 16:43:12] PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 16403010 bytes) in /home/website/manager/includes/document.parser.class.inc.php on line 770

                    I’ve increased the memory. Everything should be working. It works fine if the download is outside of MODx.

                    Any ideas?

                    The problem ended up being PHx. I added a parameter to disable PHx on certain pages and it’s fixed =)
                      Chuck the Trukk
                      ProWebscape.com :: Nashville-WebDesign.com
                      - - - - - - - -
                      What are TV's? Here's some info below.
                      http://modxcms.com/forums/index.php/topic,21081.msg159009.html#msg1590091
                      http://modxcms.com/forums/index.php/topic,14957.msg97008.html#msg97008
                      • 25687
                      • 6 Posts
                      Hi everyone,

                      don’t know if there is still someone around here? Anyway, I’ve begun using MODx some time ago and have almost finished making my site. Now I’ve come to the point where I’d like to archieve the following:

                      - I have a customers’ area (login and password required) where I want to provide the bill, the project files etc. as downloads.
                      - If the absolute path to a file is known, it could of course be downloaded, no matter if logged in or not. So I’d like to restrict those downloads from users that do not belong to a certain user group ("customers").

                      So if I am not totally wrong here, FileDownloadPE seems to be the solution for what I am trying to do, right?

                      I’ve tried to set everything up in the way described on Scotty’s site (besides: thanks for your efforts!!). The link shown in the browser’s status bar looks like I suppose it to (e.g. the file’s location is obscured).
                      BUT NOW MY PROBLEM(S):

                      1.) When downloading the file (a ZIP file containing two PDFs in this case), its size is just 249 bytes, called "download.zip" (which is the name I want it to have); opening it as ZIP shows an error; opening it with a notepad shows the following error message (including the HTML tags, but without the quotes):

                      "
                      <b>Parse error</b>:  syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ’}’ in <b>/www/htdocs/w00975ed/website/manager/includes/document.parser.class.inc.php(769) : eval()’d code</b> on line <b>45</b>
                      "

                      So not the file gets downloaded, but this error message. Why is this?

                      2.) The MIME type either does not get passed correctly (I’ve set it to "application/ZIP", but Firefox tells me the file-to-be-downloaded is a text file) or -- since in fact it is really only text (e.g. the error message, see above) -- gets overwritten somehow.

                      I’m stuck here. Does anybody have a clue what I might be doing wrong here? (Besides, If I leave the "!" out in my snipped call -- e.g. not [[!FileDownloadPE!]] but [[FileDownloadPE]] -- I get the error message directly in my website rather than in the downloaded file.)

                      Some background info: Windows XP Pro SP3 | MODx 0.9.6.1p2. I’ve also tried not to bind the download to a certain user group -- still no luck. I am using friendly URLs (with empty suffixes). I have a multi-language site, so the structure is with three main folders that get parsed like: mysite.com/de/welcome, mysite.com/en/welcome and mysite.com/pl/welcome.

                      Any help would be greatly appreciated by a MODx newbie trying to learn smiley
                      Thanks in advance, Ruceb

                      --------
                      Edit: I’ve just realized that the above described behavior (downloading the error message as text) only occurs as long as I am logged in at the MODx system as administrator. As soon as I am logged out, clicking on a link simply downloads an empty file (0 bytes).