You edited php.ini but phpMyAdmin still shows the old upload size
phpMyAdmin max upload size will not changeShort answer
PHP reads one main php.ini chosen per SAPI, plus extra .ini files from a scan directory. The command line and the web server can load different files. Ask the web server's PHP which files it loaded, edit that one, check the scan directory for an override, and restart the server.
Fix it fast
1Find out which cause you have
Ask PHP which files it loaded. Run this through the web server, not only the terminal: a one-line script placed in the web root prints the loaded files, then delete it.
<?php var_dump(php_ini_loaded_file(), php_ini_scanned_files(), ini_get('upload_max_filesize'));2Match what you see, then jump to its fix
- 1
php --ini shows a different path than the web page doesYou edited the CLI php.ini, the web server loads anotherFix - 2
php_ini_scanned_files() lists .ini files and one of them sets the same directiveA file in the scan directory overrides your valueFix - 3
The file is right but the web page shows the old valueThe web server was not restartedFix
- 1
What does the error look like?
phpMyAdmin max upload size will not changeupload_max_filesize still reads 2M after you raised it in php.ini
Cause 1 of 3
You edited the CLI php.ini, the web server loads another
1Check
PHP looks for php-SAPI.ini first and then php.ini, and the path depends on the SAPI (Apache module, FPM, CLI). Each can have its own file.
php --ini2Fix
Edit the file that the web page reports, not the one the terminal reports.
sudo nano /etc/php/8.3/apache2/php.ini3Verify
Reload the one-line script and read the loaded file path again.
curl -s http://localhost/ini-check.phpConfirmed by php.net
Cause 2 of 3
A file in the scan directory overrides your value
1Check
After the main file, PHP loads every .ini file in the scan directory in alphabetical order, so a later file can win.
grep -R -n "upload_max_filesize" /etc/php/8.3/2Fix
Change the directive in the file that sets it last, or remove the duplicate line.
; in the last file that sets it
upload_max_filesize = 64M
post_max_size = 64M3Verify
Read the loaded values from the web.
curl -s http://localhost/ini-check.phpConfirmed by php.net
Cause 3 of 3
The web server was not restarted
1Check
For the server module versions of PHP, php.ini is read only once, when the web server starts. CGI and CLI read it on every run.
sudo systemctl status apache22Fix
Restart the web server (or PHP-FPM if you use it) after every change.
sudo systemctl restart apache23Verify
Open phpMyAdmin again and read the upload limit.
curl -s http://localhost/ini-check.phpConfirmed by php.net
How do I stop it coming back?
- Always find the loaded file from the web server before editing.
- Remove the check script after use.
- Keep overrides in one scan-directory file so they are easy to find.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies:
Related fixes
Databases
phpMyAdmin will not import a big SQL file
Import runs for a while, then the page stops or shows a blank result
phpMyAdmin hands the upload to PHP, so PHP's limits decide the maximum size.
4 causes, each with a fixBack end
Apache returns 503 or 504 because PHP-FPM did not answer in time
Error dispatching request
Apache sent the request to PHP-FPM and gave up waiting.
3 causes, each with a fixBack end
AWS SDK for PHP cannot get credentials from the instance profile metadata server
Error retrieving credentials from the instance profile metadata server.
The SDK tries the EC2 instance metadata service when it has no valid credentials from anywhere earlier in its chain.
4 causes, each with a fixBack end
AWS SDK for PHP rejects requests: the signature is from the future
Signature not yet current: {date} is still later than {date}
AWS compares the timestamp in your signed request with its own clock.
2 causes, each with a fixBack end
CodeIgniter 4 cannot write its cache files
CodeIgniter\Cache\Exceptions\CacheException: Cache unable to write to /var/www/app/writable/cache/
CodeIgniter 4's file cache needs a cache directory that the web server can really write to.
2 causes, each with a fixBack end
CodeIgniter 3 loads the model but the property is undefined
The model name you are loading is the name of a resource that is already being used: user
CodeIgniter 3 expects a model file named like its class, with the first letter capitalised, for example User_model.php holding class User_model.
2 causes, each with a fix