R
R
radiolip2014-12-05 23:15:18
PHP
radiolip, 2014-12-05 23:15:18

Why are files not uploaded to the site larger than 1Mb?

Everything is set up in php.ini, there are no limits on uploading large files anywhere.
When uploading, let's say pictures are larger than 1mb, firebug writes the following: as in the screenshot. The error occurs only when using the phpfcgid template for Apache, in the VestaCP panel.
ebcd88ddbb3144d4bc9073dc77ce995f.PNG
I tried to change the settings in nginx client_max_body_size 100m; but that doesn't solve it. Server, php 5.5, nginx + apache2, Debian 7 x64.
/etc/nginx/nginx.conf

# Server globals
user                    www-data;
worker_processes        4;
error_log               /var/log/nginx/error.log;
pid                     /var/run/nginx.pid;


# Worker config
events {
        worker_connections  1024;
        use                 epoll;
}


http {
    # Main settings
    sendfile                        on;
    tcp_nopush                      on;
    tcp_nodelay                     on;
    client_header_timeout           1m;
    client_body_timeout             1m;
    client_header_buffer_size       2k;
    client_body_buffer_size         256k;
    client_max_body_size            100m;
    large_client_header_buffers     4   8k;
    send_timeout                    30;
    keepalive_timeout               60 60;
    reset_timedout_connection       on;
    server_tokens                   off;
    server_name_in_redirect         off;
    server_names_hash_max_size      512;
    server_names_hash_bucket_size   512;
    limit_req_zone $binary_remote_addr zone=dyn:10m rate=10r/s;

    # Log format
    log_format  main    '$remote_addr - $remote_user [$time_local] $request '
                        '"$status" $body_bytes_sent "$http_referer" '
                        '"$http_user_agent" "$http_x_forwarded_for"';
    log_format  bytes   '$body_bytes_sent';
    #access_log          /var/log/nginx/access.log  main;
    access_log off;


    # Mime settings
    include             /etc/nginx/mime.types;
    default_type        application/octet-stream;


    # Compression
    gzip                on;
    gzip_comp_level     5;
    gzip_min_length     512;
    gzip_buffers        8 64k;
    gzip_types          text/plain text/css text/javascript
                        application/x-javascript text/html application/json application/javascript text/xml application/xml application/rss+xml application/atom+xml application/rdf+xml;
    gzip_vary           on;
  gzip_proxied        any;


    # Proxy settings
    proxy_redirect      off;
    proxy_set_header    Host            $host;
    proxy_set_header    X-Real-IP       $remote_addr;
    proxy_set_header    X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_pass_header   Set-Cookie;
    proxy_connect_timeout   90;
    proxy_send_timeout  90;
    proxy_read_timeout  90;
    proxy_buffers       32 4k;


    # SSL PCI Compliance
    ssl_ciphers                 RC4:HIGH:!aNULL:!MD5:!kEDH;
    ssl_session_cache           shared:SSL:10m;
    ssl_prefer_server_ciphers   on;


    # Error pages
    error_page          403          /error/403.html;
    error_page          404          /error/404.html;
    error_page          502 503 504  /error/50x.html;


    # Cache
    proxy_cache_path /var/cache/nginx levels=2 keys_zone=cache:10m inactive=60m max_size=512m;
    proxy_cache_key "$host$request_uri $cookie_user";
    proxy_temp_path  /var/cache/nginx/temp;
    proxy_ignore_headers Expires Cache-Control;
    proxy_cache_use_stale error timeout invalid_header http_502;
    proxy_cache_valid any 3d;

    map $http_cookie $no_cache {
        default 0;
        ~SESS 1;
        ~wordpress_logged_in 1;
    }


    # Wildcard include
    include             /etc/nginx/conf.d/*.conf;
}

Answer the question

In order to leave comments, you need to log in

5 answer(s)
A
Alexander Aksentiev, 2014-12-05
@Sanasol

Could it be a speed/load time issue?
In the screenshot, 20 seconds, the PHP script could well have completed its work on a timeout or nginx reset it

_
_ _, 2014-12-05
@AMar4enko

Maybe there's a bug in the Apache setup? Bang is clearly from Apache

R
radiolip, 2014-12-06
@radiolip

FcgidMaxRequestLen, Default value 131072
httpd.apache.org/mod_fcgid/mod/mod_fcgid.html#fcgi...
Cenos /etc/httpd/conf.d/fcgid.conf or Deb/untu /etc/apache2/mods-available/fcgid .conf you can specify FcgidMaxRequestLen 1073741824 - this is 1 GB.
Options example
FcgidIdleScanInterval 30
FcgidIdleTimeout 60
FcgidIOTimeout 300
FcgidProcessLifeTime 600
FcgidMinProcessesPerClass 0
FcgidMaxProcessesPerClass 16
FcgidMaxProcesses 256
FcgidMaxRequestLen 536870912
Solved.
AddHandler fcgid-script .fcgi
FcgidConnectTimeout 60
FcgidMaxRequestLen 1073741824

A
Alexander Zelenin, 2014-12-06
@zelenin

why are you asking a question on different resources, although it is enough to look at the php logs?

M
mstfa, 2014-12-06
@mstfa

In general, why is it considered that the matter is in the file size? the screenshot shows a general error, and what exactly happens should be looked at in the web server logs.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question