di bagian:
Maximum uploaded file size paling banyak 2 MB saja
 
keterangannya: This specifies a maximum size for files uploaded to the site. This 
setting is limited by the PHP settings post_max_size and 
upload_max_filesize, as well as the Apache setting LimitRequestBody. In 
turn, maxbytes limits the range of sizes that can be chosen at course or
 activity level. If 'Site upload limit' is chosen, the maximum size 
allowed by the server will be used.
 
di 
 
 Sets max size of post data allowed. This setting also affects
        file upload. To upload large files, this value must be larger
        than upload_max_filesize.
       
       
        Generally speaking,
        memory_limit should be
        larger than post_max_size.
       
       
       When an int is used, the
value is measured in bytes. Shorthand notation, as described
in this FAQ, may also be used.
       
       
        If the size of post data is greater than post_max_size, the
        $_POST and $_FILES
        superglobals
        are empty. This can be tracked in various ways, e.g. by passing the
        $_GET variable to the script processing the data,
        i.e. <form action="edit.php?processed=1">,
        and then checking if $_GET['processed'] is set.
       
       
        
Note: 
         
          PHP allows shortcuts for byte values, including K (kilo), M (mega) 
          and G (giga). PHP will do the conversions automatically if you 
          use any of these. Be careful not to exceed the 32 bit signed integer 
          limit (if you're using 32bit versions) as it will cause your script 
          to fail.
         
        
       
       
        
         Changelog for post_max_size
         
          
           
            | Version | 
            Description | 
           
          
          
           
            | 5.3.4 | 
            
             post_max_size = 0 will not disable the limit when the content
             type is application/x-www-form-urlencoded or is not registered with PHP.
             | 
           
           
            | 5.3.2 , 5.2.12 | 
            
             Allow unlimited post size by setting post_max_size to 0.
             | 
  di https://www.php.net/manual/en/ini.core.php#ini.upload-max-filesize
- 
       
upload_max_filesize
       int
       - 
       
        The maximum size of an uploaded file.
       
       
        post_max_size must be larger than this value. 
 
=======================================
 
caranya akses root
nano /etc/nginx/nginx.conf
 Look for the http section and add the following line (Figure A): 
client_max_body_size 100M;
Save and close the file. 
Next, open the config file for your website. If you’re using the default, you would open that file with the command:  
nano /etc/nginx/sites-enabled/moodle
 
 In that file, look for the server section and add the same line as you did in the nginx.conf file (Figure B). 
 
Save and close the file. 
Run the NGINX configuration test with the command: 
sudo nginx -t
You shouldn’t see any errors. Restart NGINX with the command: 
sudo systemctl restart nginx
 
 open the config file php.ini
nano /etc/php/7.4/fpm/php.ini
 memory_limit = 128M
upload_max_filesize = 10M
max_execution_time = 60
post_max_size = 16M
 
Post harus lebih besar daripada upload 
terakhir reboot server
 
 
 
 
 
 
 
0 comments:
Post a Comment