When dealing with file upload size issues in a Laravel application using Octane and FrankenPHP, there are a few areas to check and ensure that the settings are correctly applied:
-
Verify PHP Configuration: Ensure that the
php.inifile on your server has the correct settings forupload_max_filesizeandpost_max_size. You can verify this by creating a simple PHP script to output the current configuration:<?php phpinfo(); ?>Access this script through your web server to confirm the settings are as expected.
-
Check Octane Configuration: Since you're using Laravel Octane, ensure that Octane is not overriding or ignoring these settings. Octane uses Swoole or RoadRunner, which might have their own configurations. Check your
config/octane.phpfile for any relevant settings. -
Caddy Configuration: Since you mentioned using Caddy, ensure that Caddy is not imposing its own limits. Check your Caddyfile for any directives related to request size limits. You might need to add or adjust the
max_request_body_sizedirective:{ max_request_body_size 100MB }Adjust the size according to your needs.
-
Environment Variables: Sometimes, environment variables can override PHP settings. Check your
.envfile for any variables that might be affecting upload sizes, such asUPLOAD_MAX_FILESIZEorPOST_MAX_SIZE. -
Restart Services: After making changes to configuration files, ensure that you restart the necessary services. This includes PHP-FPM, Caddy, and any Octane workers. This ensures that all changes are applied.
-
Check for Errors: Look at your server logs for any errors or warnings that might give more insight into why the settings are not being respected. This can include PHP error logs, Caddy logs, or Laravel logs.
By following these steps, you should be able to identify and resolve the issue with the file upload size not being respected in your Laravel application using Octane and FrankenPHP.