You might be facing upload max file size issue on WordPress when you’re trying to upload manually on the server. Let’s see, how to fix the upload max file size. We can increase the maximum upload limit file size on the WordPress server. By default, the limit is 2MB.
Sometimes we don’t find the plugins or theme as we desired. So we have to download and upload it manually on the server but you face the issue of upload max file size like upload limit exceeded in PHP. We can change this limit upload size using php.ini and if you have Cpanel, you can do it from there.
How To Fix the Upload Max File Size Issue In PHP File On WordPress:
When you’re trying to upload any files or plugins on your WordPress website as shown in the below figure.
Once you click on install now and you will see the below error about upload_max_filesize issue on WordPress.
The default, the upload size is 2MB.
Fix Upload File Size Issue:
Method 1: We have to increase the upload file size in the php.ini file on the server. Now look for the parameter “upload_max_filesize” in /etc/php.ini file. I have increased the size to 100MB.
upload_max_filesize = 100M
Check Out: Learn Cat Commands With Examples On CentOS 8
Method 2: you can also define the size in the wp-config.php file in the WordPress directory.
[root@example]# cd /var/www/html/wordpress/ [root@example wordpress]# vim wp-config.php @ini_set('upload_max_size' , '256M' );
Method 3: If you have a .htaccess file created on the server and you can also define these parameters in that file to fix the issues.
post_max_size 256M memory_limit 512M max_input_time 180 max_execution_time 180
Once you have added the above parameters in .htaccess file and save the file. you can upload the files and install any plugins or themes.
Now restart the Apache webserver using systemctl restart httpd
You’re done maximum size wordpress upload limit increase