The title says it all. You’ve got a server, in my case on Digital Ocean, and you need to update the PHP values for things like upload_max_filesize
but only for your isolated site.
Start by using ssh
with your forge
user to log into the site. Then you’re looking for a path like /etc/php/8.3/fpm/pool.d
change this as needed for your PHP version. Inside this location you should see a file corresponding to your site user which would look like this: siteuser.conf
.
With your forge
user type sudo su
and then your sudo password. Then type vim siteuser.conf
or nano siteuser.conf
if you prefer. Scroll to the bottom and then add this text: php_admin_value[upload_max_filesize] = 64M
if you want to allow larger (huge uploads really).
This same process can be followed for all your PHP settings which had me ending up with this at the bottom of my configuration file1.
php_admin_value[memory_limit] = 512M
php_admin_value[max_execution_time] = 300
php_admin_value[max_input_vars] = 3000
php_admin_value[max_input_time] = 300
php_admin_value[post_max_size] = 64M
php_admin_value[upload_max_filesize] = 64M
Once you’re done you’ll need to restart PHP with sudo -S service php8.3-fpm reload
. Again, change this to match your version of PHP. Give it a few seconds and your new values should show up.
- Are those values crazy, probably but they are the minimum required values for a WordPress theme my customer insists on using. ↩︎