I needed to increase the file upload size for a project, so here’s how I did it for both PHP and NGINX.
PHP Configuration:
- Find your
php.ini
file:“`bashphp --ini
- Edit it using
vim
:“`bashupload_max_filesize = 100M
post_max_size = 100M
“`<div class="flex items-center rounded bg-token-main-surface-secondary px-2 font-sans text-xs text-token-text-secondary"><code></code></div>
</div>
</div>
</div></li>
</ol><h3>NGINX Configuration:</h3>
<ol>
<li>In your <code>nginx.conf</code>, add:
<div class="dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative">
<div class="flex items-center text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9">“`bashclient_max_body_size 100m;
```<div class="overflow-y-auto p-4" dir="ltr"><code></code></div>
</div></li>
<li>Reload services:
<div class="dark bg-gray-950 contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative">
<div class="flex items-center text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9">“`bashsudo service nginx reload
sudo service php-fpm reload“`