1

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:

<?php

return [
  // Global settings
  '*' => [
    '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!

  • I did confirm that my client_max_body_size is set to 256M in my nginx.conf file in Laravel Forge. – Jonathan Simcoe Aug 16 at 18:06
2

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.

1

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.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.