I am using cPanel of my website to increase maximum upload file size for wordpress media uploads. I have used the codes(found out from google) for this purpose wp-config.php
On cpanel -> software and services -> Select PHP Version.
Choose a PHP version which not the native one (I recommend php 5.6 or last one) and you will have / see a new link "Switch To PHP Settings", click it, in PHP Settings you can set upload_max_filesize in last line , clicking on value ( default is 2M ) , and you got a dropbox with values that you can set to upload_max_filesize, and click save .
Login to your WHM panel if you have access to
Then go to Software -> MultiPHP INI Editor
Then select the php version from the dropdown, then scroll down for the upload_max_filesize which will be 2M by default, now increase it according to your need.
Also enable the file_uploads for HTTP file uploads for convenience.
If you don't have access to WHM, then follow the .htaccess method.
In my case it was wp-admin/.user.ini
:
post_max_size = 33M
upload_max_filesize = 32M
php.ini settings should be like given below, if the '=' symbol is not put between the setting and value, it doesn't work
post_max_size = 100M
upload_max_filesize = 100M
On CPanel 64.0.40 (I didn't try any other version): Go in "Software" then "Select PHP Version" then "Switch To PHP Options" then upload_max_filesize => click on the value and select the one you prefer :) It's super hidden for such a critical option...
I have found the answer and solution to this problem. Before, I did not know that php.ini resides where in wordpress files. Now I have found that file in wp-admin directory where I placed the code
post_max_size 33M
upload_max_filesize 32M
then it worked. It increases the upload file size for my worpdress website. But, it is the same 2M as was before on cPanel.