Skip to content

Instantly share code, notes, and snippets.

@derozic
Created August 14, 2018 14:35
Show Gist options
  • Save derozic/d636dd8f18ad675b6433d7193fb2b704 to your computer and use it in GitHub Desktop.
Save derozic/d636dd8f18ad675b6433d7193fb2b704 to your computer and use it in GitHub Desktop.
Increase file upload size PHP/nginx
e.g. To change max file upload size to 100MB
Edit…
`sudo vi /etc/php5/fpm/php.ini`
Set…
`upload_max_filesize = 100M
post_max_size = 100M`
Also add following line to http{..} block in nginx config:
`http {
#...
client_max_body_size 100m;
#...
}`
Make sure you didn't break nginx config:
`sudo nginx -t`
Restart system services:
`sudo service php7.2-fpm restart`
`sudo systemctl restart nginx`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment