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

PaulClarke's avatar

Changes to php.ini not being reflected on Forge server

Dear Everyone,

I have an issue with file uploads being refused, not due to validation in my PHP code, which is working, but due to the upload_max_filesize setting in php.ini.

My forge server is running PHP 7.0 and so I have edited the setting in /etc/php/7.0/fpm/php.ini and I have used php_ini_loaded_file() to double check that I am amending the correct copy of php.ini which I am.

I have restarted the server and am still getting a 413 Request Entity too large error. However, when I tried this on my local machine, all I had to do was restart php artisan serve to get this working and everything does work correctly on my local machine.

So I am stumped - can anyone suggest any steps forward I can try?

Many thanks,

0 likes
6 replies
PaulClarke's avatar

I missed out that I have also updated the post_max_size in php.ini

Nash's avatar
Nash
Best Answer
Level 20

If you are using Forge, you can change the max file upload size directly under Servers -> (Your server here) -> Server details -> PHP

2 likes
PaulClarke's avatar

@Nash Thank you - I cannot believe I didn't spot that setting. It worked, although I still cannot understand why changing the php.ini file directly wasn't working!

Nash's avatar

@PaulClarke Happy to help. Yes, changing post_max_size and upload_max_filesize in php.ini should work, so I did some digging and found that you may also need to set client_max_body_size inside the http block of your nginx.conf file. Forge seems to have this line set in /etc/nginx/conf.d/uploads.conf (which is included in the http block of /etc/nginx/nginx.conf, so basically the same thing). Nginx also has a client_body_timeout setting in case you need to increase the timeout (for very large uploads).

Please or to participate in this conversation.