Set custom package max length for Swoole in Laravel Octane

...
profile picture of ghostzero
GhostZero
Software Developer
Published at July 19, 2021

In the last weeks I had the problem that employees could upload a maximum of 2M files in our Admin Console. They received the HTTP 413 Payload Too Large response status code, which indicates that the request entity is larger than limits defined by server. The first thing I tried was to adjust upload_max_filesize and post_max_size. But without success.

Solution

After some searching I found the following undocumented example.

You can set your max upload/post file size to 100M with the following config in config/octane.php.

'swoole' => [
    'options' => [
        'package_max_length' => 1024 * 1024 * 100,
    ],
],
Follow me!

Related stories

You liked Set custom package max length for Swoole in Laravel Octane? You may also be interested in these following articles...
...

With SUBtember right around the corner, you might be wondering what all the fuss is about. What's the difference between a subathon and SUBtember? Let's take a closer look.

GhostZero
1 year ago
...

Düsseldorf. 70,000 visitors came to the DoKomi for manga fans and cosplay in Düsseldorf. This means that DoKomi set a new record for visitor numbers and a growth of +27 percent (compared to 2019).

GhostZero
1 year ago
...

Mit YAFS (Yet Another Firmware Selector) ist es nun möglich die Freifunk Ense Firmware für unterstützte Router zu finden und herunterzuladen.

GhostZero
2 years ago
GhostZero is live on Twitch!
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy.