I get 'The uploaded file exceeds the uploadmaxfilesize directive in php.ini.' error while trying to upload a plugin which is just 5.1MB. I have raised the limits in php.ini file and also thru webmin.

This is my php.ini file

max_input_time = 24000
max_execution_time = 24000
upload_max_filesize = 12000M
post_max_size = 24000M
memory_limit = 12000M

Here is my nginx.conf file. I have also increased clientmaxbody_size under server and http.

user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;

# Load dynamic modules. See /usr/share/nginx/README.dynamic.
include /usr/share/nginx/modules/*.conf;

events {
worker_connections 1024;

http {
client_max_body_size 24000M;
log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                  '$status $body_bytes_sent "$http_referer" '
                  '"$http_user_agent" "$http_x_forwarded_for"';

access_log  /var/log/nginx/access.log  main;
server_names_hash_bucket_size 128;
server {
    client_max_body_size 24000M;
    server_name mydomain.com www.mydomain.com;
  • Those settings look sufficient. Make sure you've actually restarted php-fpm with those settings. – Michael Hampton Mar 13 '18 at 17:20
  • 1
    I restarted both nginx and php-fpm using the commands systemctl restart php-fpm.service sudo systemctl restart nginx But I still get the same error! Any help would be appericiated! Thanks – aka_ab Mar 13 '18 at 17:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.