The difference between the local value and the master value of upload_max_filesize
in your PHP configuration usually occurs because:
php.ini
file maintained by cPanel > Select a PHP version.The Local Value of a PHP variable is controlled by the developer via script commands, while the Global Value is maintained through cPanel > Select a PHP version. The local value can be set by the developer via code or configuration files. The commonly used location set PHP variable in code are;
.htaccess
file, httpd.conf
, or a specific virtual host configuration overrides the global value from php.ini
, the local value will differ.ini_set()
to change the upload_max_filesize
at runtime for the current script.ini_set()
based PHP variable values in configuration files like wp-config.php To align the local value and master value, you need to identify where the override is happening and make the necessary adjustments.
Check the Master Configuration in php.ini
:
php.ini
file. You can find its path using:
upload_max_filesize
directive and set it to the desired value. For example:
Ensure No Overrides Exist in .htaccess:
.htaccess
files in the current directory or parent directories.php_value upload_max_filesize 10M
php.ini
value.Check for Runtime Overrides:
ini_set()
calls that might alter the upload_max_filesize
value during execution.Verify the Changes:
phpinfo()
and confirm that both the local value and master value now match.
post_max_size
value in php.ini
is also large enough to handle the uploads. It should generally be larger than upload_max_filesize
.