Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

ahmedde's avatar

Octane is ignoring php.ini and disabling large file uploads. Non-Octane uploads work

Hi there,

Every File upload I attempt larger than 2 MB on Filament fails. I don't see error in my logs, but I inspected the network requests from the browser and the errors are "413 | Request entity too large - nginx".

We're using Laravel Octane (FrankenPHP) on Forge (Ubuntu on DigitalOcean) and outside of this issue it's working fine. I'm also having the same issue running locally.

Steps to address the issue:

  1. Confirmed the php.ini settings: I have set this php configuration on both /etc/php/8.4/fpm/php.ini and /etc/php/8.4/cli/php.ini:
upload_max_filesize = 40M
post_max_size = 40M
memory_limit = 128M
  1. Checked Nginx configuration: Forge does this already, but manually checked Nginx config had client_max_body_size 40M;
  2. Made sure no Laravel limit on file uploads or file size validation set on the file uploaders.
  3. Tried changing from FrankenPHP to Swoole.
  4. Restarted the services after each configuration update.

The issue still persists after all. Before I went crazy I turned Octane off and switched to regular PHP-FPM pool and the uploads were working just fine as expected.

What could be the reason that Octane is ignoring these configurations and still setting a file upload limit? It seems to be using a default of 2 MB since this is PHP's default, but I cannot find any other PHP configuration files other than the cli and the fpm.

I would appreciate any help towards this.

Thanks,

0 likes
6 replies
ahmedde's avatar

Thanks for your reply.

I checked the docs and couldn't find any reference of the php.ini files they mentioned in the docs.

Locally and on Forge, we're using Debian. No docker on both locations and also there are:

  • no /etc/frankenphp/php.ini
  • no /etc/frankenphp/php.d/*.ini
  • no /usr/lib/frankenphp/modules/

Tried a more of a brute-force to search for all *.ini files and nothing there related to frankenphp

JussiMannisto's avatar

Depending on your installation method, the PHP interpreter will look for configuration files in locations described below.

Those are the paths that FrankenPHP looks for. If you need a php.ini file and you don't have one, you can add it yourself.

ahmedde's avatar

Thanks again,

So I repeatedly copied php.ini to any location frankenPHP would look at. Then I tested with a phpinfo() route. The loaded php.ini file was the /etc/php/8.4/cli/php.ini anyways and the file upload limits were correctly set to high values on the phpinfo page.

When I tried uploading locally: => using http (httpL//localhost:8000): works fine => using https with Valet .test domain: upload failed because of nginx. When I put client_max_body_size 40M; on local nginx config it worked.

On Production:

  • Confirmed again that it loads the correct php.ini with the correct file upload sizes.
  • Uploads still fail because of 413 | Entity too large by Nginx.

Nginx already has client_max_body_size 40M; on prodcution, and the normal FPM-PHP pool already respects this value when I try uploading with it. However, it seems Octane is using a different nginx configuration?

JussiMannisto's avatar

Just to be clear:

  • FrankenPHP comes with its own PHP runtime. It doesn't use PHP-FPM.
  • FrankenPHP is its own web server, built on top of Caddy. It doesn't use Nginx.

You could use Nginx as a reverse proxy in front of FrankenPHP, but I'm not sure what that accomplishes.

I've only played with FrankenPHP a bit locally, and I've never used Valet, so I don't think I'm able to help you with its setup.

ahmedde's avatar

OK so after lots of trial and error this what I did to work (Production on Forge):

1- Chang FrankenPHP server to Swoole or Roadrunner.

2- add a new filesystem config for livewire in config/filesystems.php

'tmp' => [  
    'driver' => 'local',  
    'root' => storage_path('app/livewire-tmp'),  
],

3- publish livewire config (if it's not already) and update the disk config:

'temporary_file_upload' => [  
    'disk' => 'tmp',
	// .. rest

4- In the server nginx config, in the @octane block add this: proxy_set_header X-Forwarded-Proto https;

5- In bootstrap/app.php append this:

->withMiddleware(function (Middleware $middleware) {  
	// .. rest
    $middleware->trustProxies(at: '*');  
})

If you are working locally, this issue wouldn't happen if you're using http://localhost, but if you are using valet it would happen, so follow 1 and 2, then add a client_max_body_size {max_size}m to your local Nginx config

While I don't understand why this works, after 10 hours of debugging and losing my sanity I stopped caring. The solution was there already by turning off Octane.

Please or to participate in this conversation.