[Solution] WordPress ERROR: The uploaded file exceeds the upload_max_filesize directive in php.ini
If you have encountered the below error on your WordPress Blog you might be trying to do the below:
- Import XML file to import contents of another blog to yours
- Upload a particular file on to your WordPress blog
Sorry, there has been an error. The uploaded file exceeds the upload_max_filesize directive in php.ini. Allowed size: 2Mb
Two Solution that worked:
Solution1: Create or Edit PHP.ini file
In case you are on a shared server, you might not find the php.ini file on your hosting root folder, if it’s not there create a new file called php.ini and paste the below content. If it’s already there, edit to add the below to the content.
upload_max_filesize = 64M post_max_size = 64M max_execution_time = 300
Solution2: Editing the .htaccess file in the root
Open the .htaccess file in the root of your FTP folder and edit to add the below to change the upload size and interval for the same.
php_value upload_max_filesize 64M php_value post_max_size 64M php_value max_execution_time 300 php_value max_input_time 300
I personally found the second solution to work for me and preferred that. Please note that, it might not immediately fix the issue, for me it took around 5 minutes for the upload values to reflect in WordPress. Hope this has helped you fix the upload issue, please let me know if it worked or not.