PHP Configuration: memory_limit, upload_max_filesize and max_execution_time

PHP · 19.04.2026
PHP Configuration: memory_limit, upload_max_filesize and max_execution_time

Where PHP Settings Are Stored

PHP parameters can be set in several places. Priority (highest to lowest): ini_set() in code.user.ini.htaccessphp.ini. Changes to php.ini require PHP-FPM reload.

Key PHP Parameters

ParameterDefaultRecommendedDescription
memory_limit128M256–512MMemory limit per PHP process
upload_max_filesize2M64–256MMax uploaded file size
post_max_size8Mupload + 2–10MMax POST request size
max_execution_time3060–300Max script execution time (sec)

Change via php.ini

sudo nano /etc/php/8.2/fpm/php.ini

memory_limit = 512M
upload_max_filesize = 128M
post_max_size = 130M
max_execution_time = 300
post_max_size must exceed upload_max_filesize or large file uploads will fail.

Change via .user.ini (shared hosting)

memory_limit = 256M
upload_max_filesize = 64M
post_max_size = 68M

Apply Changes

sudo systemctl reload php8.2-fpm
php -r "echo ini_get('memory_limit');"
← Back to Knowledge Base Ask Support