1. Locate php.ini
Firstly, you need to locate your php.ini file. In this example, our php.ini
is located in /etc/php/8.1/apache2/php.ini
, however, this may be different for you depending on your PHP version. If you are unsure, please read:
2. Edit php.ini
Open your php.ini
file with nano
.
sudo nano /etc/php/8.1/apache2/php.ini
upload_max_filesize
In nano, press CTRL
+ W
and search for upload_max_filesize
and change the value to 64M
(for 64 megabytes) or whatever value you require.
upload_max_filesize = 64M
post_max_size
Press CTRL
+ W
again and search for post_max_size
and change the value to 64M
(for 64 megabytes) or whatever value you require.
post_max_size = 64M
Save and exit (press CTRL
+ X
, press Y
and then press ENTER
)
3. Restart Apache/PHP
Restart Apache to apply changes.
sudo systemctl restart apache2
If you are using PHP-FPM, you may need to restart PHP-FPM service separately.
Let me know if this helped. Follow me on Twitter, Facebook and YouTube, or 🍊 buy me a smoothie.
thank u sm, I was missing the restarting part.
Apache LimitRequestBody directive is equally as important, if already set to a value
This is a really fantastic explanation. Many thanks!
you are the man. helped me so much. Thank you so much
thanks so much ..you made may day to be good for this helpness
You are excellent. Top quality work.
Thanks!!!!
Works like magic
🙂
Thanks For Sharing