Increasing the PHP-FPM Memory Limit

Some PHP applications require the memory limit to be increased above the default value. When running PHP via FPM, this requires specific files to be changed. Crucially, after the configuration change, the correct service needs to be restarted. In my case, I thought restarting the webserver (apache2 in my case) would be required, but instead the PHP-FPM service needs to be restarted.

The commands below are for PHP-FPM version 8.1. Replace 8.1 with your specific version accordingly.

1
2
3
cd /etc/php/8.1/fpm
sudo nano php.ini
sudo systemctl restart php8.1-fpm.service