<p>After doing some digging, this article helped solve my issue: <a href="https://stackoverflow.com/questions/36582004/increase-upload-max-filesize-via-forge">https://stackoverflow.com/questions/36582004/increase-upload-max-filesize-via-forge</a>.</p>

<p>By increasing the <code>post_max_size</code> in the PHP FPM Configuration and the PHP CLI Configuration I was able to resolve the issue and increase my upload limit to <code>256M</code>.</p>

CC BY-SA 4.0
2019-11-14T15:47:48.270Z
Just a comment on this - using both this answer and Andrew's answer below it worked for me, but not until I restarted both PHP and nginx.
CreateSean
CC BY-SA 4.0
2019-08-16T18:11:43.973Z
2019-08-16T18:11:43.973Z
Jonathan Simcoe
<p>Check out <a href="https://github.com/nystudio107/nginx-craft" rel="nofollow noreferrer">nginx-craft</a> specifically:</p>

<p><a href="https://github.com/nystudio107/nginx-craft/blob/master/forge-example/NginxConfiguration.conf#L25" rel="nofollow noreferrer">https://github.com/nystudio107/nginx-craft/blob/master/forge-example/NginxConfiguration.conf#L25</a></p>

<pre><code>    # Disable limits on the maximum allowed size of the client request body
    client_max_body_size 0;
</code></pre>

<p>Setting <code>client_max_body_size</code> to <code>0</code> will set it to "no limit" so you can control any limit you like in one place, the Craft CMS <code>general.php</code> config file.</p>

CC BY-SA 4.0
2019-08-17T05:50:08.660Z
2019-08-17T05:50:08.660Z
andrew.welch
<p>I have a Craft 3 site deployed to a Digital Ocean droplet via Laravel Forge. I have the <code>maxUploadFileSize</code> set to 256B (<code>268435456</code> in bytes) in my <code>config/general.php</code> like so:</p>

<pre><code>&lt;?php

return [
  // Global settings
  '*' =&gt; [
    'omitScriptNameInUrls' =&gt; true,
    'securityKey' =&gt; getenv('SECURITY_KEY'),
    'maxUploadFileSize'=&gt; 268435456,
    'useProjectConfigFile' =&gt; true,
    'defaultSearchTermOptions' =&gt; array(
      'subLeft' =&gt; true,
      'subRight' =&gt; true,
    ),
  ],
  'dev' =&gt; [
    'devMode' =&gt; true,
    'rememberedUserSessionDuration' =&gt; 'P1Y',
    'userSessionDuration' =&gt; 'P1Y',
  ],
  'production' =&gt; [
    'allowAdminChanges' =&gt; false,
  ],
];

</code></pre>

<p>When I go to upload a file larger than 8mb I get this error:</p>

<blockquote>
  <p>The file “.mp3” could not be uploaded, because it exceeds the maximum upload size of 8.0 MB.</p>
</blockquote>

<p>My <code>php.ini</code> has <code>upload_max_filesize</code> set to <code>256M</code>. I can't figure out what exactly is blocking uploads. Nothing in my <code>.env</code> file or my <code>nginx.conf</code> appears to be hindering the upload size.</p>

<p>Any help you can provide would be greatly appreciated!</p>

CC BY-SA 4.0
2019-08-16T18:06:02.530Z
I did confirm that my `client_max_body_size` is set to `256M` in my `nginx.conf` file in Laravel Forge.
Jonathan Simcoe
<craft3><config><php><upload><digitalocean>
Laravel Forge not honoring Craft 3 maxUploadFileSize config setting
# Laravel Forge not honoring Craft 3 maxUploadFileSize config setting

(Asked by: username_0 on 2019-08-16)

I have a Craft 3 site deployed to a Digital Ocean droplet via Laravel Forge. I have the maxUploadFileSize set to 256B (268435456 in bytes) in my config/general.php like so:
 [
    'omitScriptNameInUrls' => true,
    'securityKey' => getenv('SECURITY_KEY'),
    'maxUploadFileSize'=> 268435456,
    'useProjectConfigFile' => true,
    'defaultSearchTermOptions' => array(
      'subLeft' => true,
      'subRight' => true,
    ),
  ],
  'dev' => [
    'devMode' => true,
    'rememberedUserSessionDuration' => 'P1Y',
    'userSessionDuration' => 'P1Y',
  ],
  'production' => [
    'allowAdminChanges' => false,
  ],
];


When I go to upload a file larger than 8mb I get this error:

The file “.mp3” could not be uploaded, because it exceeds the maximum upload size of 8.0 MB.

My php.ini has upload_max_filesize set to 256M. I can't figure out what exactly is blocking uploads. Nothing in my .env file or my nginx.conf appears to be hindering the upload size.
Any help you can provide would be greatly appreciated!

**Tags:** craft3, config, php, upload, digitalocean
> **Comments:**
> **username_0**: I did confirm that my `client_max_body_size` is set to `256M` in my `nginx.conf` file in Laravel Forge.  

---

## 2 answers

### Answer by username_0 on 2019-08-16. Score: 3

After doing some digging, this article helped solve my issue: <https://stackoverflow.com/questions/36582004/increase-upload-max-filesize-via-forge>.

By increasing the `post_max_size` in the PHP FPM Configuration and the PHP CLI Configuration I was able to resolve the issue and increase my upload limit to `256M`.

> **Comments:**
> **username_1**: Just a comment on this - using both this answer and Andrew's answer below it worked for me, but not until I restarted both PHP and nginx.  

---

### Answer by username_2 on 2019-08-17. Score: 3

Check out nginx-craft specifically:
https://github.com/nystudio107/nginx-craft/blob/master/forge-example/NginxConfiguration.conf#L25
    # Disable limits on the maximum allowed size of the client request body
    client_max_body_size 0;

Setting client_max_body_size to 0 will set it to "no limit" so you can control any limit you like in one place, the Craft CMS general.php config file.


---

