Raj Shekhar Dev

Back

Change maximum upload size in PHP

If you get an error 413 Request Entity Too Large do the following:

  1. Edit php.ini file found in /etc/php/8.1/fpm
    • Change: upload_max_filesize = 50M
    • Chage: post_max_size = 50M
  2. Edit default.conf file or site-specific config file present in sites-available directory
    • Add: client_max_body_size 120M; in the server block.
  3. Restart fpm and nginx
    sudo service php8.1-fpm restart
    sudo service nginx