Coder Social home page Coder Social logo

Comments (5)

idleberg avatar idleberg commented on August 28, 2024

Can you please be more specific about how this happens? I'd like to be able to reproduce this.

from bootstrap-listr.

jpscharf avatar jpscharf commented on August 28, 2024

Setup a site with download links to MS Office and Windows 7 on a DigitalOcean droplet with 512MB RAM:

  • PHP 5.5.16
  • NGINX 1.6.1

Redacted Error

2015/02/23 17:49:23 [error] 4950#0: *11219 FastCGI sent in stderr: "PHP message: PHP Fatal error: Allowed memory size of 209715200 bytes exhausted (tried to allocate 794841088 bytes) in /usr/share/nginx/share/www/dl/index.php on line 76" while reading response header from upstream, client: 0.0.0.0, server: share.example.com, request: "GET /dl/Microsoft/Microsoft%20Office%202013%20SP1%20x32.iso HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "share.example.com"

from bootstrap-listr.

idleberg avatar idleberg commented on August 28, 2024

I can't reproduce this, I could successfully load an Ubuntu image (~1.1GB) on using memory_limit = 100M. The only difference I noticed, is that the file is loaded in the browser rather than being offered as download, even though my MIME settings are alright.

Please do me the favour and replace your index.php with this one. It uses the readfile_chunked function rather than readfile.

from bootstrap-listr.

jpscharf avatar jpscharf commented on August 28, 2024

That worked! Do you think it had something to do with me using nginx? Here is the relevant portion of my nginx config, I have the application running under a subirectory (i.e. https://example.com/dl ):

    location ~(^/dl/)(.*) {

        try_files $uri $uri/ /dl/index.php?path=$2;

        # Forward requests on to PHP-FPM
        location ~ \.php$ {
            include /etc/nginx/fastcgi_params;
            fastcgi_index index.php;
            fastcgi_intercept_errors on;
            fastcgi_split_path_info ^(.+\.php)(/.+)$;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            fastcgi_pass unix:/var/run/php5-fpm.sock;
        }
    }

from bootstrap-listr.

idleberg avatar idleberg commented on August 28, 2024

I'm not familiar with nginx, but I'm thinking about how to best integrate the alternative readfile function. I don't see the harm in doing so, both versions behaved the same for me.

from bootstrap-listr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.