PHPMyAdmin max upload size will not change, wrong php.ini file

PHPMyAdmin max upload size will not change, wrong php.ini file

  1. Blog
  2. 15 November 2026
  3. 3 min read

Stefan Bogdanescu

Founder & Senior Architect

PHPMyAdmin max upload size will not change, wrong php.ini file

When you modify upload_max_filesize or post_max_size in WAMP and see no change in phpMyAdmin's default limit of 2,048KB, the issue usually isn't a missing environment variable. It is almost certainly that you are editing the wrong PHP configuration file. In shared hosting environments, this limit is often set via .htaccess, but on local setups like WAMP or XAMPP, the behavior depends entirely on which php.ini the application actually loads.

The most common pitfall is assuming that the php.ini located in your installation folder (e.g., C:\wamp64\bin\apache\apache2.4.x\conf\php.ini) is the one being used by phpMyAdmin. While this file controls the web server's general PHP settings, phpMyAdmin itself often ships with its own copy of php.ini inside its installation directory to enforce strict defaults. If you edit the global configuration but ignore the application-specific one, your changes will be overridden every time you refresh the page.

To resolve this, you must locate the specific php.ini that corresponds to the Apache instance serving phpMyAdmin and ensure it is active. In WAMP, check the httpd.conf or apache2.conf file for a line like LoadModule php_module ... followed by an Include directive pointing to a specific path. If you see something like Include conf/extra/*.conf, ensure your custom settings are loaded there. However, the most reliable method for local development is to explicitly specify the configuration file in the Apache config:

LoadModule php_module "C:/wamp64/bin/php/php8.x/lib/php/php8.dll"
# ... other directives ...
php_admin_value upload_max_filesize 20M
php_admin_value post_max_size 20M

Note the use of php_admin_value instead of php_value. The latter allows the script to override the setting, but phpMyAdmin may attempt to reset it based on its own defaults. Using php_admin_value forces the server-level configuration regardless of what the application tries to set. If you are using a separate php.ini inside the phpMyAdmin folder, you must edit that file directly and ensure the Apache virtual host for phpMyAdmin points to this specific PHP binary or includes the correct path.

Another frequent oversight involves the order of operations during server restarts. Simply saving the file and clicking "Restart All" in WAMP is not always sufficient if the configuration was loaded before the change. You must ensure the server stops completely before restarting. In some cases, Apache caches the SAPI module initialization, requiring a full service stop and start rather than a graceful reload.

Additionally, verify that memory_limit is also increased. If you set upload_max_filesize to 20M but leave memory_limit at the default 128M or lower, PHP might still fail processing for large files depending on how the upload is handled internally. For database dumps specifically, ensure max_execution_time is sufficiently high, as a 6MB SQL file might take several seconds to parse if the connection is slow.

Finally, check your browser and phpMyAdmin session settings. Some versions of phpMyAdmin enforce a hard limit in their own PHP code (config.inc.php). Look for lines defining $cfg['UploadDir'] or specific upload directives within that config file. If those are hardcoded to 2MB, editing the system php.ini will have zero effect because the application logic intercepts the request before hitting the server limits.

If you are deploying this stack to production later, remember that these hard-coded limits in application configs can be dangerous. Always prefer setting limits via Apache directives or global php.ini files where possible, reserving application-level overrides for security-critical boundaries that must never exceed a certain threshold.

Our network