Steps by environment
The right file and the right service name depend on how PHP runs on your server. First find out which of these you have: Apache running PHP as mod_php, Apache or nginx forwarding PHP requests to PHP-FPM, or shared hosting where you can’t touch server-level configuration. Sources are PHP’s advisory and manual, and each vendor’s own documentation. Syntax is for current PHP 8 releases. Config file locations and service names vary by distribution and host.
Apache with mod_php
PHP’s manual describes php_admin_flag name on|off as an Apache configuration directive for PHP running as an Apache module. It can’t go in .htaccess and can’t be overridden by .htaccess or ini_set().3 Don’t use php_value for a boolean.3
php_admin_flag session.upload_progress.enabled off
This applies to mod_php only. If Apache forwards PHP to PHP-FPM, use the FPM steps below. Restart Apache so every worker loads the change.
PHP-FPM, behind Apache or nginx
Use the file that matches the context. In the php.ini that FPM reads, use the plain INI form:
session.upload_progress.enabled = 0
In an FPM pool file, use the manual’s pool syntax. Settings made this way can’t be overridden with ini_set().4
php_admin_flag[session.upload_progress.enabled] = off
php_admin_flag[...] belongs in a pool file, not in php.ini. Then restart the PHP-FPM service. The unit name and file paths differ by distribution, so check yours.
cPanel
Server admins: WHM’s MultiPHP INI Editor, Editor Mode, edits the php.ini for the PHP version you select.6 cPanel’s support article points system-wide changes to WHM, not the account-level editor.8 The account-level editor targets a home directory or a domain’s document root.7 That is per-account scope, so account holders on shared hosting should ask the host. The cPanel pages I opened don’t say whether Save restarts workers. Restart PHP-FPM and Apache, and confirm with the check below.
Plesk
Plesk’s knowledge base sends domain-level changes to Domains > your domain > PHP Settings, and server-wide php.ini changes to Tools & Settings > PHP Settings > your PHP version > the php.ini tab. The “Additional configuration directives” field is for Plesk administrators only.9 The article doesn’t say that saving restarts workers. Confirm the value afterwards.
Docker and containers
Put the setting in an .ini file in the image’s PHP config directory, rebuild the image and redeploy. Server Side Up’s docs show the pattern: copy a file into /usr/local/etc/php/conf.d/.10 Restarting a container built from the unchanged image changes nothing.
Shared hosting without server access
If you can’t change server-level configuration, ask the host to apply the setting, in writing. Account-level editors and .user.ini are not equivalent, and PHP advises against relying on the latter. Reported webhosting.today’s roundup records that InMotion, Hostinger and Infomaniak switched upload progress off on their platforms. It also notes that one.com warned its countermeasures could disrupt uploads and direct database access, and that GoDaddy asked VPS customers to apply the setting themselves.11